diff mbox series

[2/3] video/cmdline: Hide __video_get_options() behind CONFIG_FB_CORE

Message ID 20240115100939.21562-3-tzimmermann@suse.de (mailing list archive)
State Superseded
Headers show
Series video: Simplify Kconfig options | expand

Commit Message

Thomas Zimmermann Jan. 15, 2024, 9:54 a.m. UTC
The function __video_get_options() only exists for compatibility
with old fbdev drivers that cannot be refactored easily. Hide it
behind CONFIG_FB_CORE.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/video/cmdline.c | 2 ++
 include/video/cmdline.h | 2 ++
 2 files changed, 4 insertions(+)

Comments

kernel test robot Jan. 17, 2024, 9:52 p.m. UTC | #1
Hi Thomas,

kernel test robot noticed the following build errors:

[auto build test ERROR on 05b317e8457c8e2bd1a797c9440ec07b7f341584]

url:    https://github.com/intel-lab-lkp/linux/commits/Thomas-Zimmermann/video-cmdline-Introduce-CONFIG_VIDEO-for-video-parameter/20240115-181419
base:   05b317e8457c8e2bd1a797c9440ec07b7f341584
patch link:    https://lore.kernel.org/r/20240115100939.21562-3-tzimmermann%40suse.de
patch subject: [PATCH 2/3] video/cmdline: Hide __video_get_options() behind CONFIG_FB_CORE
config: i386-randconfig-011-20240118 (https://download.01.org/0day-ci/archive/20240118/202401180531.K8mdBrAu-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240118/202401180531.K8mdBrAu-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401180531.K8mdBrAu-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/video/fbdev/core/fb_cmdline.c: In function 'fb_get_options':
>> drivers/video/fbdev/core/fb_cmdline.c:45:19: error: implicit declaration of function '__video_get_options'; did you mean 'video_get_options'? [-Werror=implicit-function-declaration]
      45 |         enabled = __video_get_options(name, &options, is_of);
         |                   ^~~~~~~~~~~~~~~~~~~
         |                   video_get_options
   cc1: some warnings being treated as errors


vim +45 drivers/video/fbdev/core/fb_cmdline.c

367221793d4796 Thomas Zimmermann 2023-02-09  23  
ea6763c104c93a Daniel Vetter     2014-08-06  24  /**
ea6763c104c93a Daniel Vetter     2014-08-06  25   * fb_get_options - get kernel boot parameters
ea6763c104c93a Daniel Vetter     2014-08-06  26   * @name:   framebuffer name as it would appear in
ea6763c104c93a Daniel Vetter     2014-08-06  27   *          the boot parameter line
ea6763c104c93a Daniel Vetter     2014-08-06  28   *          (video=<name>:<options>)
ea6763c104c93a Daniel Vetter     2014-08-06  29   * @option: the option will be stored here
ea6763c104c93a Daniel Vetter     2014-08-06  30   *
73ce73c30ba9ae Thomas Zimmermann 2023-02-09  31   * The caller owns the string returned in @option and is
73ce73c30ba9ae Thomas Zimmermann 2023-02-09  32   * responsible for releasing the memory.
73ce73c30ba9ae Thomas Zimmermann 2023-02-09  33   *
ea6763c104c93a Daniel Vetter     2014-08-06  34   * NOTE: Needed to maintain backwards compatibility
ea6763c104c93a Daniel Vetter     2014-08-06  35   */
ea6763c104c93a Daniel Vetter     2014-08-06  36  int fb_get_options(const char *name, char **option)
ea6763c104c93a Daniel Vetter     2014-08-06  37  {
93604a5ade3a02 Thomas Zimmermann 2023-02-09  38  	const char *options = NULL;
93604a5ade3a02 Thomas Zimmermann 2023-02-09  39  	bool is_of = false;
93604a5ade3a02 Thomas Zimmermann 2023-02-09  40  	bool enabled;
cedaf7cddd7339 Thomas Zimmermann 2023-02-09  41  
93604a5ade3a02 Thomas Zimmermann 2023-02-09  42  	if (name)
93604a5ade3a02 Thomas Zimmermann 2023-02-09  43  		is_of = strncmp(name, "offb", 4);
ea6763c104c93a Daniel Vetter     2014-08-06  44  
93604a5ade3a02 Thomas Zimmermann 2023-02-09 @45  	enabled = __video_get_options(name, &options, is_of);
diff mbox series

Patch

diff --git a/drivers/video/cmdline.c b/drivers/video/cmdline.c
index d3d257489c3d..4eeafe7f5943 100644
--- a/drivers/video/cmdline.c
+++ b/drivers/video/cmdline.c
@@ -80,6 +80,7 @@  const char *video_get_options(const char *name)
 }
 EXPORT_SYMBOL(video_get_options);
 
+#if defined(CONFIG_FB_CORE)
 bool __video_get_options(const char *name, const char **options, bool is_of)
 {
 	bool enabled = true;
@@ -96,6 +97,7 @@  bool __video_get_options(const char *name, const char **options, bool is_of)
 	return enabled;
 }
 EXPORT_SYMBOL(__video_get_options);
+#endif
 
 /*
  * Process command line options for video adapters. This function is
diff --git a/include/video/cmdline.h b/include/video/cmdline.h
index 77292d1d6173..e0712deb842c 100644
--- a/include/video/cmdline.h
+++ b/include/video/cmdline.h
@@ -7,7 +7,9 @@ 
 
 const char *video_get_options(const char *name);
 
+#if defined(CONFIG_FB_CORE)
 /* exported for compatibility with fbdev; don't use in new code */
 bool __video_get_options(const char *name, const char **option, bool is_of);
+#endif
 
 #endif