Commit graph

396 commits

Author SHA1 Message Date
Yang Guang
fffa718448 scsi: bfa: Replace snprintf() with sysfs_emit()
[ Upstream commit 2245ea91fd ]

coccinelle report:
./drivers/scsi/bfa/bfad_attr.c:908:8-16:
WARNING: use scnprintf or sprintf
./drivers/scsi/bfa/bfad_attr.c:860:8-16:
WARNING: use scnprintf or sprintf
./drivers/scsi/bfa/bfad_attr.c:888:8-16:
WARNING: use scnprintf or sprintf
./drivers/scsi/bfa/bfad_attr.c:853:8-16:
WARNING: use scnprintf or sprintf
./drivers/scsi/bfa/bfad_attr.c:808:8-16:
WARNING: use scnprintf or sprintf
./drivers/scsi/bfa/bfad_attr.c:728:8-16:
WARNING: use scnprintf or sprintf
./drivers/scsi/bfa/bfad_attr.c:822:8-16:
WARNING: use scnprintf or sprintf
./drivers/scsi/bfa/bfad_attr.c:927:9-17:
WARNING: use scnprintf or sprintf
./drivers/scsi/bfa/bfad_attr.c:900:8-16:
WARNING: use scnprintf or sprintf
./drivers/scsi/bfa/bfad_attr.c:874:8-16:
WARNING: use scnprintf or sprintf
./drivers/scsi/bfa/bfad_attr.c:714:8-16:
WARNING: use scnprintf or sprintf
./drivers/scsi/bfa/bfad_attr.c:839:8-16:
WARNING: use scnprintf or sprintf

Use sysfs_emit() instead of scnprintf() or sprintf().

Link: https://lore.kernel.org/r/def83ff75faec64ba592b867a8499b1367bae303.1643181468.git.yang.guang5@zte.com.cn
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Yang Guang <yang.guang5@zte.com.cn>
Signed-off-by: David Yang <davidcomponentone@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-13 19:27:11 +02:00
Christophe JAILLET
012d98dae4 scsi: bfa: Remove useless DMA-32 fallback configuration
As stated in [1], dma_set_mask() with a 64-bit mask never fails if
dev->dma_mask is non-NULL. So, if it fails, the 32-bit case will also fail
for the same reason.

Simplify code and remove some dead code accordingly.

[1]: https://lore.kernel.org/linux-kernel/YL3vSPK5DXTNvgdx@infradead.org/#t

Link: https://lore.kernel.org/r/5663cef9b54004fa56cca7ce65f51eadfc3ecddb.1642238127.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2022-01-24 23:30:29 -05:00
Bart Van Assche
69e623791e scsi: bfa: Declare 'bfad_im_vport_attrs' static
Fix the following kernel-doc warning:

'bfad_im_vport_attrs' is only used in one source file. Hence declare this
array static.

Link: https://lore.kernel.org/r/20211129194609.3466071-7-bvanassche@acm.org
Fixes: e73af234a1 ("scsi: bfa: Switch to attribute groups")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-11-29 23:02:14 -05:00
Bart Van Assche
e73af234a1 scsi: bfa: Switch to attribute groups
struct device supports attribute groups directly but does not support
struct device_attribute directly. Hence switch to attribute groups.

Link: https://lore.kernel.org/r/20211012233558.4066756-15-bvanassche@acm.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-10-16 21:45:54 -04:00
Bart Van Assche
af049dfd0b scsi: core: Remove the 'done' argument from SCSI queuecommand_lck functions
The DEF_SCSI_QCMD() macro passes the addresses of the SCSI host lock and
also that of the scsi_done function to the queuecommand_lck() function
implementations. Remove the 'scsi_done' argument since its address is
now a constant and instead call 'scsi_done' directly from inside the
queuecommand_lck() functions.

Link: https://lore.kernel.org/r/20211007204618.2196847-14-bvanassche@acm.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-10-16 21:32:16 -04:00
Bart Van Assche
4316b5b8b2 scsi: bfa: Call scsi_done() directly
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.

Link: https://lore.kernel.org/r/20211007202923.2174984-25-bvanassche@acm.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-10-16 21:28:45 -04:00
Jiapeng Chong
8f942f9d4b scsi: bfa: Fix inconsistent indenting
Eliminate the follow smatch warning:

drivers/scsi/bfa/bfa_svc.c:3176 bfa_fcport_send_enable() warn:
inconsistent indenting.

Link: https://lore.kernel.org/r/1621590368-72041-1-git-send-email-jiapeng.chong@linux.alibaba.com
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-05-21 17:01:18 -04:00
zuoqilin
1ecc820db0 scsi: bfa: Fix typo
Change 'chnage' to 'change'.

Link: https://lore.kernel.org/r/20210521092153.379-1-zuoqilin1@163.com
Signed-off-by: zuoqilin <zuoqilin@yulong.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-05-21 17:00:21 -04:00
Christophe JAILLET
4803bd066c scsi: bfa: Remove some unused variables
'lp' is unused, it is just declared and zeroed

Remove it.

Link: https://lore.kernel.org/r/d10ccee35e35bf33d651f2e0163034d7c451520b.1618944442.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-05-15 14:46:43 -04:00
Wan Jiabing
c3b0d08776 scsi: bfa: Remove unnecessary struct declarations
struct bfa_fcs_s is declared twice. First is declared at line 50, remove
the duplicate.

struct bfa_fcs_fabric_s is defined at line 175, remove unnecessary
declaration.

Link: https://lore.kernel.org/r/20210401063535.992487-1-wanjiabing@vivo.com
Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-04-05 23:44:01 -04:00
Bhaskar Chowdhury
9991ca001b scsi: bfa: Fix a typo in two places
s/defintions/definitions/  ....two different places.

Link: https://lore.kernel.org/r/20210322205821.1449844-1-unixbhaskar@gmail.com
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-03-24 23:06:27 -04:00
Jiapeng Chong
1630e752fb scsi: bfa: Fix warning comparing pointer to 0
Fix the following coccicheck warning:

./drivers/scsi/bfa/bfad_bsg.c:3412:29-30: WARNING comparing pointer to
0.

Link: https://lore.kernel.org/r/1615880930-120780-1-git-send-email-jiapeng.chong@linux.alibaba.com
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-03-24 22:35:39 -04:00
Lee Jones
a7a11b6cfe scsi: bfa: Move a large struct from the stack onto the heap
Fixes the following W=1 kernel build warning(s):

 drivers/scsi/bfa/bfa_fcs_lport.c: In function ‘bfa_fcs_lport_fdmi_build_rhba_pyld’:
 drivers/scsi/bfa/bfa_fcs_lport.c:2152:1: warning: the frame size of 1200 bytes is larger than 1024 bytes [-Wframe-larger-than=]

