Re: [pdx86-platform-drivers-x86:review-hans 59/65] drivers/platform/x86/toshiba_acpi.c:2937:9: warning: no previous prototype for 'toshiba_acpi_hwmon_is_visible'

From: Hans de Goede
Date: Fri Sep 09 2022 - 15:51:12 EST


Hi,

On 9/9/22 21:47, Arvid Norlander wrote:
> Hi,
>
> On 2022-09-09 21:19, kernel test robot wrote:
>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git review-hans
>> head: 79e8f8235a1686d0656b60cf72f7fda5530ee1cf
>> commit: b5f3665e82591d465357f4a69196f46b3d30e997 [59/65] platform/x86: toshiba_acpi: Add fan RPM reading (hwmon interface)
>> config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20220910/202209100300.LjCie4bn-lkp@xxxxxxxxx/config)
>> compiler: gcc-11 (Debian 11.3.0-5) 11.3.0
>> reproduce (this is a W=1 build):
>> # https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/commit/?id=b5f3665e82591d465357f4a69196f46b3d30e997
>> git remote add pdx86-platform-drivers-x86 https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git
>> git fetch --no-tags pdx86-platform-drivers-x86 review-hans
>> git checkout b5f3665e82591d465357f4a69196f46b3d30e997
>> # save the config file
>> mkdir build_dir && cp config build_dir/.config
>> make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/platform/
>>
>> If you fix the issue, kindly add following tag where applicable
>> Reported-by: kernel test robot <lkp@xxxxxxxxx>
>>
>> All warnings (new ones prefixed by >>):
>>
>>>> drivers/platform/x86/toshiba_acpi.c:2937:9: warning: no previous prototype for 'toshiba_acpi_hwmon_is_visible' [-Wmissing-prototypes]
>> 2937 | umode_t toshiba_acpi_hwmon_is_visible(const void *drvdata,
>> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>> drivers/platform/x86/toshiba_acpi.c:2944:5: warning: no previous prototype for 'toshiba_acpi_hwmon_read' [-Wmissing-prototypes]
>> 2944 | int toshiba_acpi_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
>> | ^~~~~~~~~~~~~~~~~~~~~~~
>>
>>
>> vim +/toshiba_acpi_hwmon_is_visible +2937 drivers/platform/x86/toshiba_acpi.c
>>
>> 2934
>> 2935 /* HWMON support for fan */
>> 2936 #if IS_ENABLED(CONFIG_HWMON)
>>> 2937 umode_t toshiba_acpi_hwmon_is_visible(const void *drvdata,
>> 2938 enum hwmon_sensor_types type,
>> 2939 u32 attr, int channel)
>> 2940 {
>> 2941 return 0444;
>> 2942 }
>> 2943
>>> 2944 int toshiba_acpi_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
>> 2945 u32 attr, int channel, long *val)
>
> Oops, clearly these are missing "static". Hans de Goede: Can you apply that
> fix locally easily, or should I send a patch? I must have forgotten to
> build with W=1.

I can write a fix for this and squash it into the commits in my review-hans branch,
actually i was just about to do that :)

So you can considered this fixed.

Regards,

hans



>
>> 2946 {
>> 2947 /*
>> 2948 * There is only a single channel and single attribute (for the
>> 2949 * fan) at this point.
>> 2950 * This can be replaced with more advanced logic in the future,
>> 2951 * should the need arise.
>> 2952 */
>> 2953 if (type == hwmon_fan && channel == 0 && attr == hwmon_fan_input) {
>> 2954 u32 value;
>> 2955 int ret;
>> 2956
>> 2957 ret = get_fan_rpm(toshiba_acpi, &value);
>> 2958 if (ret)
>> 2959 return ret;
>> 2960
>> 2961 *val = value;
>> 2962 return 0;
>> 2963 }
>> 2964 return -EOPNOTSUPP;
>> 2965 }
>> 2966
>>
>
> Best regards,
> Arvid Norlander
>