lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 08 Jan 2020 13:27:01 -0800 (PST)
From:   David Miller <>
Subject: Re: [PATCH] [net-next] socket: fix unused-function warning

From: Arnd Bergmann <>
Date: Tue,  7 Jan 2020 22:35:59 +0100

> When procfs is disabled, the fdinfo code causes a harmless
> warning:
> net/socket.c:1000:13: error: 'sock_show_fdinfo' defined but not used [-Werror=unused-function]
>  static void sock_show_fdinfo(struct seq_file *m, struct file *f)
> Change the preprocessor conditional to a compiler conditional
> to avoid the warning and let the compiler throw away the
> function itself.
> Fixes: b4653342b151 ("net: Allow to show socket-specific information in /proc/[pid]/fdinfo/[fd]")
> Signed-off-by: Arnd Bergmann <>

This isn't the prettiest thing I've ever seen.

I really think it's nicer to just explicitly put ifdef's around the
forward declaration and the implementation of sock_show_fdinfo().

Alternatively, move the implementation up to the location of the
forward declaration and then you just need one new ifdef guard.

Powered by blists - more mailing lists