* [PATCH 0/2] scsi: pm8001: Further neatening and whitespace @ 2020-11-24 4:36 Joe Perches 2020-11-24 4:36 ` [PATCH 1/2] scsi: pm8001: Convert pm8001_printk to pm8001_info Joe Perches ` (2 more replies) 0 siblings, 3 replies; 6+ messages in thread From: Joe Perches @ 2020-11-24 4:36 UTC (permalink / raw) To: linux-scsi Cc: Jack Wang, James E.J. Bottomley, Martin K. Petersen, linux-kernel Make the logging macro uses clearer and fix a whitespace defect. Joe Perches (2): scsi: pm8001: Convert pm8001_printk to pm8001_info scsi: pm8001: Fix misindentation drivers/scsi/pm8001/pm8001_init.c | 32 +++++++++++++++---------------- drivers/scsi/pm8001/pm8001_sas.c | 4 ++-- drivers/scsi/pm8001/pm8001_sas.h | 4 ++-- 3 files changed, 20 insertions(+), 20 deletions(-) -- 2.26.0 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] scsi: pm8001: Convert pm8001_printk to pm8001_info 2020-11-24 4:36 [PATCH 0/2] scsi: pm8001: Further neatening and whitespace Joe Perches @ 2020-11-24 4:36 ` Joe Perches 2020-11-24 6:23 ` Jinpu Wang 2020-11-24 4:36 ` [PATCH 2/2] scsi: pm8001: Fix misindentation Joe Perches 2020-12-01 4:33 ` [PATCH 0/2] scsi: pm8001: Further neatening and whitespace Martin K. Petersen 2 siblings, 1 reply; 6+ messages in thread From: Joe Perches @ 2020-11-24 4:36 UTC (permalink / raw) To: Jack Wang Cc: James E.J. Bottomley, Martin K. Petersen, linux-scsi, linux-kernel Use the more common logging style. Signed-off-by: Joe Perches <joe@perches.com> --- drivers/scsi/pm8001/pm8001_init.c | 12 ++++++------ drivers/scsi/pm8001/pm8001_sas.c | 4 ++-- drivers/scsi/pm8001/pm8001_sas.h | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c index 13530d7fb8a6..38907f45c845 100644 --- a/drivers/scsi/pm8001/pm8001_init.c +++ b/drivers/scsi/pm8001/pm8001_init.c @@ -1293,8 +1293,8 @@ static int pm8001_pci_suspend(struct pci_dev *pdev, pm_message_t state) tasklet_kill(&pm8001_ha->tasklet[j]); #endif device_state = pci_choose_state(pdev, state); - pm8001_printk(pm8001_ha, "pdev=0x%p, slot=%s, entering operating state [D%d]\n", - pdev, pm8001_ha->name, device_state); + pm8001_info(pm8001_ha, "pdev=0x%p, slot=%s, entering operating state [D%d]\n", + pdev, pm8001_ha->name, device_state); pci_save_state(pdev); pci_disable_device(pdev); pci_set_power_state(pdev, device_state); @@ -1318,16 +1318,16 @@ static int pm8001_pci_resume(struct pci_dev *pdev) pm8001_ha = sha->lldd_ha; device_state = pdev->current_state; - pm8001_printk(pm8001_ha, "pdev=0x%p, slot=%s, resuming from previous operating state [D%d]\n", - pdev, pm8001_ha->name, device_state); + pm8001_info(pm8001_ha, "pdev=0x%p, slot=%s, resuming from previous operating state [D%d]\n", + pdev, pm8001_ha->name, device_state); pci_set_power_state(pdev, PCI_D0); pci_enable_wake(pdev, PCI_D0, 0); pci_restore_state(pdev); rc = pci_enable_device(pdev); if (rc) { - pm8001_printk(pm8001_ha, "slot=%s Enable device failed during resume\n", - pm8001_ha->name); + pm8001_info(pm8001_ha, "slot=%s Enable device failed during resume\n", + pm8001_ha->name); goto err_out_enable; } diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c index 4562b0a5062a..d1e9dba2ef19 100644 --- a/drivers/scsi/pm8001/pm8001_sas.c +++ b/drivers/scsi/pm8001/pm8001_sas.c @@ -1191,7 +1191,7 @@ int pm8001_abort_task(struct sas_task *task) phy_id = pm8001_dev->attached_phy; ret = pm8001_find_tag(task, &tag); if (ret == 0) { - pm8001_printk(pm8001_ha, "no tag for task:%p\n", task); + pm8001_info(pm8001_ha, "no tag for task:%p\n", task); return TMF_RESP_FUNC_FAILED; } spin_lock_irqsave(&task->task_state_lock, flags); @@ -1313,7 +1313,7 @@ int pm8001_abort_task(struct sas_task *task) task->slow_task = NULL; spin_unlock_irqrestore(&task->task_state_lock, flags); if (rc != TMF_RESP_FUNC_COMPLETE) - pm8001_printk(pm8001_ha, "rc= %d\n", rc); + pm8001_info(pm8001_ha, "rc= %d\n", rc); return rc; } diff --git a/drivers/scsi/pm8001/pm8001_sas.h b/drivers/scsi/pm8001/pm8001_sas.h index 5266756a268b..f2c8cbad3853 100644 --- a/drivers/scsi/pm8001/pm8001_sas.h +++ b/drivers/scsi/pm8001/pm8001_sas.h @@ -70,14 +70,14 @@ #define PM8001_DEVIO_LOGGING 0x100 /* development io message logging */ #define PM8001_IOERR_LOGGING 0x200 /* development io err message logging */ -#define pm8001_printk(HBA, fmt, ...) \ +#define pm8001_info(HBA, fmt, ...) \ pr_info("%s:: %s %d:" fmt, \ (HBA)->name, __func__, __LINE__, ##__VA_ARGS__) #define pm8001_dbg(HBA, level, fmt, ...) \ do { \ if (unlikely((HBA)->logging_level & PM8001_##level##_LOGGING)) \ - pm8001_printk(HBA, fmt, ##__VA_ARGS__); \ + pm8001_info(HBA, fmt, ##__VA_ARGS__); \ } while (0) #define PM8001_USE_TASKLET -- 2.26.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] scsi: pm8001: Convert pm8001_printk to pm8001_info 2020-11-24 4:36 ` [PATCH 1/2] scsi: pm8001: Convert pm8001_printk to pm8001_info Joe Perches @ 2020-11-24 6:23 ` Jinpu Wang 0 siblings, 0 replies; 6+ messages in thread From: Jinpu Wang @ 2020-11-24 6:23 UTC (permalink / raw) To: Joe Perches Cc: James E.J. Bottomley, Martin K. Petersen, Linux SCSI Mailinglist, linux-kernel On Tue, Nov 24, 2020 at 5:36 AM Joe Perches <joe@perches.com> wrote: > > Use the more common logging style. > > Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com> Thanks! > --- > drivers/scsi/pm8001/pm8001_init.c | 12 ++++++------ > drivers/scsi/pm8001/pm8001_sas.c | 4 ++-- > drivers/scsi/pm8001/pm8001_sas.h | 4 ++-- > 3 files changed, 10 insertions(+), 10 deletions(-) > > diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c > index 13530d7fb8a6..38907f45c845 100644 > --- a/drivers/scsi/pm8001/pm8001_init.c > +++ b/drivers/scsi/pm8001/pm8001_init.c > @@ -1293,8 +1293,8 @@ static int pm8001_pci_suspend(struct pci_dev *pdev, pm_message_t state) > tasklet_kill(&pm8001_ha->tasklet[j]); > #endif > device_state = pci_choose_state(pdev, state); > - pm8001_printk(pm8001_ha, "pdev=0x%p, slot=%s, entering operating state [D%d]\n", > - pdev, pm8001_ha->name, device_state); > + pm8001_info(pm8001_ha, "pdev=0x%p, slot=%s, entering operating state [D%d]\n", > + pdev, pm8001_ha->name, device_state); > pci_save_state(pdev); > pci_disable_device(pdev); > pci_set_power_state(pdev, device_state); > @@ -1318,16 +1318,16 @@ static int pm8001_pci_resume(struct pci_dev *pdev) > pm8001_ha = sha->lldd_ha; > device_state = pdev->current_state; > > - pm8001_printk(pm8001_ha, "pdev=0x%p, slot=%s, resuming from previous operating state [D%d]\n", > - pdev, pm8001_ha->name, device_state); > + pm8001_info(pm8001_ha, "pdev=0x%p, slot=%s, resuming from previous operating state [D%d]\n", > + pdev, pm8001_ha->name, device_state); > > pci_set_power_state(pdev, PCI_D0); > pci_enable_wake(pdev, PCI_D0, 0); > pci_restore_state(pdev); > rc = pci_enable_device(pdev); > if (rc) { > - pm8001_printk(pm8001_ha, "slot=%s Enable device failed during resume\n", > - pm8001_ha->name); > + pm8001_info(pm8001_ha, "slot=%s Enable device failed during resume\n", > + pm8001_ha->name); > goto err_out_enable; > } > > diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c > index 4562b0a5062a..d1e9dba2ef19 100644 > --- a/drivers/scsi/pm8001/pm8001_sas.c > +++ b/drivers/scsi/pm8001/pm8001_sas.c > @@ -1191,7 +1191,7 @@ int pm8001_abort_task(struct sas_task *task) > phy_id = pm8001_dev->attached_phy; > ret = pm8001_find_tag(task, &tag); > if (ret == 0) { > - pm8001_printk(pm8001_ha, "no tag for task:%p\n", task); > + pm8001_info(pm8001_ha, "no tag for task:%p\n", task); > return TMF_RESP_FUNC_FAILED; > } > spin_lock_irqsave(&task->task_state_lock, flags); > @@ -1313,7 +1313,7 @@ int pm8001_abort_task(struct sas_task *task) > task->slow_task = NULL; > spin_unlock_irqrestore(&task->task_state_lock, flags); > if (rc != TMF_RESP_FUNC_COMPLETE) > - pm8001_printk(pm8001_ha, "rc= %d\n", rc); > + pm8001_info(pm8001_ha, "rc= %d\n", rc); > return rc; > } > > diff --git a/drivers/scsi/pm8001/pm8001_sas.h b/drivers/scsi/pm8001/pm8001_sas.h > index 5266756a268b..f2c8cbad3853 100644 > --- a/drivers/scsi/pm8001/pm8001_sas.h > +++ b/drivers/scsi/pm8001/pm8001_sas.h > @@ -70,14 +70,14 @@ > #define PM8001_DEVIO_LOGGING 0x100 /* development io message logging */ > #define PM8001_IOERR_LOGGING 0x200 /* development io err message logging */ > > -#define pm8001_printk(HBA, fmt, ...) \ > +#define pm8001_info(HBA, fmt, ...) \ > pr_info("%s:: %s %d:" fmt, \ > (HBA)->name, __func__, __LINE__, ##__VA_ARGS__) > > #define pm8001_dbg(HBA, level, fmt, ...) \ > do { \ > if (unlikely((HBA)->logging_level & PM8001_##level##_LOGGING)) \ > - pm8001_printk(HBA, fmt, ##__VA_ARGS__); \ > + pm8001_info(HBA, fmt, ##__VA_ARGS__); \ > } while (0) > > #define PM8001_USE_TASKLET > -- > 2.26.0 > ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] scsi: pm8001: Fix misindentation 2020-11-24 4:36 [PATCH 0/2] scsi: pm8001: Further neatening and whitespace Joe Perches 2020-11-24 4:36 ` [PATCH 1/2] scsi: pm8001: Convert pm8001_printk to pm8001_info Joe Perches @ 2020-11-24 4:36 ` Joe Perches 2020-11-24 6:23 ` Jinpu Wang 2020-12-01 4:33 ` [PATCH 0/2] scsi: pm8001: Further neatening and whitespace Martin K. Petersen 2 siblings, 1 reply; 6+ messages in thread From: Joe Perches @ 2020-11-24 4:36 UTC (permalink / raw) To: Jack Wang Cc: kernel test robot, James E.J. Bottomley, Martin K. Petersen, linux-scsi, linux-kernel kernel robot reported a misindentation of a goto. Fix it. At the same time, use a temporary for a repeated entry in the same block to reduce visual noise. Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Joe Perches <joe@perches.com> --- drivers/scsi/pm8001/pm8001_init.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c index 38907f45c845..17b29163c13d 100644 --- a/drivers/scsi/pm8001/pm8001_init.c +++ b/drivers/scsi/pm8001/pm8001_init.c @@ -386,17 +386,17 @@ static int pm8001_alloc(struct pm8001_hba_info *pm8001_ha, pm8001_ha->memoryMap.region[FORENSIC_MEM].element_size = 0x10000; pm8001_ha->memoryMap.region[FORENSIC_MEM].alignment = 0x10000; for (i = 0; i < pm8001_ha->max_memcnt; i++) { + struct mpi_mem *region = &pm8001_ha->memoryMap.region[i]; + if (pm8001_mem_alloc(pm8001_ha->pdev, - &pm8001_ha->memoryMap.region[i].virt_ptr, - &pm8001_ha->memoryMap.region[i].phys_addr, - &pm8001_ha->memoryMap.region[i].phys_addr_hi, - &pm8001_ha->memoryMap.region[i].phys_addr_lo, - pm8001_ha->memoryMap.region[i].total_len, - pm8001_ha->memoryMap.region[i].alignment) != 0) { - pm8001_dbg(pm8001_ha, FAIL, - "Mem%d alloc failed\n", - i); - goto err_out; + ®ion->virt_ptr, + ®ion->phys_addr, + ®ion->phys_addr_hi, + ®ion->phys_addr_lo, + region->total_len, + region->alignment) != 0) { + pm8001_dbg(pm8001_ha, FAIL, "Mem%d alloc failed\n", i); + goto err_out; } } -- 2.26.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] scsi: pm8001: Fix misindentation 2020-11-24 4:36 ` [PATCH 2/2] scsi: pm8001: Fix misindentation Joe Perches @ 2020-11-24 6:23 ` Jinpu Wang 0 siblings, 0 replies; 6+ messages in thread From: Jinpu Wang @ 2020-11-24 6:23 UTC (permalink / raw) To: Joe Perches Cc: kernel test robot, James E.J. Bottomley, Martin K. Petersen, Linux SCSI Mailinglist, linux-kernel On Tue, Nov 24, 2020 at 5:36 AM Joe Perches <joe@perches.com> wrote: > > kernel robot reported a misindentation of a goto. > > Fix it. > > At the same time, use a temporary for a repeated entry in the same block > to reduce visual noise. > > Reported-by: kernel test robot <lkp@intel.com> > Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com> > --- > drivers/scsi/pm8001/pm8001_init.c | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) > > diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c > index 38907f45c845..17b29163c13d 100644 > --- a/drivers/scsi/pm8001/pm8001_init.c > +++ b/drivers/scsi/pm8001/pm8001_init.c > @@ -386,17 +386,17 @@ static int pm8001_alloc(struct pm8001_hba_info *pm8001_ha, > pm8001_ha->memoryMap.region[FORENSIC_MEM].element_size = 0x10000; > pm8001_ha->memoryMap.region[FORENSIC_MEM].alignment = 0x10000; > for (i = 0; i < pm8001_ha->max_memcnt; i++) { > + struct mpi_mem *region = &pm8001_ha->memoryMap.region[i]; > + > if (pm8001_mem_alloc(pm8001_ha->pdev, > - &pm8001_ha->memoryMap.region[i].virt_ptr, > - &pm8001_ha->memoryMap.region[i].phys_addr, > - &pm8001_ha->memoryMap.region[i].phys_addr_hi, > - &pm8001_ha->memoryMap.region[i].phys_addr_lo, > - pm8001_ha->memoryMap.region[i].total_len, > - pm8001_ha->memoryMap.region[i].alignment) != 0) { > - pm8001_dbg(pm8001_ha, FAIL, > - "Mem%d alloc failed\n", > - i); > - goto err_out; > + ®ion->virt_ptr, > + ®ion->phys_addr, > + ®ion->phys_addr_hi, > + ®ion->phys_addr_lo, > + region->total_len, > + region->alignment) != 0) { > + pm8001_dbg(pm8001_ha, FAIL, "Mem%d alloc failed\n", i); > + goto err_out; > } > } > > -- > 2.26.0 > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] scsi: pm8001: Further neatening and whitespace 2020-11-24 4:36 [PATCH 0/2] scsi: pm8001: Further neatening and whitespace Joe Perches 2020-11-24 4:36 ` [PATCH 1/2] scsi: pm8001: Convert pm8001_printk to pm8001_info Joe Perches 2020-11-24 4:36 ` [PATCH 2/2] scsi: pm8001: Fix misindentation Joe Perches @ 2020-12-01 4:33 ` Martin K. Petersen 2 siblings, 0 replies; 6+ messages in thread From: Martin K. Petersen @ 2020-12-01 4:33 UTC (permalink / raw) To: Joe Perches Cc: linux-scsi, Jack Wang, James E.J. Bottomley, Martin K. Petersen, linux-kernel Joe, > Make the logging macro uses clearer and fix a whitespace defect. Applied to 5.11/scsi-staging, thanks! -- Martin K. Petersen Oracle Linux Engineering ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-12-01 4:34 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-11-24 4:36 [PATCH 0/2] scsi: pm8001: Further neatening and whitespace Joe Perches 2020-11-24 4:36 ` [PATCH 1/2] scsi: pm8001: Convert pm8001_printk to pm8001_info Joe Perches 2020-11-24 6:23 ` Jinpu Wang 2020-11-24 4:36 ` [PATCH 2/2] scsi: pm8001: Fix misindentation Joe Perches 2020-11-24 6:23 ` Jinpu Wang 2020-12-01 4:33 ` [PATCH 0/2] scsi: pm8001: Further neatening and whitespace Martin K. Petersen
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).