Link: https://lore.kernel.org/r/20210312094738.2207817-15-lee.jones@linaro.org
Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Cc: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-03-15 22:28:58 -04:00
Hannes Reinecke
eb74b9322b scsi: bfa: Drop driver-defined SCSI status codes
Drop the driver-defined SCSI status codes and use the generic ones instead.

Link: https://lore.kernel.org/r/20210113090500.129644-10-hare@suse.de
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-01-22 21:14:08 -05:00
Gustavo A. R. Silva
4c7bd259d6 scsi: bfa: Fix fall-through warnings for Clang
In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple
warnings by explicitly adding a couple break statements and replacing /*
fall through */ comments with the new pseudo-keyword macro fallthrough;
instead of just letting the code fall through to the next case.

Notice that Clang doesn't recognize /* fall through */ comments as implicit
fall-through markings.

Link: https://github.com/KSPP/linux/issues/115
Link: https://lore.kernel.org/r/2ae1cafd858238b85fc5e7fe5cc183843e21ec9f.1605896059.git.gustavoars@kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-12-02 12:59:46 -05:00
Linus Torvalds
af995383eb SCSI misc on 20201023
The set of core changes here is Christoph's submission path cleanups.
 These introduced a couple of regressions when first proposed so they
 got held over from the initial merge window pull request to give more
 testing time, which they've now had and Syzbot has confirmed the
 regression it detected is fixed.  The other main changes are two
 driver updates (arcmsr, pm80xx) and assorted minor clean ups.
 
 Signed-off-by: James E.J. Bottomley <jejb@linux.ibm.com>
 -----BEGIN PGP SIGNATURE-----
 
 iJwEABMIAEQWIQTnYEDbdso9F2cI+arnQslM7pishQUCX5MkQCYcamFtZXMuYm90
 dG9tbGV5QGhhbnNlbnBhcnRuZXJzaGlwLmNvbQAKCRDnQslM7pishRkuAPsEAR/W
 NS7J7j66rF2x15xGR2CNB4R6FEBSd/hdOPp7cQEA4rtLKKI53W4oydKsfTux6N6o
 MLZJIHM5nTitk++AVQs=
 =QgpC
 -----END PGP SIGNATURE-----

Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull more SCSI updates from James Bottomley:
 "The set of core changes here is Christoph's submission path cleanups.

  These introduced a couple of regressions when first proposed so they
  got held over from the initial merge window pull request to give more
  testing time, which they've now had and Syzbot has confirmed the
  regression it detected is fixed.

  The other main changes are two driver updates (arcmsr, pm80xx) and
  assorted minor clean ups"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (38 commits)
  scsi: qla2xxx: Fix return of uninitialized value in rval
  scsi: core: Set sc_data_direction to DMA_NONE for no-transfer commands
  scsi: sr: Initialize ->cmd_len
  scsi: arcmsr: Update driver version to v1.50.00.02-20200819
  scsi: arcmsr: Add support for ARC-1886 series RAID controllers
  scsi: arcmsr: Fix device hot-plug monitoring timer stop
  scsi: arcmsr: Remove unnecessary syntax
  scsi: pm80xx: Driver version update
  scsi: pm80xx: Increase the number of outstanding I/O supported to 1024
  scsi: pm80xx: Remove DMA memory allocation for ccb and device structures
  scsi: pm80xx: Increase number of supported queues
  scsi: sym53c8xx_2: Fix sizeof() mismatch
  scsi: isci: Fix a typo in a comment
  scsi: qla4xxx: Fix inconsistent format argument type
  scsi: myrb: Fix inconsistent format argument types
  scsi: myrb: Remove redundant assignment to variable timeout
  scsi: bfa: Fix error return in bfad_pci_init()
  scsi: fcoe: Simplify the return expression of fcoe_sysfs_setup()
  scsi: snic: Simplify the return expression of svnic_cq_alloc()
  scsi: fnic: Simplify the return expression of vnic_wq_copy_alloc()
  ...
2020-10-23 16:19:02 -07:00
Jing Xiangfeng
f0f6c3a4fc scsi: bfa: Fix error return in bfad_pci_init()
Fix to return error code -ENODEV from the error handling case instead of 0.

Link: https://lore.kernel.org/r/20200925062423.161504-1-jingxiangfeng@huawei.com
Fixes: 11ea382414 ("scsi: bfa: fix calls to dma_set_mask_and_coherent()")
Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-10-07 23:50:04 -04:00
Gustavo A. R. Silva
df561f6688 treewide: Use fallthrough pseudo-keyword
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
2020-08-23 17:36:59 -05:00
Lee Jones
64332c13d0 scsi: bfa: Ensure a blank line precedes next function/header
Fixes the following checkpatch warning:

 CHECK: Please use a blank line after function/struct/union/enum declarations
 #129: FILE: drivers/scsi/bfa/bfa_ioc.c:6913:
  }
 +/*

Link: https://lore.kernel.org/r/20200723122446.1329773-39-lee.jones@linaro.org
Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Cc: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-07-24 22:33:06 -04:00
Lee Jones
20e73cb1d0 scsi: bfa: Demote seemingly unintentional kerneldoc header
This is the only use of kerneldoc in the source file and no descriptions
are provided.

Also demote standard comment.

Fixes the following W=1 kernel build warning(s):

 drivers/scsi/bfa/bfa_svc.c:3847: warning: Function parameter or member 'bfa' not described in 'bfa_fcport_get_cfg_topology'

Link: https://lore.kernel.org/r/20200723122446.1329773-36-lee.jones@linaro.org
Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Cc: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-07-24 22:33:04 -04:00
Lee Jones
310531ffc3 scsi: bfa: Demote seemingly unintentional kerneldoc header
This is the only use of kerneldoc in the source file and no
descriptions are provided.

Fixes the following W=1 kernel build warning(s):

 drivers/scsi/bfa/bfa_core.c:1245: warning: Function parameter or member 'bfa' not described in 'bfa_iocfc_qreg'
 drivers/scsi/bfa/bfa_core.c:1245: warning: Function parameter or member 'qreg' not described in 'bfa_iocfc_qreg'

Link: https://lore.kernel.org/r/20200723122446.1329773-35-lee.jones@linaro.org
Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Cc: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-07-24 22:33:04 -04:00
Lee Jones
b1a187f261 scsi: bfa: Demote non-kerneldoc headers down to standard comment blocks
This is probably historical (Doxygen?).

Fixes the following W=1 kernel build warning(s):

 drivers/scsi/bfa/bfa_ioc.c:6646: warning: Cannot understand  * @brief hardware error definition
 drivers/scsi/bfa/bfa_ioc.c:6661: warning: Cannot understand  * @brief flash command register data structure
 drivers/scsi/bfa/bfa_ioc.c:6685: warning: Cannot understand  * @brief flash device status register data structure
 drivers/scsi/bfa/bfa_ioc.c:6711: warning: Cannot understand  * @brief flash address register data structure
 drivers/scsi/bfa/bfa_ioc.c:6732: warning: Function parameter or member 'pci_bar' not described in 'bfa_flash_set_cmd'
 drivers/scsi/bfa/bfa_ioc.c:6732: warning: Function parameter or member 'wr_cnt' not described in 'bfa_flash_set_cmd'
 drivers/scsi/bfa/bfa_ioc.c:6732: warning: Function parameter or member 'rd_cnt' not described in 'bfa_flash_set_cmd'
 drivers/scsi/bfa/bfa_ioc.c:6732: warning: Function parameter or member 'ad_cnt' not described in 'bfa_flash_set_cmd'
 drivers/scsi/bfa/bfa_ioc.c:6732: warning: Function parameter or member 'op' not described in 'bfa_flash_set_cmd'
 drivers/scsi/bfa/bfa_ioc.c:6768: warning: Cannot understand  * @brief
 drivers/scsi/bfa/bfa_ioc.c:6807: warning: Cannot understand  * @brief
 drivers/scsi/bfa/bfa_ioc.c:6852: warning: Cannot understand  * @brief
 drivers/scsi/bfa/bfa_ioc.c:6898: warning: Cannot understand  * @brief
 drivers/scsi/bfa/bfa_ioc.c:6914: warning: Cannot understand  * @brief
 drivers/scsi/bfa/bfa_ioc.c:6940: warning: Cannot understand  * @brief

Link: https://lore.kernel.org/r/20200723122446.1329773-34-lee.jones@linaro.org
Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Cc: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-07-24 22:33:00 -04:00
Lee Jones
e95fcb7792 scsi: bfa: Remove unused variable 'adisc'
Fixes the following W=1 kernel build warning(s):

 drivers/scsi/bfa/bfa_fcs_rport.c: In function ‘bfa_fcs_rport_process_adisc’:
 drivers/scsi/bfa/bfa_fcs_rport.c:2243:21: warning: variable ‘adisc’ set but not used [-Wunused-but-set-variable]

Link: https://lore.kernel.org/r/20200723122446.1329773-28-lee.jones@linaro.org
Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Cc: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-07-24 22:32:08 -04:00
Lee Jones
eaefa33014 scsi: bfa: Demote non-compliant kerneldoc headers to standard comments
Fixes the following W=1 kernel build warning(s):

 drivers/scsi/bfa/bfa_ioc_ct.c:504: warning: Function parameter or member 'ioc' not described in 'bfa_ioc_set_ctx_hwif'
 drivers/scsi/bfa/bfa_ioc_ct.c:504: warning: Function parameter or member 'hwif' not described in 'bfa_ioc_set_ctx_hwif'
 drivers/scsi/bfa/bfa_ioc_ct.c:525: warning: Function parameter or member 'ioc' not described in 'bfa_ioc_set_ct_hwif'
 drivers/scsi/bfa/bfa_ioc_ct.c:540: warning: Function parameter or member 'ioc' not described in 'bfa_ioc_set_ct2_hwif'

Link: https://lore.kernel.org/r/20200723122446.1329773-26-lee.jones@linaro.org
Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Cc: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-07-24 22:32:07 -04:00
Lee Jones
00025fc7e6 scsi: bfa: Staticify non-external functions
Fixes the following W=1 kernel build warning(s):

 drivers/scsi/bfa/bfa_ioc.c:5023:1: warning: no previous prototype for ‘bfa_diag_intr’ [-Wmissing-prototypes]
 5023 | bfa_diag_intr(void *diagarg, struct bfi_mbmsg_s *msg)
 | ^~~~~~~~~~~~~
 drivers/scsi/bfa/bfa_ioc.c:6966:1: warning: no previous prototype for ‘bfa_flash_sem_get’ [-Wmissing-prototypes]
 6966 | bfa_flash_sem_get(void __iomem *bar)
 | ^~~~~~~~~~~~~~~~~
 drivers/scsi/bfa/bfa_ioc.c:6979:1: warning: no previous prototype for ‘bfa_flash_sem_put’ [-Wmissing-prototypes]
 6979 | bfa_flash_sem_put(void __iomem *bar)
 | ^~~~~~~~~~~~~~~~~

Link: https://lore.kernel.org/r/20200723122446.1329773-24-lee.jones@linaro.org
Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Cc: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-07-24 22:32:06 -04:00
Lee Jones
c7ccd038b7 scsi: bfa: Remove a few unused variables 'pgoff' and 't'
Fixes the following W=1 kernel build warning(s):

 drivers/scsi/bfa/bfa_ioc.c: In function ‘bfa_iocpf_sm_fwcheck_entry’:
 drivers/scsi/bfa/bfa_ioc.c:704:27: warning: variable ‘pgoff’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/bfa/bfa_ioc.c: In function ‘bfa_ioc_fwver_get’:
 drivers/scsi/bfa/bfa_ioc.c:1443:13: warning: variable ‘pgoff’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/bfa/bfa_ioc.c: In function ‘bfa_ioc_fwsig_invalidate’:
 drivers/scsi/bfa/bfa_ioc.c:1665:13: warning: variable ‘pgoff’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/bfa/bfa_ioc.c: In function ‘bfa_ioc_download_fw’:
 drivers/scsi/bfa/bfa_ioc.c:1866:13: warning: variable ‘pgoff’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/bfa/bfa_ioc.c: In function ‘bfa_diag_memtest_done’:
 drivers/scsi/bfa/bfa_ioc.c:4766:13: warning: variable ‘pgoff’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/bfa/bfa_ioc.c: In function ‘bfa_flash_fifo_flush’:
 drivers/scsi/bfa/bfa_ioc.c:6787:6: warning: variable ‘t’ set but not used [-Wunused-but-set-variable]

Link: https://lore.kernel.org/r/20200723122446.1329773-21-lee.jones@linaro.org
Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Cc: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-07-24 22:32:04 -04:00
Lee Jones
7106de1d8a scsi: bfa: Demote seemingly unintentional kerneldoc header
This is the only use of kerneldoc in the source file and no descriptions
are provided.

Fixes the following W=1 kernel build warning(s):

 drivers/scsi/bfa/bfa_fcpim.c:3829: warning: Function parameter or member 'bfa' not described in 'bfa_fcpim_get_throttle_cfg'
 drivers/scsi/bfa/bfa_fcpim.c:3829: warning: Function parameter or member 'drv_cfg_param' not described in 'bfa_fcpim_get_throttle_cfg'

Link: https://lore.kernel.org/r/20200723122446.1329773-11-lee.jones@linaro.org
Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Cc: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-07-24 22:31:58 -04:00
Lee Jones
70b4de0bb9 scsi: bfa: Remove set but unused variable 'rp'
This change subsequently makes 'rp_fcs' unused also.  Remove that too.

Fixes the following W=1 kernel build warning(s):

 drivers/scsi/bfa/bfa_fcpim.c: In function ‘bfa_fcpim_lunmask_delete’:
 drivers/scsi/bfa/bfa_fcpim.c:2338:22: warning: variable ‘rp’ set but not used [-Wunused-but-set-variable]
 2338 | struct bfa_rport_s *rp = NULL;
 | ^~

Link: https://lore.kernel.org/r/20200723122446.1329773-10-lee.jones@linaro.org
Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Cc: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-07-24 22:31:57 -04:00
Lee Jones
0aaaa04a7a scsi: bfa: Staticify local functions
These calls are not invoked externally.

Fixes the following W=1 kernel build warning(s):

 drivers/scsi/bfa/bfa_port.c:760:1: warning: no previous prototype for ‘bfa_cee_isr’ [-Wmissing-prototypes]
 760 | bfa_cee_isr(void *cbarg, struct bfi_mbmsg_s *m)
 | ^~~~~~~~~~~
 drivers/scsi/bfa/bfa_port.c:796:1: warning: no previous prototype for ‘bfa_cee_notify’ [-Wmissing-prototypes]
 796 | bfa_cee_notify(void *arg, enum bfa_ioc_event_e event)
 | ^~~~~~~~~~~~~~

Link: https://lore.kernel.org/r/20200723122446.1329773-8-lee.jones@linaro.org
Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Cc: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-07-24 22:31:56 -04:00
Lee Jones
3bbd8ef9f7 scsi: bfa: Staticify all local functions
Fixes the following W=1 kernel build warning(s):

 drivers/scsi/bfa/bfad_bsg.c:19:1: warning: no previous prototype for ‘bfad_iocmd_ioc_enable’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:42:1: warning: no previous prototype for ‘bfad_iocmd_ioc_disable’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:150:1: warning: no previous prototype for ‘bfad_iocmd_ioc_get_fwstats’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:180:1: warning: no previous prototype for ‘bfad_iocmd_ioc_reset_stats’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:198:1: warning: no previous prototype for ‘bfad_iocmd_ioc_set_name’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:212:1: warning: no previous prototype for ‘bfad_iocmd_iocfc_get_attr’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:223:1: warning: no previous prototype for ‘bfad_iocmd_ioc_fw_sig_inv’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:235:1: warning: no previous prototype for ‘bfad_iocmd_iocfc_set_intr’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:248:1: warning: no previous prototype for ‘bfad_iocmd_port_enable’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:269:1: warning: no previous prototype for ‘bfad_iocmd_port_disable’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:319:1: warning: no previous prototype for ‘bfad_iocmd_port_get_stats’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:353:1: warning: no previous prototype for ‘bfad_iocmd_port_reset_stats’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:374:1: warning: no previous prototype for ‘bfad_iocmd_set_port_cfg’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:394:1: warning: no previous prototype for ‘bfad_iocmd_port_cfg_maxfrsize’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:408:1: warning: no previous prototype for ‘bfad_iocmd_port_cfg_bbcr’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:431:1: warning: no previous prototype for ‘bfad_iocmd_port_get_bbcr_attr’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:469:1: warning: no previous prototype for ‘bfad_iocmd_lport_get_stats’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:493:1: warning: no previous prototype for ‘bfad_iocmd_lport_reset_stats’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:527:1: warning: no previous prototype for ‘bfad_iocmd_lport_get_iostats’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:552:1: warning: no previous prototype for ‘bfad_iocmd_lport_get_rports’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:594:1: warning: no previous prototype for ‘bfad_iocmd_rport_get_attr’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:680:1: warning: no previous prototype for ‘bfad_iocmd_rport_get_stats’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:721:1: warning: no previous prototype for ‘bfad_iocmd_rport_clr_stats’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:757:1: warning: no previous prototype for ‘bfad_iocmd_rport_set_speed’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:793:1: warning: no previous prototype for ‘bfad_iocmd_vport_get_attr’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:816:1: warning: no previous prototype for ‘bfad_iocmd_vport_get_stats’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:844:1: warning: no previous prototype for ‘bfad_iocmd_vport_clr_stats’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:911:1: warning: no previous prototype for ‘bfad_iocmd_qos_set_bw’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:924:1: warning: no previous prototype for ‘bfad_iocmd_ratelim’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:953:1: warning: no previous prototype for ‘bfad_iocmd_ratelim_speed’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:982:1: warning: no previous prototype for ‘bfad_iocmd_cfg_fcpim’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:995:1: warning: no previous prototype for ‘bfad_iocmd_fcpim_get_modstats’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1017:1: warning: no previous prototype for ‘bfad_iocmd_fcpim_clr_modstats’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1039:1: warning: no previous prototype for ‘bfad_iocmd_fcpim_get_del_itn_stats’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1164:1: warning: no previous prototype for ‘bfad_iocmd_fcport_enable’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1177:1: warning: no previous prototype for ‘bfad_iocmd_fcport_disable’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1190:1: warning: no previous prototype for ‘bfad_iocmd_ioc_get_pcifn_cfg’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1212:1: warning: no previous prototype for ‘bfad_iocmd_pcifn_create’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1235:1: warning: no previous prototype for ‘bfad_iocmd_pcifn_delete’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1257:1: warning: no previous prototype for ‘bfad_iocmd_pcifn_bw’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1281:1: warning: no previous prototype for ‘bfad_iocmd_adapter_cfg_mode’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1304:1: warning: no previous prototype for ‘bfad_iocmd_port_cfg_mode’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1328:1: warning: no previous prototype for ‘bfad_iocmd_ablk_optrom’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1354:1: warning: no previous prototype for ‘bfad_iocmd_faa_query’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1377:1: warning: no previous prototype for ‘bfad_iocmd_cee_attr’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1413:1: warning: no previous prototype for ‘bfad_iocmd_cee_get_stats’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1450:1: warning: no previous prototype for ‘bfad_iocmd_cee_reset_stats’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1464:1: warning: no previous prototype for ‘bfad_iocmd_sfp_media’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1486:1: warning: no previous prototype for ‘bfad_iocmd_sfp_speed’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1507:1: warning: no previous prototype for ‘bfad_iocmd_flash_get_attr’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1528:1: warning: no previous prototype for ‘bfad_iocmd_flash_erase_part’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1548:1: warning: no previous prototype for ‘bfad_iocmd_flash_update_part’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1580:1: warning: no previous prototype for ‘bfad_iocmd_flash_read_part’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1612:1: warning: no previous prototype for ‘bfad_iocmd_diag_temp’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1634:1: warning: no previous prototype for ‘bfad_iocmd_diag_memtest’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1657:1: warning: no previous prototype for ‘bfad_iocmd_diag_loopback’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1680:1: warning: no previous prototype for ‘bfad_iocmd_diag_fwping’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1704:1: warning: no previous prototype for ‘bfad_iocmd_diag_queuetest’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1725:1: warning: no previous prototype for ‘bfad_iocmd_diag_sfp’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1748:1: warning: no previous prototype for ‘bfad_iocmd_diag_led’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1761:1: warning: no previous prototype for ‘bfad_iocmd_diag_beacon_lport’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1776:1: warning: no previous prototype for ‘bfad_iocmd_diag_lb_stat’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1791:1: warning: no previous prototype for ‘bfad_iocmd_diag_dport_enable’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1813:1: warning: no previous prototype for ‘bfad_iocmd_diag_dport_disable’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1833:1: warning: no previous prototype for ‘bfad_iocmd_diag_dport_start’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1858:1: warning: no previous prototype for ‘bfad_iocmd_diag_dport_show’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1873:1: warning: no previous prototype for ‘bfad_iocmd_phy_get_attr’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1894:1: warning: no previous prototype for ‘bfad_iocmd_phy_get_stats’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1915:1: warning: no previous prototype for ‘bfad_iocmd_phy_read’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1947:1: warning: no previous prototype for ‘bfad_iocmd_vhba_query’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1966:1: warning: no previous prototype for ‘bfad_iocmd_phy_update’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:1996:1: warning: no previous prototype for ‘bfad_iocmd_porglog_get’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2016:1: warning: no previous prototype for ‘bfad_iocmd_debug_fw_core’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2050:1: warning: no previous prototype for ‘bfad_iocmd_debug_ctl’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2071:1: warning: no previous prototype for ‘bfad_iocmd_porglog_ctl’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2085:1: warning: no previous prototype for ‘bfad_iocmd_fcpim_cfg_profile’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2129:1: warning: no previous prototype for ‘bfad_iocmd_fcport_get_stats’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2154:1: warning: no previous prototype for ‘bfad_iocmd_fcport_reset_stats’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2178:1: warning: no previous prototype for ‘bfad_iocmd_boot_cfg’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2200:1: warning: no previous prototype for ‘bfad_iocmd_boot_query’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2222:1: warning: no previous prototype for ‘bfad_iocmd_preboot_query’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2241:1: warning: no previous prototype for ‘bfad_iocmd_ethboot_cfg’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2264:1: warning: no previous prototype for ‘bfad_iocmd_ethboot_query’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2287:1: warning: no previous prototype for ‘bfad_iocmd_cfg_trunk’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2327:1: warning: no previous prototype for ‘bfad_iocmd_trunk_get_attr’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2350:1: warning: no previous prototype for ‘bfad_iocmd_qos’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2378:1: warning: no previous prototype for ‘bfad_iocmd_qos_get_attr’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2404:1: warning: no previous prototype for ‘bfad_iocmd_qos_get_vc_attr’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2436:1: warning: no previous prototype for ‘bfad_iocmd_qos_get_stats’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2468:1: warning: no previous prototype for ‘bfad_iocmd_qos_reset_stats’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2499:1: warning: no previous prototype for ‘bfad_iocmd_vf_get_stats’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2522:1: warning: no previous prototype for ‘bfad_iocmd_vf_clr_stats’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2559:1: warning: no previous prototype for ‘bfad_iocmd_lunmask’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2582:1: warning: no previous prototype for ‘bfad_iocmd_fcpim_lunmask_query’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2596:1: warning: no previous prototype for ‘bfad_iocmd_fcpim_cfg_lunmask’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2615:1: warning: no previous prototype for ‘bfad_iocmd_fcpim_throttle_query’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2630:1: warning: no previous prototype for ‘bfad_iocmd_fcpim_throttle_set’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2645:1: warning: no previous prototype for ‘bfad_iocmd_tfru_read’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2667:1: warning: no previous prototype for ‘bfad_iocmd_tfru_write’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2689:1: warning: no previous prototype for ‘bfad_iocmd_fruvpd_read’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2711:1: warning: no previous prototype for ‘bfad_iocmd_fruvpd_update’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:2733:1: warning: no previous prototype for ‘bfad_iocmd_fruvpd_get_max_size’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:3181:1: warning: no previous prototype for ‘bfad_fcxp_get_req_sgaddr_cb’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:3193:1: warning: no previous prototype for ‘bfad_fcxp_get_req_sglen_cb’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:3203:1: warning: no previous prototype for ‘bfad_fcxp_get_rsp_sgaddr_cb’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:3215:1: warning: no previous prototype for ‘bfad_fcxp_get_rsp_sglen_cb’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:3225:1: warning: no previous prototype for ‘bfad_send_fcpt_cb’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:3240:1: warning: no previous prototype for ‘bfad_fcxp_map_sg’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:3284:1: warning: no previous prototype for ‘bfad_fcxp_free_mem’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:3302:1: warning: no previous prototype for ‘bfad_fcxp_bsg_send’ [-Wmissing-prototypes]
 drivers/scsi/bfa/bfad_bsg.c:3342:1: warning: no previous prototype for ‘bfad_im_bsg_els_ct_request’ [-Wmissing-prototypes]

Link: https://lore.kernel.org/r/20200721164148.2617584-36-lee.jones@linaro.org
Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Cc: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-07-24 22:10:02 -04:00
Jason Yan
102026483d scsi: bfa: Make bfad_iocmd_ioc_get_stats() static
Fix the following sparse warning:

drivers/scsi/bfa/bfad_bsg.c:140:1: warning: symbol
'bfad_iocmd_ioc_get_stats' was not declared. Should it be static?

Link: https://lore.kernel.org/r/20200505073807.40332-1-yanaijie@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-05-11 22:22:07 -04:00
Jason Yan
f71ded01cc scsi: bfa: Remove unneeded semicolon in bfa_fcs_rport.c
Fix the following coccicheck warning:

drivers/scsi/bfa/bfa_fcs_rport.c:2452:2-3: Unneeded semicolon
drivers/scsi/bfa/bfa_fcs_rport.c:1578:3-4: Unneeded semicolon

Link: https://lore.kernel.org/r/20200421033957.27783-1-yanaijie@huawei.com
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-04-24 18:21:15 -04:00
YueHaibing
0745c834f7 scsi: bfa: Remove set but not used variable 'fchs'
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/scsi/bfa/bfa_svc.c: In function 'uf_recv':
drivers/scsi/bfa/bfa_svc.c:5520:17: warning:
 variable 'fchs' set but not used [-Wunused-but-set-variable]
  struct fchs_s *fchs;
                 ^

Link: https://lore.kernel.org/r/20200418071057.96699-1-yuehaibing@huawei.com
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-04-24 18:21:15 -04:00
Jason Yan
f166021c0f scsi: bfa: Remove unneeded semicolon in bfa_fcs_lport_ns_sm_online()
Fix the following coccicheck warning:

drivers/scsi/bfa/bfa_fcs_lport.c:4361:3-4: Unneeded semicolon

Link: https://lore.kernel.org/r/20200418070553.11262-1-yanaijie@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-04-24 18:21:15 -04:00
Jason Yan
4d5956fb51 scsi: bfa: bfad.c: make max_rport_logins static
Fix the following sparse warning:

drivers/scsi/bfa/bfad.c:53:17: warning: symbol 'max_rport_logins' was
not declared. Should it be static?

Link: https://lore.kernel.org/r/20200407032202.36789-8-yanaijie@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-04-14 21:34:53 -04:00
Jason Yan
938b18462e scsi: bfa: bfad_attr.c: make two funcitons static
Fix the following sparse warning:

drivers/scsi/bfa/bfad_attr.c:441:1: warning: symbol
'bfad_im_issue_fc_host_lip' was not declared. Should it be static?
drivers/scsi/bfa/bfad_attr.c:566:1: warning: symbol
'bfad_im_vport_set_symbolic_name' was not declared. Should it be static?

Link: https://lore.kernel.org/r/20200407032202.36789-7-yanaijie@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-04-14 21:34:52 -04:00
Jason Yan
eae9b1788a scsi: bfa: bfa_ioc_ct.c: make two funcitons static
Fix the following sparse warning:

drivers/scsi/bfa/bfa_ioc_ct.c:368:1: warning: symbol
'bfa_ioc_ct2_lpu_read_stat' was not declared. Should it be static?
drivers/scsi/bfa/bfa_ioc_ct.c:748:1: warning: symbol
'bfa_ioc_ct2_mac_reset' was not declared. Should it be static?

Link: https://lore.kernel.org/r/20200407032202.36789-6-yanaijie@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-04-14 21:34:51 -04:00
Jason Yan
901ad27c69 scsi: bfa: bfa_fcs_lport.c: make bfa_fcport_get_loop_attr() static
Fix the following sparse warning:

drivers/scsi/bfa/bfa_fcs_lport.c:1287:1: warning: symbol
'bfa_fcport_get_loop_attr' was not declared. Should it be static?

Link: https://lore.kernel.org/r/20200407032202.36789-5-yanaijie@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-04-14 21:34:51 -04:00
Jason Yan
84a2fd236d scsi: bfa: bfa_fcpim.c: make two functions static
Fix the following sparse warning:

drivers/scsi/bfa/bfa_fcpim.c:440:1: warning: symbol
'bfa_ioim_profile_comp' was not declared. Should it be static?
drivers/scsi/bfa/bfa_fcpim.c:457:1: warning: symbol
'bfa_ioim_profile_start' was not declared. Should it be static?

Link: https://lore.kernel.org/r/20200407032202.36789-4-yanaijie@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-04-14 21:34:50 -04:00
Jason Yan
b9ddee1ee1 scsi: bfa: bfa_core.c: make bfa_isr_rspq() static
Fix the following sparse warning:

drivers/scsi/bfa/bfa_core.c:712:1: warning: symbol 'bfa_isr_rspq' was
not declared. Should it be static?

Link: https://lore.kernel.org/r/20200407032202.36789-3-yanaijie@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-04-14 21:34:50 -04:00
Jason Yan
037773f3b6 scsi: bfa: bfa_svc.c: make two functions static
Fix the following sparse warning:

drivers/scsi/bfa/bfa_svc.c:4288:1: warning: symbol
'bfa_fcport_ddportenable' was not declared. Should it be static?
drivers/scsi/bfa/bfa_svc.c:4297:1: warning: symbol
'bfa_fcport_ddportdisable' was not declared. Should it be static?

Link: https://lore.kernel.org/r/20200407032202.36789-2-yanaijie@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-04-14 21:34:49 -04:00
YueHaibing
7cd4cb94cf scsi: bfa: Make restart_bfa static
Fix sparse warning:

drivers/scsi/bfa/bfad.c:1491:1: warning:
 symbol 'restart_bfa' was not declared. Should it be static?

Link: https://lore.kernel.org/r/20190930094327.46836-1-yuehaibing@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2019-09-30 23:59:53 -04:00
Navid Emamdoost
0e62395da2 scsi: bfa: release allocated memory in case of error
In bfad_im_get_stats if bfa_port_get_stats fails, allocated memory needs to
be released.

Link: https://lore.kernel.org/r/20190910234417.22151-1-navid.emamdoost@gmail.com
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2019-09-30 22:54:15 -04:00
Colin Ian King
5f6b4e1e09 scsi: bfa: remove redundant assignment to variable error
Variable error is being initialized with a value that is never read and
error is being re-assigned a little later on. The assignment is redundant
and hence can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2019-08-29 17:41:24 -04:00
Thomas Gleixner
52fa7bf9ea treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 292
Based on 1 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license gpl version 2
  as published by the free software foundation this program is
  distributed in the hope that it will be useful but without any
  warranty without even the implied warranty of merchantability or
  fitness for a particular purpose see the gnu general public license
  for more details

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 66 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190529141901.606369721@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-05 17:36:38 +02:00
Linus Torvalds
b4b52b881c Wimplicit-fallthrough patches for 5.2-rc1
Hi Linus,
 
 This is my very first pull-request.  I've been working full-time as
 a kernel developer for more than two years now. During this time I've
 been fixing bugs reported by Coverity all over the tree and, as part
 of my work, I'm also contributing to the KSPP. My work in the kernel
 community has been supervised by Greg KH and Kees Cook.
 
 OK. So, after the quick introduction above, please, pull the following
 patches that mark switch cases where we are expecting to fall through.
 These patches are part of the ongoing efforts to enable -Wimplicit-fallthrough.
 They have been ignored for a long time (most of them more than 3 months,
 even after pinging multiple times), which is the reason why I've created
 this tree. Most of them have been baking in linux-next for a whole development
 cycle. And with Stephen Rothwell's help, we've had linux-next nag-emails
 going out for newly introduced code that triggers -Wimplicit-fallthrough
 to avoid gaining more of these cases while we work to remove the ones
 that are already present.
 
 I'm happy to let you know that we are getting close to completing this
 work.  Currently, there are only 32 of 2311 of these cases left to be
 addressed in linux-next.  I'm auditing every case; I take a look into
 the code and analyze it in order to determine if I'm dealing with an
 actual bug or a false positive, as explained here:
 
 https://lore.kernel.org/lkml/c2fad584-1705-a5f2-d63c-824e9b96cf50@embeddedor.com/
 
 While working on this, I've found and fixed the following missing
 break/return bugs, some of them introduced more than 5 years ago:
 
 84242b82d8
 7850b51b6c
 5e420fe635
 09186e5034
 b5be853181
 7264235ee7
 cc5034a5d2
 479826cc86
 5340f23df8
 df997abeeb
 2f10d82373
 307b00c5e6
 5d25ff7a54
 a7ed5b3e7d
 c24bfa8f21
 ad0eaee619
 9ba8376ce1
 dc586a60a1
 a8e9b186f1
 4e57562b48
 60747828ea
 c5b974bee9
 cc44ba9116
 2c930e3d0a
 
 Once this work is finish, we'll be able to universally enable
 "-Wimplicit-fallthrough" to avoid any of these kinds of bugs from
 entering the kernel again.
 
 Thanks
 
 Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEkmRahXBSurMIg1YvRwW0y0cG2zEFAlzQR2IACgkQRwW0y0cG
 2zEJbQ//X930OcBtT/9DRW4XL1Jeq0Mjssz/GLX2Vpup5CwwcTROG65no80Zezf/
 yQRWnUjGX0OBv/fmUK32/nTxI/7k7NkmIXJHe0HiEF069GEENB7FT6tfDzIPjU8M
 qQkB8NsSUWJs3IH6BVynb/9MGE1VpGBDbYk7CBZRtRJT1RMM+3kQPucgiZMgUBPo
 Yd9zKwn4i/8tcOCli++EUdQ29ukMoY2R3qpK4LftdX9sXLKZBWNwQbiCwSkjnvJK
 I6FDiA7RaWH2wWGlL7BpN5RrvAXp3z8QN/JZnivIGt4ijtAyxFUL/9KOEgQpBQN2
 6TBRhfTQFM73NCyzLgGLNzvd8awem1rKGSBBUvevaPbgesgM+Of65wmmTQRhFNCt
 A7+e286X1GiK3aNcjUKrByKWm7x590EWmDzmpmICxNPdt5DHQ6EkmvBdNjnxCMrO
 aGA24l78tBN09qN45LR7wtHYuuyR0Jt9bCmeQZmz7+x3ICDHi/+Gw7XPN/eM9+T6
 lZbbINiYUyZVxOqwzkYDCsdv9+kUvu3e4rPs20NERWRpV8FEvBIyMjXAg6NAMTue
 K+ikkyMBxCvyw+NMimHJwtD7ho4FkLPcoeXb2ZGJTRHixiZAEtF1RaQ7dA05Q/SL
 gbSc0DgLZeHlLBT+BSWC2Z8SDnoIhQFXW49OmuACwCUC68NHKps=
 =k30z
 -----END PGP SIGNATURE-----

Merge tag 'Wimplicit-fallthrough-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux

Pull Wimplicit-fallthrough updates from Gustavo A. R. Silva:
 "Mark switch cases where we are expecting to fall through.

  This is part of the ongoing efforts to enable -Wimplicit-fallthrough.

  Most of them have been baking in linux-next for a whole development
  cycle. And with Stephen Rothwell's help, we've had linux-next
  nag-emails going out for newly introduced code that triggers
  -Wimplicit-fallthrough to avoid gaining more of these cases while we
  work to remove the ones that are already present.

  We are getting close to completing this work. Currently, there are
  only 32 of 2311 of these cases left to be addressed in linux-next. I'm
  auditing every case; I take a look into the code and analyze it in
  order to determine if I'm dealing with an actual bug or a false
  positive, as explained here:

      https://lore.kernel.org/lkml/c2fad584-1705-a5f2-d63c-824e9b96cf50@embeddedor.com/

  While working on this, I've found and fixed the several missing
  break/return bugs, some of them introduced more than 5 years ago.

  Once this work is finished, we'll be able to universally enable
  "-Wimplicit-fallthrough" to avoid any of these kinds of bugs from
  entering the kernel again"

* tag 'Wimplicit-fallthrough-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux: (27 commits)
  memstick: mark expected switch fall-throughs
  drm/nouveau/nvkm: mark expected switch fall-throughs
  NFC: st21nfca: Fix fall-through warnings
  NFC: pn533: mark expected switch fall-throughs
  block: Mark expected switch fall-throughs
  ASN.1: mark expected switch fall-through
  lib/cmdline.c: mark expected switch fall-throughs
  lib: zstd: Mark expected switch fall-throughs
  scsi: sym53c8xx_2: sym_nvram: Mark expected switch fall-through
  scsi: sym53c8xx_2: sym_hipd: mark expected switch fall-throughs
  scsi: ppa: mark expected switch fall-through
  scsi: osst: mark expected switch fall-throughs
  scsi: lpfc: lpfc_scsi: Mark expected switch fall-throughs
  scsi: lpfc: lpfc_nvme: Mark expected switch fall-through
  scsi: lpfc: lpfc_nportdisc: Mark expected switch fall-through
  scsi: lpfc: lpfc_hbadisc: Mark expected switch fall-throughs
  scsi: lpfc: lpfc_els: Mark expected switch fall-throughs
  scsi: lpfc: lpfc_ct: Mark expected switch fall-throughs
  scsi: imm: mark expected switch fall-throughs
  scsi: csiostor: csio_wr: mark expected switch fall-through
  ...
2019-05-07 12:48:10 -07:00
Gustavo A. R. Silva
8fabc0eb9d scsi: bfa: bfa_fcpim: Mark expected switch fall-throughs
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Notice that I replaced "Fall through !!!" with a "fall through"
annotation, which is what GCC is expecting to find.

Addresses-Coverity-ID: 114971 ("Missing break in switch")
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
2019-04-08 18:37:24 -05:00
Will Deacon
fb24ea52f7 drivers: Remove explicit invocations of mmiowb()
mmiowb() is now implied by spin_unlock() on architectures that require
it, so there is no reason to call it from driver code. This patch was
generated using coccinelle:

	@mmiowb@
	@@
	- mmiowb();

and invoked as:

$ for d in drivers include/linux/qed sound; do \
spatch --include-headers --sp-file mmiowb.cocci --dir $d --in-place; done

NOTE: mmiowb() has only ever guaranteed ordering in conjunction with
spin_unlock(). However, pairing each mmiowb() removal in this patch with
the corresponding call to spin_unlock() is not at all trivial, so there
is a small chance that this change may regress any drivers incorrectly
relying on mmiowb() to order MMIO writes between CPUs using lock-free
synchronisation. If you've ended up bisecting to this commit, you can
reintroduce the mmiowb() calls using wmb() instead, which should restore
the old behaviour on all architectures other than some esoteric ia64
systems.

Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2019-04-08 12:01:02 +01:00
Linus Torvalds
92fff53b71 SCSI misc on 20190306
This is mostly update of the usual drivers: arcmsr, qla2xxx, lpfc,
 hisi_sas, target/iscsi and target/core.  Additionally Christoph
 refactored gdth as part of the dma changes.  The major mid-layer
 change this time is the removal of bidi commands and with them the
 whole of the osd/exofs driver and filesystem.
 
 Signed-off-by: James E.J. Bottomley <jejb@linux.ibm.com>
 -----BEGIN PGP SIGNATURE-----
 
 iJwEABMIAEQWIQTnYEDbdso9F2cI+arnQslM7pishQUCXIC54SYcamFtZXMuYm90
 dG9tbGV5QGhhbnNlbnBhcnRuZXJzaGlwLmNvbQAKCRDnQslM7pishT1GAPwJEV23
 ExPiPsnuVgKj49nLTagZ3rILRQcYNbL+MNYqxQEA0cT8FHzSDBfWY5OKPNE+RQ8z
 f69LpXGmMpuagKGvvd4=
 =Fhy1
 -----END PGP SIGNATURE-----

Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI updates from James Bottomley:
 "This is mostly update of the usual drivers: arcmsr, qla2xxx, lpfc,
  hisi_sas, target/iscsi and target/core.

  Additionally Christoph refactored gdth as part of the dma changes. The
  major mid-layer change this time is the removal of bidi commands and
  with them the whole of the osd/exofs driver and filesystem. This is a
  major simplification for block and mq in particular"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (240 commits)
  scsi: cxgb4i: validate tcp sequence number only if chip version <= T5
  scsi: cxgb4i: get pf number from lldi->pf
  scsi: core: replace GFP_ATOMIC with GFP_KERNEL in scsi_scan.c
  scsi: mpt3sas: Add missing breaks in switch statements
  scsi: aacraid: Fix missing break in switch statement
  scsi: kill command serial number
  scsi: csiostor: drop serial_number usage
  scsi: mvumi: use request tag instead of serial_number
  scsi: dpt_i2o: remove serial number usage
  scsi: st: osst: Remove negative constant left-shifts
  scsi: ufs-bsg: Allow reading descriptors
  scsi: ufs: Allow reading descriptor via raw upiu
  scsi: ufs-bsg: Change the calling convention for write descriptor
  scsi: ufs: Remove unused device quirks
  Revert "scsi: ufs: disable vccq if it's not needed by UFS device"
  scsi: megaraid_sas: Remove a bunch of set but not used variables
  scsi: clean obsolete return values of eh_timed_out
  scsi: sd: Optimal I/O size should be a multiple of physical block size
  scsi: MAINTAINERS: SCSI initiator and target tweaks
  scsi: fcoe: make use of fip_mode enum complete
  ...
2019-03-09 16:53:47 -08:00
Linus Torvalds
df49fd0ff8 SCSI fixes on 20190302
Nine small fixes.  The resume fix is a cosmetic removal of a warning
 with an incorrect condition causing it to alarm people wrongly.  The
 other eight patches correct a thinko in Christoph Hellwig's DMA
 conversion series.  Without it all these drivers end up with 32 bit
 DMA masks meaning they bounce any page over 4GB before sending it to
 the controller.  Nowadays, even laptops mostly have memory above 4GB,
 so this can lead to significant performance degradation with all the
 bouncing.
 
 Signed-off-by: James E.J. Bottomley <jejb@linux.ibm.com>
 -----BEGIN PGP SIGNATURE-----
 
 iJwEABMIAEQWIQTnYEDbdso9F2cI+arnQslM7pishQUCXHql8CYcamFtZXMuYm90
 dG9tbGV5QGhhbnNlbnBhcnRuZXJzaGlwLmNvbQAKCRDnQslM7pishQmvAQCSVQRf
 kx3ABDGnaj4Km4/Jzibj44aCYwh+ewwtLCWwFQD9GWaEaDxBkbxQDf/YndQKRhYg
 VJQjjj6a9VlNSmWoW28=
 =L9Fe
 -----END PGP SIGNATURE-----

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
 "Nine small fixes.

  The resume fix is a cosmetic removal of a warning with an incorrect
  condition causing it to alarm people wrongly.

  The other eight patches correct a thinko in Christoph Hellwig's DMA
  conversion series. Without it all these drivers end up with 32 bit DMA
  masks meaning they bounce any page over 4GB before sending it to the
  controller.

  Nowadays, even laptops mostly have memory above 4GB, so this can lead
  to significant performance degradation with all the bouncing"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: core: Avoid that system resume triggers a kernel warning
  scsi: hptiop: fix calls to dma_set_mask()
  scsi: hisi_sas: fix calls to dma_set_mask_and_coherent()
  scsi: csiostor: fix calls to dma_set_mask_and_coherent()
  scsi: bfa: fix calls to dma_set_mask_and_coherent()
  scsi: aic94xx: fix calls to dma_set_mask_and_coherent()
  scsi: 3w-sas: fix calls to dma_set_mask_and_coherent()
  scsi: 3w-9xxx: fix calls to dma_set_mask_and_coherent()
  scsi: lpfc: fix calls to dma_set_mask_and_coherent()
2019-03-02 11:39:54 -08:00