Skip to contentSkip to conversation

drivers/acpi/cppc_acpi.c:1783:13-14: WARNING opportunity for max() (fwd)

PATCH New Julia Lawall 1 participant 1 message Dec 14, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 5/11 drivers/acpi/cppc_acpi.c:1783:13-14: WARNING opportunity for max() (fwd)

---------- Forwarded message ----------
Date: Fri, 15 Dec 2023 01:23:59 +0800
From: kernel test robot <[email protected]>
To: [email protected]
Cc: [email protected], Julia Lawall <[email protected]>
Subject: [vincent-guittot:sched/system-pressure 5/11]

    drivers/acpi/cppc_acpi.c:1783:13-14: WARNING opportunity for max()

BCC: [email protected]
CC: [email protected]
TO: Vincent Guittot <[email protected]>

Hi Vincent,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://git.linaro.org/people/vincent.guittot/kernel.git sched/system-pressure
head:   5844548bc216fd4d47bc8b20f0ff22ac4b14d48d
commit: 3c697464bdc4ede5507ebb0f43112b31cb07a3d9 [5/11] cpufreq/cppc: Move and rename cppc_cpufreq_{perf_to_khz|khz_to_perf}

:::::: branch date: 2 days ago
:::::: commit date: 3 days ago
config: x86_64-randconfig-102-20231214 (https://download.01.org/0day-ci/archive/20231215/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231215/[email protected]/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 <[email protected]>
| Reported-by: Julia Lawall <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/

cocci warnings: (new ones prefixed by >>)

Quoted 1 line
Quoted 1 line

drivers/acpi/cppc_acpi.c:1783:13-14: WARNING opportunity for max()

vim +1783 drivers/acpi/cppc_acpi.c

3c697464bdc4ed Vincent Guittot 2023-09-18  1772
3c697464bdc4ed Vincent Guittot 2023-09-18  1773  /* Callback function used to retrieve the max frequency from DMI */
3c697464bdc4ed Vincent Guittot 2023-09-18  1774  static void cppc_find_dmi_mhz(const struct dmi_header *dm, void *private)
3c697464bdc4ed Vincent Guittot 2023-09-18  1775  {
3c697464bdc4ed Vincent Guittot 2023-09-18  1776  	const u8 *dmi_data = (const u8 *)dm;
3c697464bdc4ed Vincent Guittot 2023-09-18  1777  	u16 *mhz = (u16 *)private;
3c697464bdc4ed Vincent Guittot 2023-09-18  1778
3c697464bdc4ed Vincent Guittot 2023-09-18  1779  	if (dm->type == DMI_ENTRY_PROCESSOR &&
3c697464bdc4ed Vincent Guittot 2023-09-18  1780  	    dm->length >= DMI_ENTRY_PROCESSOR_MIN_LENGTH) {
3c697464bdc4ed Vincent Guittot 2023-09-18  1781  		u16 val = (u16)get_unaligned((const u16 *)
3c697464bdc4ed Vincent Guittot 2023-09-18  1782  				(dmi_data + DMI_PROCESSOR_MAX_SPEED));
3c697464bdc4ed Vincent Guittot 2023-09-18 @1783  		*mhz = val > *mhz ? val : *mhz;
3c697464bdc4ed Vincent Guittot 2023-09-18  1784  	}
3c697464bdc4ed Vincent Guittot 2023-09-18  1785  }

3c697464bdc4ed Vincent Guittot 2023-09-18 1786

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