[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230310205929.23362-1-kuniyu@amazon.com>
Date: Fri, 10 Mar 2023 12:59:29 -0800
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <vincenzopalazzodev@...il.com>
CC: <davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
<netdev@...r.kernel.org>, <pabeni@...hat.com>, <kuniyu@...zon.com>
Subject: Re: [PATCH v1] net: socket: suppress unused warning
From: Vincenzo Palazzo <vincenzopalazzodev@...il.com>
Date: Thu, 9 Mar 2023 17:00:01 +0100
> suppress unused warnings and fix the error that there is
> with the W=1 enabled.
>
> Warning generated
>
> net/socket.c: In function ‘__sys_getsockopt’:
> net/socket.c:2300:13: error: variable ‘max_optlen’ set but not used [-Werror=unused-but-set-variable]
> 2300 | int max_optlen;
>
> Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@...il.com>
> ---
> net/socket.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/socket.c b/net/socket.c
> index 6bae8ce7059e..20edd4b222ca 100644
> --- a/net/socket.c
> +++ b/net/socket.c
> @@ -2297,7 +2297,7 @@ int __sys_getsockopt(int fd, int level, int optname, char __user *optval,
> {
Move max_optlen here to keep reverse xmas tree order.
int max_optlen __maybe_unused;
> int err, fput_needed;
> struct socket *sock;
> - int max_optlen;
> + int max_optlen __maybe_unused;
>
> sock = sockfd_lookup_light(fd, &err, &fput_needed);
> if (!sock)
> --
> 2.39.2
Thanks,
Kuniyuki
Powered by blists - more mailing lists