diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-04-28 05:14:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 11:58:35 -0400 |
commit | 22af89aa0c0b4012a7431114a340efd3665a7617 (patch) | |
tree | 3da3b5645c8d58563744ad06166942080418625f /drivers/video/console | |
parent | 2ae09f0da1cd0c8c646edea2e68356e76789461c (diff) |
fbcon: replace mono_col macro with static inline
Use __u32 for max_len to match the declaration of length in the struct
fb_bitfield.
Suppresses sparse shadowed variable warnings from the nested max()
macros:
drivers/video/console/fbcon.h:130:8: warning: symbol '_x' shadows an earlier one
drivers/video/console/fbcon.h:130:8: originally declared here
drivers/video/console/fbcon.h:130:8: warning: symbol '_x' shadows an earlier one
drivers/video/console/fbcon.h:130:8: originally declared here
drivers/video/console/fbcon.h:130:8: warning: symbol '_y' shadows an earlier one
drivers/video/console/fbcon.h:130:8: originally declared here
[akpm@linux-foundation.org: fix constness]
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/console')
-rw-r--r-- | drivers/video/console/fbcon.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h index 3706307e70ed..0135e0395456 100644 --- a/drivers/video/console/fbcon.h +++ b/drivers/video/console/fbcon.h | |||
@@ -104,10 +104,14 @@ struct fbcon_ops { | |||
104 | #define attr_blink(s) \ | 104 | #define attr_blink(s) \ |
105 | ((s) & 0x8000) | 105 | ((s) & 0x8000) |
106 | 106 | ||
107 | #define mono_col(info) \ | 107 | |
108 | (~(0xfff << (max((info)->var.green.length, \ | 108 | static inline int mono_col(const struct fb_info *info) |
109 | max((info)->var.red.length, \ | 109 | { |
110 | (info)->var.blue.length)))) & 0xff) | 110 | __u32 max_len; |
111 | max_len = max(info->var.green.length, info->var.red.length); | ||
112 | max_len = max(info->var.blue.length, max_len); | ||
113 | return ~(0xfff << (max_len & 0xff)); | ||
114 | } | ||
111 | 115 | ||
112 | static inline int attr_col_ec(int shift, struct vc_data *vc, | 116 | static inline int attr_col_ec(int shift, struct vc_data *vc, |
113 | struct fb_info *info, int is_fg) | 117 | struct fb_info *info, int is_fg) |