Thread (19 messages) 19 messages, 6 authors, 2020-05-05

Re: [PATCH 3/5] sysctl: remove all extern declaration from sysctl.c

From: Stephen Rothwell <hidden>
Date: 2020-05-04 01:26:04
Also in: bpf, linux-fsdevel, lkml, netdev

Hi Christoph,

On Fri, 24 Apr 2020 08:43:36 +0200 Christoph Hellwig [off-list ref] wrote:
Extern declarations in .c files are a bad style and can lead to
mismatches.  Use existing definitions in headers where they exist,
and otherwise move the external declarations to suitable header
files.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 include/linux/coredump.h |  4 ++++
 include/linux/file.h     |  2 ++
 include/linux/mm.h       |  2 ++
 include/linux/mmzone.h   |  2 ++
 include/linux/pid.h      |  3 +++
 include/linux/sysctl.h   |  8 +++++++
 kernel/sysctl.c          | 45 +++-------------------------------------
 7 files changed, 24 insertions(+), 42 deletions(-)
A couple of suggestions for another patch (since this one is in a
shared branch in Al's tree now):

There is an "extern struct ctl_table random_table[];" in
drivers/char/random.c which is redundant now (in fact always was).

There is already an "extern struct ctl_table epoll_table[];" in
include/linux/poll.h, so could have included that in kernel/sysctl.c
instead of adding the new one in include/linux/sysctl.h

-- 
Cheers,
Stephen Rothwell

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help