
Hi chenxiang, FYI, the error/warning still remains. tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: da51139d17e9d53d61a9877d9042e43b85d71ee1 commit: b4adbc622b73d2bc61e6d712e0a916e568f0ce3f [1414/1414] scsi: hisi_sas: add support for DIF/DIX feature of v3 hw config: arm64-defconfig (https://download.01.org/0day-ci/archive/20250125/202501250607.mBS8g6wb-lkp@i...) compiler: aarch64-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250125/202501250607.mBS8g6wb-lkp@i...) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202501250607.mBS8g6wb-lkp@intel.com/ Note: it may well be a FALSE warning. FWIW you are at least aware of it now. http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings All warnings (new ones prefixed by >>): In file included from include/scsi/libsas.h:36, from include/scsi/sas_ata.h:29, from drivers/scsi/hisi_sas/hisi_sas.h:27, from drivers/scsi/hisi_sas/hisi_sas_main.c:12: In function 'scsi_prot_sglist', inlined from 'hisi_sas_dif_dma_map' at drivers/scsi/hisi_sas/hisi_sas_main.c:442:2:
include/scsi/scsi_cmnd.h:327:19: warning: 'scsi_cmnd' may be used uninitialized [-Wmaybe-uninitialized] 327 | return cmd->prot_sdb ? cmd->prot_sdb->table.sgl : NULL; | ~~~^~~~~~~~~~ drivers/scsi/hisi_sas/hisi_sas_main.c: In function 'hisi_sas_dif_dma_map': drivers/scsi/hisi_sas/hisi_sas_main.c:412:27: note: 'scsi_cmnd' was declared here 412 | struct scsi_cmnd *scsi_cmnd; | ^~~~~~~~~
vim +/scsi_cmnd +327 include/scsi/scsi_cmnd.h 7027ad72a689797 Martin K. Petersen 2008-07-17 324 7027ad72a689797 Martin K. Petersen 2008-07-17 325 static inline struct scatterlist *scsi_prot_sglist(struct scsi_cmnd *cmd) 7027ad72a689797 Martin K. Petersen 2008-07-17 326 { 7027ad72a689797 Martin K. Petersen 2008-07-17 @327 return cmd->prot_sdb ? cmd->prot_sdb->table.sgl : NULL; 7027ad72a689797 Martin K. Petersen 2008-07-17 328 } 7027ad72a689797 Martin K. Petersen 2008-07-17 329 :::::: The code at line 327 was first introduced by commit :::::: 7027ad72a689797475973c6feb5f0b673382f779 [SCSI] Support devices with protection information :::::: TO: Martin K. Petersen <martin.petersen@oracle.com> :::::: CC: James Bottomley <James.Bottomley@HansenPartnership.com> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki