lists.openwall.net   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 <davem@...emloft.net>
To:     arnd@...db.de
Cc:     ktkhai@...tuozzo.com, axboe@...nel.dk, willemb@...gle.com,
        deepa.kernel@...il.com, johannes.berg@...el.com,
        viro@...iv.linux.org.uk, pctammela@...il.com,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] [net-next] socket: fix unused-function warning

From: Arnd Bergmann <arnd@...db.de>
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 <arnd@...db.de>

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