Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: smartpqi: Fix BUILD_BUG_ON() statements

Add calls to the functions at the beginning driver initialization.

The BUILD_BUG_ON() statements that are currently in functions named
verify_structures() in the modules smartpqi_init.c and smartpqi_sis.c do
not work as currently implemented.

Link: https://lore.kernel.org/r/164375214355.440833.13129778749209816497.stgit@brunhilda.pdev.net
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Signed-off-by: Mike McGowen <Mike.McGowen@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Mike McGowen and committed by
Martin K. Petersen
5e693586 c52efc92

+6 -2
+4 -1
drivers/scsi/smartpqi/smartpqi_init.c
··· 54 54 MODULE_VERSION(DRIVER_VERSION); 55 55 MODULE_LICENSE("GPL"); 56 56 57 + static void pqi_verify_structures(void); 57 58 static void pqi_take_ctrl_offline(struct pqi_ctrl_info *ctrl_info, 58 59 enum pqi_ctrl_shutdown_reason ctrl_shutdown_reason); 59 60 static void pqi_ctrl_offline_worker(struct work_struct *work); ··· 9704 9703 int rc; 9705 9704 9706 9705 pr_info(DRIVER_NAME "\n"); 9706 + pqi_verify_structures(); 9707 + sis_verify_structures(); 9707 9708 9708 9709 pqi_sas_transport_template = sas_attach_transport(&pqi_sas_transport_functions); 9709 9710 if (!pqi_sas_transport_template) ··· 9729 9726 module_init(pqi_init); 9730 9727 module_exit(pqi_cleanup); 9731 9728 9732 - static void __attribute__((unused)) verify_structures(void) 9729 + static void pqi_verify_structures(void) 9733 9730 { 9734 9731 BUILD_BUG_ON(offsetof(struct pqi_ctrl_registers, 9735 9732 sis_host_to_ctrl_doorbell) != 0x20);
+1 -1
drivers/scsi/smartpqi/smartpqi_sis.c
··· 479 479 return rc; 480 480 } 481 481 482 - static void __attribute__((unused)) verify_structures(void) 482 + void sis_verify_structures(void) 483 483 { 484 484 BUILD_BUG_ON(offsetof(struct sis_base_struct, 485 485 revision) != 0x0);
+1
drivers/scsi/smartpqi/smartpqi_sis.h
··· 12 12 #if !defined(_SMARTPQI_SIS_H) 13 13 #define _SMARTPQI_SIS_H 14 14 15 + void sis_verify_structures(void); 15 16 int sis_wait_for_ctrl_ready(struct pqi_ctrl_info *ctrl_info); 16 17 int sis_wait_for_ctrl_ready_resume(struct pqi_ctrl_info *ctrl_info); 17 18 bool sis_is_firmware_running(struct pqi_ctrl_info *ctrl_info);