public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Henning Schild <henning.schild@siemens.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>
Subject: [pdx86-platform-drivers-x86:platform-drivers-x86-simatic-ipc 3/7] drivers/platform/x86/simatic-ipc-batt.c:152:5: warning: no previous prototype for function 'simatic_ipc_batt_remove'
Date: Fri, 14 Jul 2023 20:01:46 +0800	[thread overview]
Message-ID: <202307141920.qk4FY4D6-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git platform-drivers-x86-simatic-ipc
head:   161c6512536100ae4919032ef6f1132621794e01
commit: ad90535e51415fb636054649b5894447a984496e [3/7] platform/x86: simatic-ipc: add CMOS battery monitoring
config: i386-randconfig-r021-20230714 (https://download.01.org/0day-ci/archive/20230714/202307141920.qk4FY4D6-lkp@intel.com/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project.git 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce: (https://download.01.org/0day-ci/archive/20230714/202307141920.qk4FY4D6-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/202307141920.qk4FY4D6-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/platform/x86/simatic-ipc-batt.c:152:5: warning: no previous prototype for function 'simatic_ipc_batt_remove' [-Wmissing-prototypes]
   int simatic_ipc_batt_remove(struct platform_device *pdev, struct gpiod_lookup_table *table)
       ^
   drivers/platform/x86/simatic-ipc-batt.c:152:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int simatic_ipc_batt_remove(struct platform_device *pdev, struct gpiod_lookup_table *table)
   ^
   static 
>> drivers/platform/x86/simatic-ipc-batt.c:159:5: warning: no previous prototype for function 'simatic_ipc_batt_probe' [-Wmissing-prototypes]
   int simatic_ipc_batt_probe(struct platform_device *pdev, struct gpiod_lookup_table *table)
       ^
   drivers/platform/x86/simatic-ipc-batt.c:159:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int simatic_ipc_batt_probe(struct platform_device *pdev, struct gpiod_lookup_table *table)
   ^
   static 
   2 warnings generated.


vim +/simatic_ipc_batt_remove +152 drivers/platform/x86/simatic-ipc-batt.c

   151	
 > 152	int simatic_ipc_batt_remove(struct platform_device *pdev, struct gpiod_lookup_table *table)
   153	{
   154		gpiod_remove_lookup_table(table);
   155		return 0;
   156	}
   157	EXPORT_SYMBOL_GPL(simatic_ipc_batt_remove);
   158	
 > 159	int simatic_ipc_batt_probe(struct platform_device *pdev, struct gpiod_lookup_table *table)
   160	{
   161		struct simatic_ipc_platform *plat;
   162		struct device *dev = &pdev->dev;
   163		struct device *hwmon_dev;
   164		int err;
   165	
   166		plat = pdev->dev.platform_data;
   167		priv.devmode = plat->devmode;
   168	
   169		switch (priv.devmode) {
   170		case SIMATIC_IPC_DEVICE_127E:
   171		case SIMATIC_IPC_DEVICE_227G:
   172		case SIMATIC_IPC_DEVICE_BX_39A:
   173		case SIMATIC_IPC_DEVICE_BX_21A:
   174			table->dev_id = dev_name(dev);
   175			gpiod_add_lookup_table(table);
   176			break;
   177		case SIMATIC_IPC_DEVICE_227E:
   178			goto nogpio;
   179		default:
   180			return -ENODEV;
   181		}
   182	
   183		priv.gpios[0] = devm_gpiod_get_index(dev, "CMOSBattery empty", 0, GPIOD_IN);
   184		if (IS_ERR(priv.gpios[0])) {
   185			err = PTR_ERR(priv.gpios[0]);
   186			priv.gpios[0] = NULL;
   187			goto out;
   188		}
   189		priv.gpios[1] = devm_gpiod_get_index(dev, "CMOSBattery low", 1, GPIOD_IN);
   190		if (IS_ERR(priv.gpios[1])) {
   191			err = PTR_ERR(priv.gpios[1]);
   192			priv.gpios[1] = NULL;
   193			goto out;
   194		}
   195	
   196		if (table->table[2].key) {
   197			priv.gpios[2] = devm_gpiod_get_index(dev, "CMOSBattery meter", 2, GPIOD_OUT_HIGH);
   198			if (IS_ERR(priv.gpios[2])) {
   199				err = PTR_ERR(priv.gpios[1]);
   200				priv.gpios[2] = NULL;
   201				goto out;
   202			}
   203		} else {
   204			priv.gpios[2] = NULL;
   205		}
   206	
   207	nogpio:
   208		hwmon_dev = devm_hwmon_device_register_with_info(dev, KBUILD_MODNAME,
   209								 &priv,
   210								 &simatic_ipc_batt_chip_info,
   211								 NULL);
   212		if (IS_ERR(hwmon_dev)) {
   213			err = PTR_ERR(hwmon_dev);
   214			goto out;
   215		}
   216	
   217		/* warn about aging battery even if userspace never reads hwmon */
   218		simatic_ipc_batt_read_value(dev);
   219	
   220		return 0;
   221	out:
   222		simatic_ipc_batt_remove(pdev, table);
   223	
   224		return err;
   225	}
   226	EXPORT_SYMBOL_GPL(simatic_ipc_batt_probe);
   227	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

             reply	other threads:[~2023-07-14 12:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-14 12:01 kernel test robot [this message]
2023-07-14 13:05 ` [pdx86-platform-drivers-x86:platform-drivers-x86-simatic-ipc 3/7] drivers/platform/x86/simatic-ipc-batt.c:152:5: warning: no previous prototype for function 'simatic_ipc_batt_remove' Hans de Goede
2023-07-17  7:38   ` Henning Schild

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202307141920.qk4FY4D6-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=henning.schild@siemens.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox