From: Kuniyuki Iwashima <kuniyu@amazon•com>
To: <vincenzopalazzodev@gmail•com>
Cc: <davem@davemloft•net>, <edumazet@google•com>, <kuba@kernel•org>,
<kuniyu@amazon•com>, <netdev@vger•kernel.org>,
<pabeni@redhat•com>
Subject: Re: [PATCH v2] net: socket: suppress unused warning
Date: Sat, 11 Mar 2023 19:31:03 -0800 [thread overview]
Message-ID: <20230312033103.5526-1-kuniyu@amazon.com> (raw)
In-Reply-To: <20230310221851.304657-1-vincenzopalazzodev@gmail.com>
From: Vincenzo Palazzo <vincenzopalazzodev@gmail•com>
Date: Fri, 10 Mar 2023 23:18:51 +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@gmail•com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon•com>
Thanks,
Kuniyuki
> ---
> net/socket.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/socket.c b/net/socket.c
> index 6bae8ce7059e..ad081c9b429f 100644
> --- a/net/socket.c
> +++ b/net/socket.c
> @@ -2295,9 +2295,9 @@ INDIRECT_CALLABLE_DECLARE(bool tcp_bpf_bypass_getsockopt(int level,
> int __sys_getsockopt(int fd, int level, int optname, char __user *optval,
> int __user *optlen)
> {
> + int max_optlen __maybe_unused;
> int err, fput_needed;
> struct socket *sock;
> - int max_optlen;
>
> sock = sockfd_lookup_light(fd, &err, &fput_needed);
> if (!sock)
> --
> 2.39.2
next prev parent reply other threads:[~2023-03-12 3:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-10 22:18 [PATCH v2] net: socket: suppress unused warning Vincenzo Palazzo
2023-03-12 3:31 ` Kuniyuki Iwashima [this message]
2023-03-13 23:10 ` patchwork-bot+netdevbpf
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=20230312033103.5526-1-kuniyu@amazon.com \
--to=kuniyu@amazon$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=edumazet@google$(echo .)com \
--cc=kuba@kernel$(echo .)org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
--cc=vincenzopalazzodev@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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