mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: <linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>,
	<intel-wired-lan@lists.osuosl.org>, <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] iavf: Avoid a memory allocation in iavf_print_link_message()
Date: Tue, 3 Oct 2023 16:01:18 -0700	[thread overview]
Message-ID: <ecc05528-ba59-922b-7384-4bedd46cf89b@intel.com> (raw)
In-Reply-To: <abf8d279-b579-4a03-9ae9-053cf5efec3d@wanadoo.fr>

On 10/3/2023 1:33 PM, Christophe JAILLET wrote:
> kasprintf() is much better.

cool! I just sent the patches and cc'd you earlier today.

>>
>> your patch still shows these errors
> 
> I built-tested the patch before sending, so this is strange.
> 
> However, I got a similar feedback from Greg KH and the "kernel test 
> robot" for another similar patch.
> 
> What version of gcc do you use?
> I use 12.3.0, and I suspect that the value range algorithm or how the 
> diagnostic is done has been improved in recent gcc.

Fedora gcc 12.3.1, with W=1 flag

gcc version 12.3.1 20230508 (Red Hat 12.3.1-1) (GCC)

[linux]$ make W=1 M=drivers/net/ethernet/intel/iavf
   CC [M]  drivers/net/ethernet/intel/iavf/iavf_main.o
   CC [M]  drivers/net/ethernet/intel/iavf/iavf_ethtool.o
   CC [M]  drivers/net/ethernet/intel/iavf/iavf_virtchnl.o
   CC [M]  drivers/net/ethernet/intel/iavf/iavf_fdir.o
   CC [M]  drivers/net/ethernet/intel/iavf/iavf_adv_rss.o
   CC [M]  drivers/net/ethernet/intel/iavf/iavf_txrx.o
   CC [M]  drivers/net/ethernet/intel/iavf/iavf_common.o
   CC [M]  drivers/net/ethernet/intel/iavf/iavf_adminq.o
   CC [M]  drivers/net/ethernet/intel/iavf/iavf_client.o
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c: In function 
‘iavf_virtchnl_completion’:
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1446:60: warning: ‘%s’ 
directive output may be truncated writing 4 bytes into a region of size 
between 1 and 11 [-Wformat-truncation=]
  1446 |                 snprintf(speed, IAVF_MAX_SPEED_STRLEN, "%d %s",
       |                                                            ^~
  1447 |                          link_speed_mbps, "Mbps");
       |                                           ~~~~~~
In function ‘iavf_print_link_message’,
     inlined from ‘iavf_virtchnl_completion’ at 
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1965:4:
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1446:17: note: 
‘snprintf’ output between 7 and 17 bytes into a destination of size 13
  1446 |                 snprintf(speed, IAVF_MAX_SPEED_STRLEN, "%d %s",
       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1447 |                          link_speed_mbps, "Mbps");
       |                          ~~~~~~~~~~~~~~~~~~~~~~~~




  reply	other threads:[~2023-10-03 23:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-23 12:17 Christophe JAILLET
2023-09-25  8:11 ` Przemek Kitszel
2023-10-03 17:14 ` Jesse Brandeburg
2023-10-03 20:33   ` Christophe JAILLET
2023-10-03 23:01     ` Jesse Brandeburg [this message]
2023-10-04  8:04       ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ecc05528-ba59-922b-7384-4bedd46cf89b@intel.com \
    --to=jesse.brandeburg@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®