Make static
Subsystems (7)
PATCH 1/1 Make static
Make static
---
Building an allnoconfig, sparse asked whether these could be static, so I checked, and they are only used in the file where they are declared. This means that they can be static, am I forgetting something? This was build and checkpatch tested.
arch/x86/boot/video-bios.c | 4 ++-- arch/x86/boot/video-vesa.c | 4 ++-- arch/x86/kernel/xsave.c | 2 +- block/blk-softirq.c | 2 +- drivers/char/pty.c | 2 +- drivers/char/tty_io.c | 2 +- drivers/char/vt.c | 2 +- drivers/firmware/memmap.c | 6 +++--- kernel/irq/proc.c | 2 +- kernel/printk.c | 2 +- mm/page_alloc.c | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-)
arch/x86/boot/video-bios.c +2 -2
@@ -17,7 +17,7 @@#include "boot.h" #include "video.h" -__videocard video_bios; +static __videocard video_bios;/* Set a conventional BIOS mode */ static int set_bios_mode (u8 mode);
@@ -119,7 +119,7 @@ static int bios_probe(void)return nmodes; } -__videocard video_bios = +static __videocard video_bios = { .card_name ="BIOS" , .probe = bios_probe,
arch/x86/boot/video-vesa.c +2 -2
@@ -20,7 +20,7 @@static struct vesa_general_info vginfo;static struct vesa_mode_info vminfo; -__videocard video_vesa; +static __videocard video_vesa;#ifndef _WAKEUPstatic void vesa_store_mode_params_graphics (void );
@@ -293,7 +293,7 @@ void vesa_store_edid(void)#endif /* not _WAKEUP */ -__videocard video_vesa = +static __videocard video_vesa = { .card_name ="VESA" , .probe = vesa_probe,
arch/x86/kernel/xsave.c +1 -1
@@ -248,7 +248,7 @@ clear:* This will be saved when ever the FP and extended state context is * saved on the user stack during the signal handler delivery to the user. */ -void prepare_fx_sw_frame (void ) +static void prepare_fx_sw_frame (void ) {int size_extended = (xstate_size -sizeof (struct i387_fxsave_struct )) +FP_XSTATE_MAGIC2_SIZE ;
block/blk-softirq.c +1 -1
@@ -161,7 +161,7 @@ void blk_complete_request(struct request *req) }EXPORT_SYMBOL (blk_complete_request); -__init int blk_softirq_init (void ) +static __init int blk_softirq_init (void ) {int i;
drivers/char/pty.c +1 -1
@@ -34,7 +34,7 @@/* These are global because they are accessed in tty_io.c */ #ifdef CONFIG_UNIX98_PTYS -struct tty_driver *ptm_driver; +static struct tty_driver *ptm_driver;static struct tty_driver *pts_driver;#endif
drivers/char/tty_io.c +1 -1
@@ -1213,7 +1213,7 @@ static void tty_line_name(struct tty_driver *driver, int index, char *p)* be held until the 'fast-open' is also done. Will change once we * have refcounting in the driver and per driver locking */ -struct tty_struct *tty_driver_lookup_tty (struct tty_driver *driver, +static struct tty_struct *tty_driver_lookup_tty (struct tty_driver *driver,struct inode *inode,int idx) {struct tty_struct *tty;
drivers/char/vt.c +1 -1
@@ -971,7 +971,7 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int rows)* termios_mutex and the tty ctrl_lock in that order. */ -int vt_resize (struct tty_struct *tty,struct tty_struct *real_tty, +static int vt_resize (struct tty_struct *tty,struct tty_struct *real_tty,struct winsize *ws) {struct vc_data *vc = tty->driver_data;
drivers/firmware/memmap.c +3 -3
@@ -56,9 +56,9 @@ struct memmap_attribute {ssize_t (*show)(struct firmware_map_entry *entry,char *buf); }; -struct memmap_attribute memmap_start_attr =__ATTR_RO (start); -struct memmap_attribute memmap_end_attr =__ATTR_RO (end); -struct memmap_attribute memmap_type_attr =__ATTR_RO (type); +static struct memmap_attribute memmap_start_attr =__ATTR_RO (start); +static struct memmap_attribute memmap_end_attr =__ATTR_RO (end); +static struct memmap_attribute memmap_type_attr =__ATTR_RO (type);/* * These are default attributes that are added for every memmap entry.
kernel/irq/proc.c +1 -1
@@ -220,7 +220,7 @@ void unregister_handler_proc(unsigned int irq, struct irqaction *action) } } -void register_default_affinity_proc (void ) +static void register_default_affinity_proc (void ) {#ifdef CONFIG_SMP proc_create("irq/default_smp_affinity", 0600, NULL,
kernel/printk.c +1 -1
@@ -243,7 +243,7 @@ static int log_buf_get_len(void)/* * Copy a range of characters from the log buffer. */ -int log_buf_copy (char *dest,int idx,int len) +static int log_buf_copy (char *dest,int idx,int len) {int ret, max;bool took_lock = false;
mm/page_alloc.c +1 -1
@@ -4298,7 +4298,7 @@ void setup_per_zone_pages_min(void)* 1TB 101 10GB * 10TB 320 32GB */ -void setup_per_zone_inactive_ratio (void ) +static void setup_per_zone_inactive_ratio (void ) {struct zone *zone;
Ingo Molnar
AppliedQuoted 9 lines · roel kluin
Make static
Signed-off-by Roel Kluin <[email protected]>---
Building an allnoconfig, sparse asked whether these could be static, so I checked, and they are only used in the file where they are declared. This means that they can be static, am I forgetting something? This was build and checkpatch tested.
yeah, it's correct!
Quoted 3 lines
arch/x86/boot/video-bios.c | 4 ++-- arch/x86/boot/video-vesa.c | 4 ++-- arch/x86/kernel/xsave.c | 2 +-
i've applied these bits to tip/x86/urgent,
Quoted 1 line
kernel/irq/proc.c | 2 +-
this bit to tip/irq/urgent,
Quoted 1 line
kernel/printk.c | 2 +-
and this bit to tip/core/urgent.
Thanks Roel,
Ingo
Quoted 3 lines
Building an allnoconfig, sparse asked whether these could be static, so I checked, and they are only used in the file where they are declared. This means that they can be static, am I forgetting something? This was build and checkpatch tested.
The tty ones look correct. The tty_io one is already fixed (Jason beat you to it). The pty one is a result of some code tidying and correct as is the vt one. I'll merge the vt/pty bits
Alan