Fix warning in tegra_fuse_add_lookups
PATCH 1/1 Fix warning in tegra_fuse_add_lookups
gcc 14.1.1 warns [-Wcalloc-transposed-args] when sizeof() is used in the first, but not the second, of two size_t arguments.
--- drivers/soc/tegra/fuse/fuse-tegra.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/soc/tegra/fuse/fuse-tegra.c +2 -2
@@ -127,8 +127,8 @@ static void tegra_fuse_print_sku_info(struct tegra_sku_info *tegra_sku_info)static int tegra_fuse_add_lookups (struct tegra_fuse *fuse) { - fuse->lookups =kmemdup_array (fuse->soc->lookups,sizeof (*fuse->lookups), - fuse->soc->num_lookups,GFP_KERNEL ); + fuse->lookups =kmemdup_array (fuse->soc->lookups, fuse->soc->num_lookups, +sizeof (*fuse->lookups),GFP_KERNEL );if (!fuse->lookups)return -ENOMEM ;
Signature · 1 line
2.45.2
Thierry Reding
AppliedFrom: Thierry Reding <[email protected]>
Quoted 4 lines · Jason Sikes
gcc 14.1.1 warns [-Wcalloc-transposed-args] when
sizeof()is used in the first, but not the second, of twosize_targuments.
Applied, thanks!
[1/1] Fix warning in tegra_fuse_add_lookups
commit: f56da7f4048ff41cb029a715935394f5958a825f
Best regards,
Signature · 1 line
Thierry Reding <[email protected]>
Quoted 9 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Quoted 4 lines · Jason Sikes
gcc 14.1.1 warns [-Wcalloc-transposed-args] when
sizeof()is used in the first, but not the second, of twosize_targuments.
Quoted 6 lines
Applied, thanks!
[1/1] Fix warning in
tegra_fuse_add_lookupscommit: f56da7f4048ff41cb029a715935394f5958a825fBest regards,
Scratch that. Looks like gcc isn't warning correctly here. kmemdup_array() does have "size_t element_size, size_t count", so the existing code is correct.
Thierry
Quoted 19 lines · Thierry Reding
Quoted 14 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Quoted 4 lines · Jason Sikes
gcc 14.1.1 warns [-Wcalloc-transposed-args] when
sizeof()is used in the first, but not the second, of twosize_targuments.Applied, thanks!
[1/1] Fix warning in
tegra_fuse_add_lookupscommit: f56da7f4048ff41cb029a715935394f5958a825f
Quoted 7 lines
Quoted 1 line
Best regards,
Scratch that. Looks like gcc isn't warning correctly here.
kmemdup_array()does have "size_telement_size,size_tcount", so the existing code is correct.Thierry
The order changed in kernel mainline recently (very recently).
Commit: 0ee14725471cea66e03e3cd4f4c582d759de502c
Subject: mm/util: Swap kmemdup_array() arguments
Apologies if you received this as a duplicate message. The previous was sent with HTML, and Vger rightfully rejected it.
—Thanks,
—Jason
Quoted 28 lines · On Fri, Jun 28, 2024 at 10:17:13AM GMT, [email protected] wrote:
Quoted 19 lines · Thierry Reding
Quoted 14 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Quoted 4 lines · Jason Sikes
gcc 14.1.1 warns [-Wcalloc-transposed-args] when
sizeof()is used in the first, but not the second, of twosize_targuments.Applied, thanks!
[1/1] Fix warning in
tegra_fuse_add_lookupscommit: f56da7f4048ff41cb029a715935394f5958a825fQuoted 7 lines
Quoted 1 line
Best regards,
Scratch that. Looks like gcc isn't warning correctly here.
kmemdup_array()does have "size_telement_size,size_tcount", so the existing code is correct.Thierry
Quoted 6 lines
The order changed in kernel mainline recently (very recently).
Commit:
0ee14725471cea66e03e3cd4f4c582d759de502c
Subject: mm/util: Swapkmemdup_array()argumentsApologies if you received this as a duplicate message. The previous was sent with HTML, and Vger rightfully rejected it.
That commit seems to take care of the change in fuse-tegra.c already, so this patch is no longer needed, right?
Thierry
Quoted 38 lines · Thierry Reding
Quoted 33 lines · On Fri, Jun 28, 2024 at 10:17:13AM GMT, [email protected] wrote:
Quoted 19 lines · Thierry Reding
Quoted 14 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Quoted 4 lines · Jason Sikes
gcc 14.1.1 warns [-Wcalloc-transposed-args] when
sizeof()is used in the first, but not the second, of twosize_targuments.Applied, thanks!
[1/1] Fix warning in
tegra_fuse_add_lookupscommit: f56da7f4048ff41cb029a715935394f5958a825fQuoted 7 lines
Quoted 1 line
Best regards,
Scratch that. Looks like gcc isn't warning correctly here.
kmemdup_array()does have "size_telement_size,size_tcount", so the existing code is correct.Thierry
The order changed in kernel mainline recently (very recently).
Commit:
0ee14725471cea66e03e3cd4f4c582d759de502c
Subject: mm/util: Swapkmemdup_array()arguments
Quoted 6 lines
Quoted 1 line
Apologies if you received this as a duplicate message. The previous was sent with HTML, and Vger rightfully rejected it.
That commit seems to take care of the change in
fuse-tegra.calready, so this patch is no longer needed, right?Thierry
Ah. Yes, you are correct. All is well.
—Thank you for your time,
—Jason