Skip to content

Commit da2bdf9

Browse files
RoelKluintorvalds
authored andcommitted
Make various things static
Building an allnoconfig kernel, sparse asked whether these could be static, so I checked, and they are only used in the file where they are declared. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 9a8d5bb commit da2bdf9

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

‎drivers/char/pty.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
/* These are global because they are accessed in tty_io.c */
3434
#ifdef CONFIG_UNIX98_PTYS
35-
struct tty_driver *ptm_driver;
35+
static struct tty_driver *ptm_driver;
3636
static struct tty_driver *pts_driver;
3737
#endif
3838

‎drivers/char/vt.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,8 +969,7 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int rows)
969969
* Takes the console sem and the called methods then take the tty
970970
* termios_mutex and the tty ctrl_lock in that order.
971971
*/
972-
973-
int vt_resize(struct tty_struct *tty, struct winsize *ws)
972+
static int vt_resize(struct tty_struct *tty, struct winsize *ws)
974973
{
975974
struct vc_data *vc = tty->driver_data;
976975
int ret;

‎drivers/firmware/memmap.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ struct memmap_attribute {
5656
ssize_t (*show)(struct firmware_map_entry *entry, char *buf);
5757
};
5858

59-
struct memmap_attribute memmap_start_attr = __ATTR_RO(start);
60-
struct memmap_attribute memmap_end_attr = __ATTR_RO(end);
61-
struct memmap_attribute memmap_type_attr = __ATTR_RO(type);
59+
static struct memmap_attribute memmap_start_attr = __ATTR_RO(start);
60+
static struct memmap_attribute memmap_end_attr = __ATTR_RO(end);
61+
static struct memmap_attribute memmap_type_attr = __ATTR_RO(type);
6262

6363
/*
6464
* These are default attributes that are added for every memmap entry.

0 commit comments

Comments
 (0)