Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* Re: [PATCH 2/3] platform/x86: Battery charge mode in toshiba_acpi (sysfs)
       [not found] <20220828192920.805253-3-lkml@vorpal.se>
@ 2022-08-28 22:15 ` kernel test robot
  2022-08-28 22:44   ` Arvid Norlander
  2022-08-29 16:59   ` Nick Desaulniers
  0 siblings, 2 replies; 4+ messages in thread
From: kernel test robot @ 2022-08-28 22:15 UTC (permalink / raw)
  To: Arvid Norlander, platform-driver-x86, linux-pm
  Cc: llvm, kbuild-all, Sebastian Reichel, Hans de Goede, Azael Avalos,
	Arvid Norlander

Hi Arvid,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on 1c23f9e627a7b412978b4e852793c5e3c3efc555]

url:    https://github.com/intel-lab-lkp/linux/commits/Arvid-Norlander/platform-x86-Battery-charge-mode-in-toshiba_acpi/20220829-033110
base:   1c23f9e627a7b412978b4e852793c5e3c3efc555
config: x86_64-randconfig-a014-20220829 (https://download.01.org/0day-ci/archive/20220829/202208290605.gE9IGbxE-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/a85fa4a6b19ae082f6018a07da93db965fb5ba11
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Arvid-Norlander/platform-x86-Battery-charge-mode-in-toshiba_acpi/20220829-033110
        git checkout a85fa4a6b19ae082f6018a07da93db965fb5ba11
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/platform/x86/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/platform/x86/toshiba_acpi.c:2992:6: warning: variable 'status' set but not used [-Wunused-but-set-variable]
           int status;
               ^
   1 warning generated.


vim +/status +2992 drivers/platform/x86/toshiba_acpi.c

  2984	
  2985	
  2986	/* ACPI battery hooking */
  2987	static ssize_t charge_control_end_threshold_show(struct device *device,
  2988							 struct device_attribute *attr,
  2989							 char *buf)
  2990	{
  2991		int state;
> 2992		int status;
  2993	
  2994		if (toshiba_acpi == NULL) {
  2995			pr_err("Toshiba ACPI object invalid\n");
  2996			return -ENODEV;
  2997		}
  2998	
  2999		status = toshiba_battery_charge_mode_get(toshiba_acpi, &state);
  3000		if (state == 1)
  3001			return sprintf(buf, "80\n");
  3002		else
  3003			return sprintf(buf, "100\n");
  3004	}
  3005	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/3] platform/x86: Battery charge mode in toshiba_acpi (sysfs)
  2022-08-28 22:15 ` [PATCH 2/3] platform/x86: Battery charge mode in toshiba_acpi (sysfs) kernel test robot
@ 2022-08-28 22:44   ` Arvid Norlander
  2022-08-29  8:16     ` Miguel Ojeda
  2022-08-29 16:59   ` Nick Desaulniers
  1 sibling, 1 reply; 4+ messages in thread
From: Arvid Norlander @ 2022-08-28 22:44 UTC (permalink / raw)
  To: kernel test robot, platform-driver-x86, linux-pm
  Cc: llvm, kbuild-all, Sebastian Reichel, Hans de Goede, Azael Avalos

Hi,

On 2022-08-29 00:15, kernel test robot wrote:
> Hi Arvid,
> 
> Thank you for the patch! Perhaps something to improve:
> 
> [auto build test WARNING on 1c23f9e627a7b412978b4e852793c5e3c3efc555]

<snip>

> vim +/status +2992 drivers/platform/x86/toshiba_acpi.c
> 
>   2984	
>   2985	
>   2986	/* ACPI battery hooking */
>   2987	static ssize_t charge_control_end_threshold_show(struct device *device,
>   2988							 struct device_attribute *attr,
>   2989							 char *buf)
>   2990	{
>   2991		int state;
>> 2992		int status;

Will be fixed in the next version, it should be used. Waiting for human feedback too first.

It would be nice to see these warnings locally, anyone know how to turn them on?

>   2993	
>   2994		if (toshiba_acpi == NULL) {
>   2995			pr_err("Toshiba ACPI object invalid\n");
>   2996			return -ENODEV;
>   2997		}
>   2998	
>   2999		status = toshiba_battery_charge_mode_get(toshiba_acpi, &state);
>   3000		if (state == 1)
>   3001			return sprintf(buf, "80\n");
>   3002		else
>   3003			return sprintf(buf, "100\n");
>   3004	}
>   3005	
> 

Best regards,
Arvid Norlander

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/3] platform/x86: Battery charge mode in toshiba_acpi (sysfs)
  2022-08-28 22:44   ` Arvid Norlander
@ 2022-08-29  8:16     ` Miguel Ojeda
  0 siblings, 0 replies; 4+ messages in thread
From: Miguel Ojeda @ 2022-08-29  8:16 UTC (permalink / raw)
  To: Arvid Norlander
  Cc: kernel test robot, platform-driver-x86, linux-pm, llvm,
	kbuild-all, Sebastian Reichel, Hans de Goede, Azael Avalos

On Mon, Aug 29, 2022 at 12:50 AM Arvid Norlander <lkml@vorpal.se> wrote:
>
> It would be nice to see these warnings locally, anyone know how to turn them on?

Compiling with W=1 (and possibly with Clang) should show them. Or
doesn't that work for you?

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/3] platform/x86: Battery charge mode in toshiba_acpi (sysfs)
  2022-08-28 22:15 ` [PATCH 2/3] platform/x86: Battery charge mode in toshiba_acpi (sysfs) kernel test robot
  2022-08-28 22:44   ` Arvid Norlander
@ 2022-08-29 16:59   ` Nick Desaulniers
  1 sibling, 0 replies; 4+ messages in thread
From: Nick Desaulniers @ 2022-08-29 16:59 UTC (permalink / raw)
  To: kernel test robot
  Cc: Arvid Norlander, platform-driver-x86, linux-pm, llvm, kbuild-all,
	Sebastian Reichel, Hans de Goede, Azael Avalos

On Sun, Aug 28, 2022 at 3:16 PM kernel test robot <lkp@intel.com> wrote:
>
> Hi Arvid,
>
> Thank you for the patch! Perhaps something to improve:
>
> [auto build test WARNING on 1c23f9e627a7b412978b4e852793c5e3c3efc555]
>
> url:    https://github.com/intel-lab-lkp/linux/commits/Arvid-Norlander/platform-x86-Battery-charge-mode-in-toshiba_acpi/20220829-033110
> base:   1c23f9e627a7b412978b4e852793c5e3c3efc555
> config: x86_64-randconfig-a014-20220829 (https://download.01.org/0day-ci/archive/20220829/202208290605.gE9IGbxE-lkp@intel.com/config)

Note: this was from a randconfig; it's highly likely you need this
funky config to repro.  ^ should be the link to the config.

-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-29 17:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20220828192920.805253-3-lkml@vorpal.se>
2022-08-28 22:15 ` [PATCH 2/3] platform/x86: Battery charge mode in toshiba_acpi (sysfs) kernel test robot
2022-08-28 22:44   ` Arvid Norlander
2022-08-29  8:16     ` Miguel Ojeda
2022-08-29 16:59   ` Nick Desaulniers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox