Skip to content

Commit 75e0b94

Browse files
kjwinchestergregkh
authored andcommitted
vt: Fix warning: statement with no effect due to vt_kern.h
Using: gcc (GCC) 4.5.0 20100610 (prerelease) with CONFIG_CONSOLE_TRANSLATIONS=n, the following warnings are seen: drivers/char/vt_ioctl.c: In function ‘vt_ioctl’: drivers/char/vt_ioctl.c:1309:4: warning: statement with no effect drivers/char/vt.c: In function ‘vc_allocate’: drivers/char/vt.c:774:3: warning: statement with no effect drivers/video/console/vgacon.c: In function ‘vgacon_init’: drivers/video/console/vgacon.c:587:3: warning: statement with no effect drivers/video/console/vgacon.c: In function ‘vgacon_deinit’: drivers/video/console/vgacon.c:606:2: warning: statement with no effect drivers/video/console/fbcon.c: In function ‘fbcon_init’: drivers/video/console/fbcon.c:1087:3: warning: statement with no effect drivers/video/console/fbcon.c:1089:3: warning: statement with no effect drivers/video/console/fbcon.c: In function ‘fbcon_set_disp’: drivers/video/console/fbcon.c:1369:3: warning: statement with no effect drivers/video/console/fbcon.c:1371:3: warning: statement with no effect This is because several functions in include/linux/vt_kern.h are defined to (0). Convert them to static inline functions to silence the warnings and gain a bit of type safety. Signed-off-by: Kevin Winchester <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2b50d24 commit 75e0b94

File tree

1 file changed

+46
-11
lines changed

1 file changed

+46
-11
lines changed

include/linux/vt_kern.h

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,52 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc);
7676
#define vc_translate(vc, c) ((vc)->vc_translate[(c) | \
7777
((vc)->vc_toggle_meta ? 0x80 : 0)])
7878
#else
79-
#define con_set_trans_old(arg) (0)
80-
#define con_get_trans_old(arg) (-EINVAL)
81-
#define con_set_trans_new(arg) (0)
82-
#define con_get_trans_new(arg) (-EINVAL)
83-
#define con_clear_unimap(vc, ui) (0)
84-
#define con_set_unimap(vc, ct, list) (0)
85-
#define con_set_default_unimap(vc) (0)
86-
#define con_copy_unimap(d, s) (0)
87-
#define con_get_unimap(vc, ct, uct, list) (-EINVAL)
88-
#define con_free_unimap(vc) do { ; } while (0)
89-
#define con_protect_unimap(vc, rdonly) do { ; } while (0)
79+
static inline int con_set_trans_old(unsigned char __user *table)
80+
{
81+
return 0;
82+
}
83+
static inline int con_get_trans_old(unsigned char __user *table)
84+
{
85+
return -EINVAL;
86+
}
87+
static inline int con_set_trans_new(unsigned short __user *table)
88+
{
89+
return 0;
90+
}
91+
static inline int con_get_trans_new(unsigned short __user *table)
92+
{
93+
return -EINVAL;
94+
}
95+
static inline int con_clear_unimap(struct vc_data *vc, struct unimapinit *ui)
96+
{
97+
return 0;
98+
}
99+
static inline
100+
int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list)
101+
{
102+
return 0;
103+
}
104+
static inline
105+
int con_get_unimap(struct vc_data *vc, ushort ct, ushort __user *uct,
106+
struct unipair __user *list)
107+
{
108+
return -EINVAL;
109+
}
110+
static inline int con_set_default_unimap(struct vc_data *vc)
111+
{
112+
return 0;
113+
}
114+
static inline void con_free_unimap(struct vc_data *vc)
115+
{
116+
}
117+
static inline void con_protect_unimap(struct vc_data *vc, int rdonly)
118+
{
119+
}
120+
static inline
121+
int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc)
122+
{
123+
return 0;
124+
}
90125

91126
#define vc_translate(vc, c) (c)
92127
#endif

0 commit comments

Comments
 (0)