Message ID | 20240616073721.5696-1-sikes@qlogo.org |
---|---|
State | Rejected |
Headers | show |
Series | Fix warning in tegra_fuse_add_lookups | expand |
From: Thierry Reding <treding@nvidia.com> On Sun, 16 Jun 2024 00:36:57 -0700, Jason Sikes wrote: > gcc 14.1.1 warns [-Wcalloc-transposed-args] when sizeof() is > used in the first, but not the second, of two size_t arguments. > > Applied, thanks! [1/1] Fix warning in tegra_fuse_add_lookups commit: f56da7f4048ff41cb029a715935394f5958a825f Best regards,
On Fri, Jun 28, 2024 at 05:18:48PM GMT, Thierry Reding wrote: > From: Thierry Reding <treding@nvidia.com> > > > On Sun, 16 Jun 2024 00:36:57 -0700, Jason Sikes wrote: > > gcc 14.1.1 warns [-Wcalloc-transposed-args] when sizeof() is > > used in the first, but not the second, of two size_t arguments. > > > > > > Applied, thanks! > > [1/1] Fix warning in tegra_fuse_add_lookups > commit: f56da7f4048ff41cb029a715935394f5958a825f > > Best 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
> On Jun 28, 2024, at 8:29 AM, Thierry Reding <thierry.reding@gmail.com> wrote: > > On Fri, Jun 28, 2024 at 05:18:48PM GMT, Thierry Reding wrote: >> From: Thierry Reding <treding@nvidia.com> >> >> >> On Sun, 16 Jun 2024 00:36:57 -0700, Jason Sikes wrote: >>> gcc 14.1.1 warns [-Wcalloc-transposed-args] when sizeof() is >>> used in the first, but not the second, of two size_t arguments. >>> >>> >> >> Applied, thanks! >> >> [1/1] Fix warning in tegra_fuse_add_lookups >> commit: f56da7f4048ff41cb029a715935394f5958a825f >> >> Best 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 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
On Fri, Jun 28, 2024 at 10:17:13AM GMT, sikes@qlogo.org wrote: > > > > On Jun 28, 2024, at 8:29 AM, Thierry Reding <thierry.reding@gmail.com> wrote: > > > > On Fri, Jun 28, 2024 at 05:18:48PM GMT, Thierry Reding wrote: > >> From: Thierry Reding <treding@nvidia.com> > >> > >> > >> On Sun, 16 Jun 2024 00:36:57 -0700, Jason Sikes wrote: > >>> gcc 14.1.1 warns [-Wcalloc-transposed-args] when sizeof() is > >>> used in the first, but not the second, of two size_t arguments. > >>> > >>> > >> > >> Applied, thanks! > >> > >> [1/1] Fix warning in tegra_fuse_add_lookups > >> commit: f56da7f4048ff41cb029a715935394f5958a825f > >> > >> Best 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 > > > 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. That commit seems to take care of the change in fuse-tegra.c already, so this patch is no longer needed, right? Thierry
> On Jun 28, 2024, at 2:27 PM, Thierry Reding <thierry.reding@gmail.com> wrote: > > On Fri, Jun 28, 2024 at 10:17:13AM GMT, sikes@qlogo.org wrote: >> >> >>> On Jun 28, 2024, at 8:29 AM, Thierry Reding <thierry.reding@gmail.com> wrote: >>> >>> On Fri, Jun 28, 2024 at 05:18:48PM GMT, Thierry Reding wrote: >>>> From: Thierry Reding <treding@nvidia.com> >>>> >>>> >>>> On Sun, 16 Jun 2024 00:36:57 -0700, Jason Sikes wrote: >>>>> gcc 14.1.1 warns [-Wcalloc-transposed-args] when sizeof() is >>>>> used in the first, but not the second, of two size_t arguments. >>>>> >>>>> >>>> >>>> Applied, thanks! >>>> >>>> [1/1] Fix warning in tegra_fuse_add_lookups >>>> commit: f56da7f4048ff41cb029a715935394f5958a825f >>>> >>>> Best 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 >> >> >> 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. > > That commit seems to take care of the change in fuse-tegra.c already, so > this patch is no longer needed, right? > > Thierry Ah. Yes, you are correct. All is well. —Thank you for your time, —Jason
diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c index b6bfd6729df3..d27667283846 100644 --- a/drivers/soc/tegra/fuse/fuse-tegra.c +++ b/drivers/soc/tegra/fuse/fuse-tegra.c @@ -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;
gcc 14.1.1 warns [-Wcalloc-transposed-args] when sizeof() is used in the first, but not the second, of two size_t arguments. Signed-off-by: Jason Sikes <sikes@qlogo.org> --- drivers/soc/tegra/fuse/fuse-tegra.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)