public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Jakub Kicinski <kuba@kernel.org>, netdev <netdev@vger.kernel.org>,
	Mirko Lindner <mlindner@marvell.com>
Subject: Re: [PATCH net-next v2] drivers: net: sky2: Fix -Wstringop-truncation with W=1
Date: Mon, 9 Nov 2020 22:06:16 -0800	[thread overview]
Message-ID: <20201109220616.7c3ecf02@hermes.local> (raw)
In-Reply-To: <20201110023222.1479398-1-andrew@lunn.ch>

On Tue, 10 Nov 2020 03:32:22 +0100
Andrew Lunn <andrew@lunn.ch> wrote:

> In function ‘strncpy’,
>     inlined from ‘sky2_name’ at drivers/net/ethernet/marvell/sky2.c:4903:3,
>     inlined from ‘sky2_probe’ at drivers/net/ethernet/marvell/sky2.c:5049:2:
> ./include/linux/string.h:297:30: warning: ‘__builtin_strncpy’ specified bound 16 equals destination size [-Wstringop-truncation]
> 
> None of the device names are 16 characters long, so it was never an
> issue. But replace the strncpy with an snprintf() to prevent the
> theoretical overflow.
> 
> Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>

Acked-by: Stephen Hemminger <stephen@networkplumber.org>

  reply	other threads:[~2020-11-10  6:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-10  2:32 [PATCH net-next v2] drivers: net: sky2: Fix -Wstringop-truncation with W=1 Andrew Lunn
2020-11-10  6:06 ` Stephen Hemminger [this message]
2020-11-12  4:24 ` Jakub Kicinski

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=20201109220616.7c3ecf02@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=andrew@lunn.ch \
    --cc=kuba@kernel.org \
    --cc=mlindner@marvell.com \
    --cc=netdev@vger.kernel.org \
    /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