mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drivers: message: fusion: mptsas.c: Fix spaces during declaration
@ 2021-04-24 16:47 Shubhankar Kuranagatti
  2021-04-24 19:58 ` kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: Shubhankar Kuranagatti @ 2021-04-24 16:47 UTC (permalink / raw)
  To: sathya.prakash
  Cc: sreekanth.reddy, suganath-prabu.subramani, MPT-FusionLinux.pdl,
	linux-scsi, linux-kernel, sanjanasrinidhi1810

Spaces have been added after a ',' at the time of declaration
Extra spaces have been removed at the end of closing ')'.
Tabs have been used instead of spaces to maintain uniformity.

Signed-off-by: Shubhankar Kuranagatti <shubhankarvk@gmail.com>
---
 drivers/message/fusion/mptsas.c | 45 ++++++++++++++++-----------------
 1 file changed, 22 insertions(+), 23 deletions(-)

diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 5eb0b3361e4e..b8d312e15c58 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -406,7 +406,7 @@ static inline MPT_ADAPTER *rphy_to_ioc(struct sas_rphy *rphy)
 static struct mptsas_portinfo *
 mptsas_find_portinfo_by_handle(MPT_ADAPTER *ioc, u16 handle)
 {
-	struct mptsas_portinfo *port_info, *rc=NULL;
+	struct mptsas_portinfo *port_info, *rc = NULL;
 	int i;
 
 	list_for_each_entry(port_info, &ioc->sas_topology, list)
@@ -491,7 +491,7 @@ mptsas_port_delete(MPT_ADAPTER *ioc, struct mptsas_portinfo_details * port_detai
 	    port_details->phy_bitmask));
 
 	for (i = 0; i < port_info->num_phys; i++, phy_info++) {
-		if(phy_info->port_details != port_details)
+		if (phy_info->port_details != port_details)
 			continue;
 		memset(&phy_info->attached, 0, sizeof(struct mptsas_devinfo));
 		mptsas_set_rphy(ioc, phy_info, NULL);
@@ -684,8 +684,8 @@ mptsas_add_device_component_starget_ir(MPT_ADAPTER *ioc,
 	RaidPhysDiskPage0_t 		phys_disk;
 	struct mptsas_device_info	*sas_info, *next;
 
-	memset(&cfg, 0 , sizeof(CONFIGPARMS));
-	memset(&hdr, 0 , sizeof(ConfigPageHeader_t));
+	memset(&cfg, 0, sizeof(CONFIGPARMS));
+	memset(&hdr, 0, sizeof(ConfigPageHeader_t));
 	hdr.PageType = MPI_CONFIG_PAGETYPE_RAID_VOLUME;
 	/* assumption that all volumes on channel = 0 */
 	cfg.pageAddr = starget->id;
@@ -879,7 +879,7 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
 		    "%s: [%p]: deleting phy = %d\n",
 		    ioc->name, __func__, port_details, i));
 		port_details->num_phys--;
-		port_details->phy_bitmask &= ~ (1 << phy_info->phy_id);
+		port_details->phy_bitmask &= ~(1 << phy_info->phy_id);
 		memset(&phy_info->attached, 0, sizeof(struct mptsas_devinfo));
 		if (phy_info->phy) {
 			devtprintk(ioc, dev_printk(KERN_DEBUG,
@@ -912,10 +912,10 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
 				goto out;
 			port_details->num_phys = 1;
 			port_details->port_info = port_info;
-			if (phy_info->phy_id < 64 )
+			if (phy_info->phy_id < 64)
 				port_details->phy_bitmask |=
 				    (1 << phy_info->phy_id);
-			phy_info->sas_port_add_phy=1;
+			phy_info->sas_port_add_phy = 1;
 			dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT "\t\tForming port\n\t\t"
 			    "phy_id=%d sas_address=0x%018llX\n",
 			    ioc->name, i, (unsigned long long)sas_address));
@@ -931,7 +931,7 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
 				continue;
 			if (sas_address != phy_info_cmp->attached.sas_address)
 				continue;
-			if (phy_info_cmp->port_details == port_details )
+			if (phy_info_cmp->port_details == port_details)
 				continue;
 			dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT
 			    "\t\tphy_id=%d sas_address=0x%018llX\n",
@@ -949,12 +949,12 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
 				if (!phy_info_cmp->port_details->num_phys)
 					kfree(phy_info_cmp->port_details);
 			} else
-				phy_info_cmp->sas_port_add_phy=1;
+				phy_info_cmp->sas_port_add_phy = 1;
 			/*
 			 * Adding a phy to a port
 			 */
 			phy_info_cmp->port_details = port_details;
-			if (phy_info_cmp->phy_id < 64 )
+			if (phy_info_cmp->phy_id < 64)
 				port_details->phy_bitmask |=
 				(1 << phy_info_cmp->phy_id);
 			port_details->num_phys++;
@@ -1218,8 +1218,8 @@ static int
 mptsas_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
 {
 	MPT_SCSI_HOST	*hd = shost_priv(ioc->sh);
-        struct list_head *head = &hd->target_reset_list;
-	u8		id, channel;
+	struct list_head *head = &hd->target_reset_list;
+	u8 id, channel;
 	struct mptsas_target_reset_event	*target_reset_list;
 	SCSITaskMgmtReply_t *pScsiTmReply;
 
@@ -2585,7 +2585,7 @@ mptsas_sas_device_pg0(MPT_ADAPTER *ioc, struct mptsas_devinfo *device_info,
 	SasDevicePage0_t *buffer;
 	dma_addr_t dma_handle;
 	__le64 sas_address;
-	int error=0;
+	int error = 0;
 
 	hdr.PageVersion = MPI_SASDEVICE0_PAGEVERSION;
 	hdr.ExtPageLength = 0;
@@ -2748,7 +2748,7 @@ mptsas_sas_expander_pg1(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info,
 	CONFIGPARMS cfg;
 	SasExpanderPage1_t *buffer;
 	dma_addr_t dma_handle;
-	int error=0;
+	int error = 0;
 
 	hdr.PageVersion = MPI_SASEXPANDER1_PAGEVERSION;
 	hdr.ExtPageLength = 0;
@@ -3307,7 +3307,7 @@ mptsas_probe_hba_phys(MPT_ADAPTER *ioc)
 	int error = -ENOMEM, i;
 
 	hba = kzalloc(sizeof(struct mptsas_portinfo), GFP_KERNEL);
-	if (! hba)
+	if (!hba)
 		goto out;
 
 	error = mptsas_sas_io_unit_pg0(ioc, hba);
@@ -4255,8 +4255,8 @@ mptsas_adding_inactive_raid_components(MPT_ADAPTER *ioc, u8 channel, u8 id)
 	struct mptsas_phyinfo	*phy_info;
 	struct mptsas_devinfo		sas_device;
 
-	memset(&cfg, 0 , sizeof(CONFIGPARMS));
-	memset(&hdr, 0 , sizeof(ConfigPageHeader_t));
+	memset(&cfg, 0, sizeof(CONFIGPARMS));
+	memset(&hdr, 0, sizeof(ConfigPageHeader_t));
 	hdr.PageType = MPI_CONFIG_PAGETYPE_RAID_VOLUME;
 	cfg.pageAddr = (channel << 8) + id;
 	cfg.cfghdr.hdr = &hdr;
@@ -5157,10 +5157,10 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	int			 numSGE = 0;
 	int			 scale;
 	int			 ioc_cap;
-	int			error=0;
+	int			error = 0;
 	int			r;
 
-	r = mpt_attach(pdev,id);
+	r = mpt_attach(pdev, id);
 	if (r)
 		return r;
 
@@ -5211,9 +5211,8 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			"Unable to register controller with SCSI subsystem\n",
 			ioc->name);
 		error = -1;
-		goto out_mptsas_probe;
-        }
-
+		goto out_mptsas_probe
+	}
 	spin_lock_irqsave(&ioc->FreeQlock, flags);
 
 	/* Attach the SCSI Host to the IOC structure
@@ -5310,7 +5309,7 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	spin_unlock_irqrestore(&ioc->FreeQlock, flags);
 
-	if (ioc->sas_data.ptClear==1) {
+	if (ioc->sas_data.ptClear == 1) {
 		mptbase_sas_persist_operation(
 		    ioc, MPI_SAS_OP_CLEAR_ALL_PERSISTENT);
 	}
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] drivers: message: fusion: mptsas.c: Fix spaces during declaration
  2021-04-24 16:47 [PATCH] drivers: message: fusion: mptsas.c: Fix spaces during declaration Shubhankar Kuranagatti
@ 2021-04-24 19:58 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-04-24 19:58 UTC (permalink / raw)
  To: Shubhankar Kuranagatti, sathya.prakash
  Cc: kbuild-all, sreekanth.reddy, suganath-prabu.subramani,
	MPT-FusionLinux.pdl, linux-scsi, linux-kernel,
	sanjanasrinidhi1810

[-- Attachment #1: Type: text/plain, Size: 8877 bytes --]

Hi Shubhankar,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.12-rc8 next-20210423]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Shubhankar-Kuranagatti/drivers-message-fusion-mptsas-c-Fix-spaces-during-declaration/20210425-004917
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 8db5efb83fa99e81c3f8dee92a6589b251f117f3
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/1196e3245d739d86f0445c20220cdfc5fca1eb5b
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Shubhankar-Kuranagatti/drivers-message-fusion-mptsas-c-Fix-spaces-during-declaration/20210425-004917
        git checkout 1196e3245d739d86f0445c20220cdfc5fca1eb5b
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=arc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/message/fusion/mptsas.c: In function 'mptsas_add_device_component_starget':
   drivers/message/fusion/mptsas.c:783:14: warning: variable 'vtarget' set but not used [-Wunused-but-set-variable]
     783 |  VirtTarget *vtarget;
         |              ^~~~~~~
   drivers/message/fusion/mptsas.c: In function 'mptsas_reprobe_lun':
   drivers/message/fusion/mptsas.c:4233:6: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
    4233 |  int rc;
         |      ^~
   drivers/message/fusion/mptsas.c: In function 'mptsas_issue_tm':
   drivers/message/fusion/mptsas.c:4791:17: warning: variable 'timeleft' set but not used [-Wunused-but-set-variable]
    4791 |  unsigned long  timeleft;
         |                 ^~~~~~~~
   drivers/message/fusion/mptsas.c: In function 'mptsas_probe':
>> drivers/message/fusion/mptsas.c:5214:24: error: expected ';' before '}' token
    5214 |   goto out_mptsas_probe
         |                        ^
         |                        ;
    5215 |  }
         |  ~                      


vim +5214 drivers/message/fusion/mptsas.c

  5148	
  5149	static int
  5150	mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id)
  5151	{
  5152		struct Scsi_Host	*sh;
  5153		MPT_SCSI_HOST		*hd;
  5154		MPT_ADAPTER 		*ioc;
  5155		unsigned long		 flags;
  5156		int			 ii;
  5157		int			 numSGE = 0;
  5158		int			 scale;
  5159		int			 ioc_cap;
  5160		int			error = 0;
  5161		int			r;
  5162	
  5163		r = mpt_attach(pdev, id);
  5164		if (r)
  5165			return r;
  5166	
  5167		ioc = pci_get_drvdata(pdev);
  5168		mptsas_fw_event_off(ioc);
  5169		ioc->DoneCtx = mptsasDoneCtx;
  5170		ioc->TaskCtx = mptsasTaskCtx;
  5171		ioc->InternalCtx = mptsasInternalCtx;
  5172		ioc->schedule_target_reset = &mptsas_schedule_target_reset;
  5173		ioc->schedule_dead_ioc_flush_running_cmds =
  5174					&mptscsih_flush_running_cmds;
  5175		/*  Added sanity check on readiness of the MPT adapter.
  5176		 */
  5177		if (ioc->last_state != MPI_IOC_STATE_OPERATIONAL) {
  5178			printk(MYIOC_s_WARN_FMT
  5179			  "Skipping because it's not operational!\n",
  5180			  ioc->name);
  5181			error = -ENODEV;
  5182			goto out_mptsas_probe;
  5183		}
  5184	
  5185		if (!ioc->active) {
  5186			printk(MYIOC_s_WARN_FMT "Skipping because it's disabled!\n",
  5187			  ioc->name);
  5188			error = -ENODEV;
  5189			goto out_mptsas_probe;
  5190		}
  5191	
  5192		/*  Sanity check - ensure at least 1 port is INITIATOR capable
  5193		 */
  5194		ioc_cap = 0;
  5195		for (ii = 0; ii < ioc->facts.NumberOfPorts; ii++) {
  5196			if (ioc->pfacts[ii].ProtocolFlags &
  5197					MPI_PORTFACTS_PROTOCOL_INITIATOR)
  5198				ioc_cap++;
  5199		}
  5200	
  5201		if (!ioc_cap) {
  5202			printk(MYIOC_s_WARN_FMT
  5203				"Skipping ioc=%p because SCSI Initiator mode "
  5204				"is NOT enabled!\n", ioc->name, ioc);
  5205			return 0;
  5206		}
  5207	
  5208		sh = scsi_host_alloc(&mptsas_driver_template, sizeof(MPT_SCSI_HOST));
  5209		if (!sh) {
  5210			printk(MYIOC_s_WARN_FMT
  5211				"Unable to register controller with SCSI subsystem\n",
  5212				ioc->name);
  5213			error = -1;
> 5214			goto out_mptsas_probe
  5215		}
  5216		spin_lock_irqsave(&ioc->FreeQlock, flags);
  5217	
  5218		/* Attach the SCSI Host to the IOC structure
  5219		 */
  5220		ioc->sh = sh;
  5221	
  5222		sh->io_port = 0;
  5223		sh->n_io_port = 0;
  5224		sh->irq = 0;
  5225	
  5226		/* set 16 byte cdb's */
  5227		sh->max_cmd_len = 16;
  5228		sh->can_queue = min_t(int, ioc->req_depth - 10, sh->can_queue);
  5229		sh->max_id = -1;
  5230		sh->max_lun = max_lun;
  5231		sh->transportt = mptsas_transport_template;
  5232	
  5233		/* Required entry.
  5234		 */
  5235		sh->unique_id = ioc->id;
  5236	
  5237		INIT_LIST_HEAD(&ioc->sas_topology);
  5238		mutex_init(&ioc->sas_topology_mutex);
  5239		mutex_init(&ioc->sas_discovery_mutex);
  5240		mutex_init(&ioc->sas_mgmt.mutex);
  5241		init_completion(&ioc->sas_mgmt.done);
  5242	
  5243		/* Verify that we won't exceed the maximum
  5244		 * number of chain buffers
  5245		 * We can optimize:  ZZ = req_sz/sizeof(SGE)
  5246		 * For 32bit SGE's:
  5247		 *  numSGE = 1 + (ZZ-1)*(maxChain -1) + ZZ
  5248		 *               + (req_sz - 64)/sizeof(SGE)
  5249		 * A slightly different algorithm is required for
  5250		 * 64bit SGEs.
  5251		 */
  5252		scale = ioc->req_sz/ioc->SGE_size;
  5253		if (ioc->sg_addr_size == sizeof(u64)) {
  5254			numSGE = (scale - 1) *
  5255			  (ioc->facts.MaxChainDepth-1) + scale +
  5256			  (ioc->req_sz - 60) / ioc->SGE_size;
  5257		} else {
  5258			numSGE = 1 + (scale - 1) *
  5259			  (ioc->facts.MaxChainDepth-1) + scale +
  5260			  (ioc->req_sz - 64) / ioc->SGE_size;
  5261		}
  5262	
  5263		if (numSGE < sh->sg_tablesize) {
  5264			/* Reset this value */
  5265			dprintk(ioc, printk(MYIOC_s_DEBUG_FMT
  5266			  "Resetting sg_tablesize to %d from %d\n",
  5267			  ioc->name, numSGE, sh->sg_tablesize));
  5268			sh->sg_tablesize = numSGE;
  5269		}
  5270	
  5271		if (mpt_loadtime_max_sectors) {
  5272			if (mpt_loadtime_max_sectors < 64 ||
  5273				mpt_loadtime_max_sectors > 8192) {
  5274				printk(MYIOC_s_INFO_FMT "Invalid value passed for"
  5275					"mpt_loadtime_max_sectors %d."
  5276					"Range from 64 to 8192\n", ioc->name,
  5277					mpt_loadtime_max_sectors);
  5278			}
  5279			mpt_loadtime_max_sectors &=  0xFFFFFFFE;
  5280			dprintk(ioc, printk(MYIOC_s_DEBUG_FMT
  5281				"Resetting max sector to %d from %d\n",
  5282			  ioc->name, mpt_loadtime_max_sectors, sh->max_sectors));
  5283			sh->max_sectors = mpt_loadtime_max_sectors;
  5284		}
  5285	
  5286		hd = shost_priv(sh);
  5287		hd->ioc = ioc;
  5288	
  5289		/* SCSI needs scsi_cmnd lookup table!
  5290		 * (with size equal to req_depth*PtrSz!)
  5291		 */
  5292		ioc->ScsiLookup = kcalloc(ioc->req_depth, sizeof(void *), GFP_ATOMIC);
  5293		if (!ioc->ScsiLookup) {
  5294			error = -ENOMEM;
  5295			spin_unlock_irqrestore(&ioc->FreeQlock, flags);
  5296			goto out_mptsas_probe;
  5297		}
  5298		spin_lock_init(&ioc->scsi_lookup_lock);
  5299	
  5300		dprintk(ioc, printk(MYIOC_s_DEBUG_FMT "ScsiLookup @ %p\n",
  5301			 ioc->name, ioc->ScsiLookup));
  5302	
  5303		ioc->sas_data.ptClear = mpt_pt_clear;
  5304	
  5305		hd->last_queue_full = 0;
  5306		INIT_LIST_HEAD(&hd->target_reset_list);
  5307		INIT_LIST_HEAD(&ioc->sas_device_info_list);
  5308		mutex_init(&ioc->sas_device_info_mutex);
  5309	
  5310		spin_unlock_irqrestore(&ioc->FreeQlock, flags);
  5311	
  5312		if (ioc->sas_data.ptClear == 1) {
  5313			mptbase_sas_persist_operation(
  5314			    ioc, MPI_SAS_OP_CLEAR_ALL_PERSISTENT);
  5315		}
  5316	
  5317		error = scsi_add_host(sh, &ioc->pcidev->dev);
  5318		if (error) {
  5319			dprintk(ioc, printk(MYIOC_s_ERR_FMT
  5320			  "scsi_add_host failed\n", ioc->name));
  5321			goto out_mptsas_probe;
  5322		}
  5323	
  5324		/* older firmware doesn't support expander events */
  5325		if ((ioc->facts.HeaderVersion >> 8) < 0xE)
  5326			ioc->old_sas_discovery_protocal = 1;
  5327		mptsas_scan_sas_topology(ioc);
  5328		mptsas_fw_event_on(ioc);
  5329		return 0;
  5330	
  5331	 out_mptsas_probe:
  5332	
  5333		mptscsih_remove(pdev);
  5334		return error;
  5335	}
  5336	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 67493 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-24 19:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-24 16:47 [PATCH] drivers: message: fusion: mptsas.c: Fix spaces during declaration Shubhankar Kuranagatti
2021-04-24 19:58 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®