Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fb: make fp_get_options name argument const

drm_get_connector_name now returns a const value, which causes the following
compilation warning:

drivers/gpu/drm/drm_fb_helper.c: In function ‘drm_fb_helper_parse_command_line’:
drivers/gpu/drm/drm_fb_helper.c:127:3: warning: passing argument 1 of ‘fb_get_options’ discards ‘const’ qualifier from pointer target type [enabled by default]
In file included from drivers/gpu/drm/drm_fb_helper.c:35:0:
include/linux/fb.h:627:12: note: expected ‘char *’ but argument is of type ‘const char *’

As fb_get_options uses its name argument as read only, make it const. This
fixes the aforementioned compilation warning.

Signed-off-by: Vincent Stehlé <vincent.stehle@freescale.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: trivial@kernel.org
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

authored by

Vincent Stehlé and committed by
Jean-Christophe PLAGNIOL-VILLARD
a66e62ae baf9d52c

+2 -2
+1 -1
drivers/video/fbmem.c
··· 1881 1881 * 1882 1882 * NOTE: Needed to maintain backwards compatibility 1883 1883 */ 1884 - int fb_get_options(char *name, char **option) 1884 + int fb_get_options(const char *name, char **option) 1885 1885 { 1886 1886 char *opt, *options = NULL; 1887 1887 int retval = 0;
+1 -1
include/linux/fb.h
··· 624 624 extern void fb_set_suspend(struct fb_info *info, int state); 625 625 extern int fb_get_color_depth(struct fb_var_screeninfo *var, 626 626 struct fb_fix_screeninfo *fix); 627 - extern int fb_get_options(char *name, char **option); 627 + extern int fb_get_options(const char *name, char **option); 628 628 extern int fb_new_modelist(struct fb_info *info); 629 629 630 630 extern struct fb_info *registered_fb[FB_MAX];