scsi: qla4xxx: Remove duplicate struct crb_addr_pair
authorKees Cook <kees@kernel.org>
Sat, 26 Apr 2025 06:20:11 +0000 (23:20 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 29 Apr 2025 01:30:47 +0000 (21:30 -0400)
In preparation for making the kmalloc family of allocators type aware, we
need to make sure that the returned type from the allocation matches the
type of the variable being assigned. (Before, the allocator would always
return "void *", which can be implicitly cast to any pointer type.)

The assigned type is "struct crb_addr_pair *" and the returned type will
be a _different_ "struct crb_addr_pair *", causing a warning. This really
stumped me for a bit. :) Drop the redundant declaration.

Signed-off-by: Kees Cook <kees@kernel.org>
Link: https://lore.kernel.org/r/20250426062010.work.878-kees@kernel.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla4xxx/ql4_nx.c

index 47adff9f05062bcf03de7f3e78b2f348164cb977..da2fc66ffedd5df68df389b2d0a802daebb4993a 100644 (file)
@@ -973,11 +973,6 @@ qla4_82xx_pinit_from_rom(struct scsi_qla_host *ha, int verbose)
        unsigned long off;
        unsigned offset, n;
 
-       struct crb_addr_pair {
-               long addr;
-               long data;
-       };
-
        /* Halt all the indiviual PEGs and other blocks of the ISP */
        qla4_82xx_rom_lock(ha);