public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Lobakin <aleksander.lobakin@intel.com>
To: Arnd Bergmann <arnd@kernel.org>, Jakub Kicinski <kuba@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	"Nikolay Aleksandrov" <razor@blackwall.org>,
	Jason Xing <kerneljasonxing@gmail.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: netcp: MAX_SKB_FRAGS is now 'int'
Date: Fri, 31 Mar 2023 17:08:28 +0200	[thread overview]
Message-ID: <8dd0ab75-d007-8aa7-e546-c5fe93f9e03b@intel.com> (raw)
In-Reply-To: <20230331074919.1299425-1-arnd@kernel.org>

From: Arnd Bergmann <arnd@kernel.org>
Date: Fri, 31 Mar 2023 09:48:56 +0200

> From: Arnd Bergmann <arnd@arndb.de>
> 
> The type of MAX_SKB_FRAGS has changed recently, so the debug printk
> needs to be updated:
> 
> drivers/net/ethernet/ti/netcp_core.c: In function 'netcp_create_interface':
> drivers/net/ethernet/ti/netcp_core.c:2084:30: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'int' [-Werror=format=]
>  2084 |                 dev_err(dev, "tx-pool size too small, must be at least %ld\n",
>       |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Fixes: 3948b05950fd ("net: introduce a config option to tweak MAX_SKB_FRAGS")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/net/ethernet/ti/netcp_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/ti/netcp_core.c b/drivers/net/ethernet/ti/netcp_core.c
> index 1bb596a9d8a2..dfdbcdeb991f 100644
> --- a/drivers/net/ethernet/ti/netcp_core.c
> +++ b/drivers/net/ethernet/ti/netcp_core.c
> @@ -2081,7 +2081,7 @@ static int netcp_create_interface(struct netcp_device *netcp_device,
>  	netcp->tx_pool_region_id = temp[1];
>  
>  	if (netcp->tx_pool_size < MAX_SKB_FRAGS) {
> -		dev_err(dev, "tx-pool size too small, must be at least %ld\n",
> +		dev_err(dev, "tx-pool size too small, must be at least %d\n",
>  			MAX_SKB_FRAGS);
>  		ret = -ENODEV;
>  		goto quit;

(not related to the actual fix)

I'd personally define %MAX_SKB_FRAGS as `(u32)CONFIG_MAX_SKB_FRAGS`.
It can't be below zero or above %U32_MAX and we have to define it
manually anyway, so why not cast to the type expected from it :D

Thanks,
Olek

  parent reply	other threads:[~2023-03-31 15:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-31  7:48 [PATCH] net: netcp: MAX_SKB_FRAGS is now 'int' Arnd Bergmann
2023-03-31  8:40 ` patchwork-bot+netdevbpf
2023-03-31 21:44   ` Nathan Chancellor
2023-04-01  4:20     ` Jakub Kicinski
2023-03-31 15:08 ` Alexander Lobakin [this message]
2023-03-31 16:58   ` Eric Dumazet
2023-04-01 18:20     ` David Laight

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=8dd0ab75-d007-8aa7-e546-c5fe93f9e03b@intel.com \
    --to=aleksander.lobakin@intel.com \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kerneljasonxing@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.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