* [PATCH] scsi: qla2xxx: Remove duplicate struct crb_addr_pair
@ 2025-04-26 6:19 Kees Cook
2025-04-29 1:31 ` Martin K. Petersen
2025-05-06 4:25 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Kees Cook @ 2025-04-26 6:19 UTC (permalink / raw)
To: Nilesh Javali
Cc: Kees Cook, GR-QLogic-Storage-Upstream, James E.J. Bottomley,
Martin K. Petersen, linux-scsi, linux-kernel, linux-hardening
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>
---
Cc: Nilesh Javali <njavali@marvell.com>
Cc: <GR-QLogic-Storage-Upstream@marvell.com>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: <linux-scsi@vger.kernel.org>
---
drivers/scsi/qla2xxx/qla_nx.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c
index 6dfb70edb9a6..470fe1d38973 100644
--- a/drivers/scsi/qla2xxx/qla_nx.c
+++ b/drivers/scsi/qla2xxx/qla_nx.c
@@ -1099,11 +1099,6 @@ qla82xx_pinit_from_rom(scsi_qla_host_t *vha)
unsigned offset, n;
struct qla_hw_data *ha = vha->hw;
- struct crb_addr_pair {
- long addr;
- long data;
- };
-
/* Halt all the individual PEGs and other blocks of the ISP */
qla82xx_rom_lock(ha);
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: qla2xxx: Remove duplicate struct crb_addr_pair
2025-04-26 6:19 [PATCH] scsi: qla2xxx: Remove duplicate struct crb_addr_pair Kees Cook
@ 2025-04-29 1:31 ` Martin K. Petersen
2025-05-06 4:25 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2025-04-29 1:31 UTC (permalink / raw)
To: Kees Cook
Cc: Nilesh Javali, GR-QLogic-Storage-Upstream, James E.J. Bottomley,
Martin K. Petersen, linux-scsi, linux-kernel, linux-hardening
Kees,
> 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.)
Applied to 6.16/scsi-staging, thanks!
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: qla2xxx: Remove duplicate struct crb_addr_pair
2025-04-26 6:19 [PATCH] scsi: qla2xxx: Remove duplicate struct crb_addr_pair Kees Cook
2025-04-29 1:31 ` Martin K. Petersen
@ 2025-05-06 4:25 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2025-05-06 4:25 UTC (permalink / raw)
To: Nilesh Javali, Kees Cook
Cc: Martin K . Petersen, GR-QLogic-Storage-Upstream,
James E.J. Bottomley, linux-scsi, linux-kernel, linux-hardening
On Fri, 25 Apr 2025 23:19:52 -0700, Kees Cook wrote:
> 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.
>
> [...]
Applied to 6.16/scsi-queue, thanks!
[1/1] scsi: qla2xxx: Remove duplicate struct crb_addr_pair
https://git.kernel.org/mkp/scsi/c/386e014202f8
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-06 4:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-26 6:19 [PATCH] scsi: qla2xxx: Remove duplicate struct crb_addr_pair Kees Cook
2025-04-29 1:31 ` Martin K. Petersen
2025-05-06 4:25 ` 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