* [PATCH v2] net: socket: suppress unused warning
@ 2023-03-10 22:18 Vincenzo Palazzo
2023-03-12 3:31 ` Kuniyuki Iwashima
2023-03-13 23:10 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Vincenzo Palazzo @ 2023-03-10 22:18 UTC (permalink / raw)
To: netdev; +Cc: edumazet, kuba, pabeni, davem, kuniyu, Vincenzo Palazzo
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>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] net: socket: suppress unused warning
2023-03-10 22:18 [PATCH v2] net: socket: suppress unused warning Vincenzo Palazzo
@ 2023-03-12 3:31 ` Kuniyuki Iwashima
2023-03-13 23:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Kuniyuki Iwashima @ 2023-03-12 3:31 UTC (permalink / raw)
To: vincenzopalazzodev; +Cc: davem, edumazet, kuba, kuniyu, netdev, pabeni
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] net: socket: suppress unused warning
2023-03-10 22:18 [PATCH v2] net: socket: suppress unused warning Vincenzo Palazzo
2023-03-12 3:31 ` Kuniyuki Iwashima
@ 2023-03-13 23:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-03-13 23:10 UTC (permalink / raw)
To: Vincenzo Palazzo; +Cc: netdev, edumazet, kuba, pabeni, davem, kuniyu
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 10 Mar 2023 23:18:51 +0100 you wrote:
> 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;
>
> [...]
Here is the summary with links:
- [v2] net: socket: suppress unused warning
https://git.kernel.org/netdev/net-next/c/ad4bf5f2406f
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-03-13 23:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-10 22:18 [PATCH v2] net: socket: suppress unused warning Vincenzo Palazzo
2023-03-12 3:31 ` Kuniyuki Iwashima
2023-03-13 23:10 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).