Sherry Yang 3417c9574e scsi: lpfc: Fix overflow build issue
Build failed while enabling "CONFIG_GCOV_KERNEL=y" and
"CONFIG_GCOV_PROFILE_ALL=y" with following error:

BUILDSTDERR: drivers/scsi/lpfc/lpfc_bsg.c: In function 'lpfc_get_cgnbuf_info':
BUILDSTDERR: ./include/linux/fortify-string.h:114:33: error: '__builtin_memcpy' accessing 18446744073709551615 bytes at offsets 0 and 0 overlaps 9223372036854775807 bytes at offset -9223372036854775808 [-Werror=restrict]
BUILDSTDERR:   114 | #define __underlying_memcpy     __builtin_memcpy
BUILDSTDERR:       |                                 ^
BUILDSTDERR: ./include/linux/fortify-string.h:637:9: note: in expansion of macro '__underlying_memcpy'
BUILDSTDERR:   637 |         __underlying_##op(p, q, __fortify_size);                        \
BUILDSTDERR:       |         ^~~~~~~~~~~~~
BUILDSTDERR: ./include/linux/fortify-string.h:682:26: note: in expansion of macro '__fortify_memcpy_chk'
BUILDSTDERR:   682 | #define memcpy(p, q, s)  __fortify_memcpy_chk(p, q, s,                  \
BUILDSTDERR:       |                          ^~~~~~~~~~~~~~~~~~~~
BUILDSTDERR: drivers/scsi/lpfc/lpfc_bsg.c:5468:9: note: in expansion of macro 'memcpy'
BUILDSTDERR:  5468 |         memcpy(cgn_buff, cp, cinfosz);
BUILDSTDERR:       |         ^~~~~~

This happens from the commit 06bb7fc0feee ("kbuild: turn on -Wrestrict by
default"). Address this issue by using size_t type.

Signed-off-by: Sherry Yang <sherry.yang@oracle.com>
Link: https://lore.kernel.org/r/20240821065131.1180791-1-sherry.yang@oracle.com
Reviewed-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2024-08-22 20:57:41 -04:00
..
2024-05-18 12:39:20 -07:00
2024-05-22 12:13:40 -07:00
2024-05-14 18:25:53 -07:00
2023-10-13 14:15:54 -04:00
2024-03-16 16:31:12 -07:00
2024-05-14 18:25:53 -07:00
2024-07-17 13:26:01 -07:00
2024-08-22 20:57:41 -04:00
2024-05-22 12:13:40 -07:00
2024-05-22 12:13:40 -07:00
2024-03-10 18:15:48 -04:00
2024-05-14 18:25:53 -07:00
2024-05-21 10:09:28 -07:00
2024-05-21 10:09:28 -07:00
2023-04-18 23:01:23 -04:00
2024-03-15 17:53:48 -07:00
2024-04-01 21:08:48 -04:00
2024-04-01 21:08:48 -04:00
2024-05-21 10:09:28 -07:00
2024-07-15 14:20:22 -07:00
2024-03-16 16:31:12 -07:00
2024-06-20 15:19:17 -06:00
2024-06-11 21:14:54 -04:00
2024-06-20 15:19:17 -06:00
2023-05-31 11:36:40 -04:00