scsi: fcoe: fix mismatched fcoe_wwn_from_mac declaration
Subsystems (2)
PATCH 1/1 scsi: fcoe: fix mismatched fcoe_wwn_from_mac declaration
From: Arnd Bergmann <[email protected]>
An old cleanup changed the array size from MAX_ADDR_LEN to unspecified in the declaration, but now gcc-11 warns about this:
drivers/scsi/fcoe/fcoe_ctlr.c:1972:37: error: argument 1 of type ‘unsigned char[32]’ with mismatched bound [-Werror=array-parameter=]
1972 | u64 fcoe_wwn_from_mac(unsigned char mac[MAX_ADDR_LEN],
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
In file included from /git/arm-soc/drivers/scsi/fcoe/fcoe_ctlr.c:33:
include/scsi/libfcoe.h:252:37: note: previously declared as ‘unsigned char[]’
252 | u64 fcoe_wwn_from_mac(unsigned char mac[], unsigned int, unsigned int);
| ~~~~~~~~~~~~~~^~~~~Change the type back to what the function definition uses.
--- include/scsi/libfcoe.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/scsi/libfcoe.h +1 -1
@@ -249,7 +249,7 @@ int fcoe_ctlr_recv_flogi(struct fcoe_ctlr *, struct fc_lport *, struct fc_frame *);/* libfcoe funcs */ -u64 fcoe_wwn_from_mac (unsigned char mac[],unsigned int ,unsigned int ); +u64 fcoe_wwn_from_mac (unsigned char mac[MAX_ADDR_LEN ],unsigned int ,unsigned int );int fcoe_libfc_config (struct fc_lport *,struct fcoe_ctlr *,const struct libfc_function_template *,int init_fcp);u32 fcoe_fc_crc (struct fc_frame *fp);
Signature · 1 line
2.29.2
Martin K. Petersen
AppliedQuoted 5 lines · Arnd Bergmann
An old cleanup changed the array size from
MAX_ADDR_LENto unspecified in the declaration, but now gcc-11 warns about this:
drivers/scsi/fcoe/fcoe_ctlr.c:1972:37: error: argument 1 of type ‘unsigned char[32]’ with mismatched bound [-Werror=array-parameter=]
1972 | u64 fcoe_wwn_from_mac(unsigned char mac[MAX_ADDR_LEN],
Quoted 7 lines
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ In file included from /git/arm-soc/drivers/scsi/fcoe/fcoe_ctlr.c:33: include/scsi/libfcoe.h:252:37: note: previously declared as ‘unsigned char[]’ 252 | u64 fcoe_wwn_from_mac(unsigned char mac[], unsigned int, unsigned int); | ~~~~~~~~~~~~~~^~~~~[...]
Applied to 5.13/scsi-queue, thanks!
[1/1] scsi: fcoe: fix mismatched fcoe_wwn_from_mac declaration
https://git.kernel.org/mkp/scsi/c/5b11c9d80bde
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering