Skip to content

Commit 19c4e61

Browse files
Joelgranadosmcgrof
authored andcommitted
sysctl: stop exporting register_sysctl_table
We make register_sysctl_table static because the only function calling it is in fs/proc/proc_sysctl.c (__register_sysctl_base). We remove it from the sysctl.h header and modify the documentation in both the header and proc_sysctl.c files to mention "register_sysctl" instead of "register_sysctl_table". This plus the commits that remove register_sysctl_table from parport save 217 bytes: ./scripts/bloat-o-meter .bsysctl/vmlinux.old .bsysctl/vmlinux.new add/remove: 0/1 grow/shrink: 5/1 up/down: 458/-675 (-217) Function old new delta __register_sysctl_base 8 286 +278 parport_proc_register 268 379 +111 parport_device_proc_register 195 247 +52 kzalloc.constprop 598 608 +10 parport_default_proc_register 62 69 +7 register_sysctl_table 291 - -291 parport_sysctl_template 1288 904 -384 Total: Before=8603076, After=8602859, chg -0.00% Signed-off-by: Joel Granados <j.granados@samsung.com> Reviewed-by: Luis Chamberlain <mcgrof@kernel.org> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
1 parent 9ad0a4e commit 19c4e61

2 files changed

Lines changed: 3 additions & 10 deletions

File tree

fs/proc/proc_sysctl.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,7 @@ static int register_leaf_sysctl_tables(const char *path, char *pos,
15821582
* array. A completely 0 filled entry terminates the table.
15831583
* We are slowly deprecating this call so avoid its use.
15841584
*/
1585-
struct ctl_table_header *register_sysctl_table(struct ctl_table *table)
1585+
static struct ctl_table_header *register_sysctl_table(struct ctl_table *table)
15861586
{
15871587
struct ctl_table *ctl_table_arg = table;
15881588
int nr_subheaders = count_subheaders(table);
@@ -1634,7 +1634,6 @@ struct ctl_table_header *register_sysctl_table(struct ctl_table *table)
16341634
header = NULL;
16351635
goto out;
16361636
}
1637-
EXPORT_SYMBOL(register_sysctl_table);
16381637

16391638
int __register_sysctl_base(struct ctl_table *base_table)
16401639
{
@@ -1700,7 +1699,7 @@ static void drop_sysctl_table(struct ctl_table_header *header)
17001699

17011700
/**
17021701
* unregister_sysctl_table - unregister a sysctl table hierarchy
1703-
* @header: the header returned from register_sysctl_table
1702+
* @header: the header returned from register_sysctl or __register_sysctl_table
17041703
*
17051704
* Unregisters the sysctl table and all children. proc entries may not
17061705
* actually be removed until they are no longer used by anyone.

include/linux/sysctl.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ int proc_do_static_key(struct ctl_table *table, int write, void *buffer,
8989
size_t *lenp, loff_t *ppos);
9090

9191
/*
92-
* Register a set of sysctl names by calling register_sysctl_table
92+
* Register a set of sysctl names by calling register_sysctl
9393
* with an initialised array of struct ctl_table's. An entry with
9494
* NULL procname terminates the table. table->de will be
9595
* set up by the registration and need not be initialised in advance.
@@ -222,7 +222,6 @@ struct ctl_table_header *__register_sysctl_table(
222222
struct ctl_table_set *set,
223223
const char *path, struct ctl_table *table);
224224
struct ctl_table_header *register_sysctl(const char *path, struct ctl_table *table);
225-
struct ctl_table_header *register_sysctl_table(struct ctl_table * table);
226225
void unregister_sysctl_table(struct ctl_table_header * table);
227226

228227
extern int sysctl_init_bases(void);
@@ -257,11 +256,6 @@ static inline int __register_sysctl_base(struct ctl_table *base_table)
257256

258257
#define register_sysctl_base(table) __register_sysctl_base(table)
259258

260-
static inline struct ctl_table_header *register_sysctl_table(struct ctl_table * table)
261-
{
262-
return NULL;
263-
}
264-
265259
static inline void register_sysctl_init(const char *path, struct ctl_table *table)
266260
{
267261
}

0 commit comments

Comments
 (0)