Re: [PATCH 3/9] platform/x86: asus-wmi: add macros and expose min/max sysfs for ppt tunables

From: kernel test robot
Date: Tue Jun 04 2024 - 01:15:50 EST


Hi Luke,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.10-rc2 next-20240603]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Luke-D-Jones/platform-x86-asus-wmi-add-debug-print-in-more-key-places/20240528-094139
base: linus/master
patch link: https://lore.kernel.org/r/20240528013626.14066-4-luke%40ljones.dev
patch subject: [PATCH 3/9] platform/x86: asus-wmi: add macros and expose min/max sysfs for ppt tunables
config: x86_64-randconfig-006-20240604 (https://download.01.org/0day-ci/archive/20240604/202406041330.25g44UcT-lkp@xxxxxxxxx/config)
compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240604/202406041330.25g44UcT-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406041330.25g44UcT-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

drivers/platform/x86/asus-wmi.c: In function 'init_rog_tunables':
>> drivers/platform/x86/asus-wmi.c:4508:13: warning: argument 1 null where non-null expected [-Wnonnull]
4508 | if (strstr(product, "GA402R")) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/bitmap.h:13,
from include/linux/cpumask.h:13,
from include/linux/smp.h:13,
from include/linux/lockdep.h:14,
from include/linux/spinlock.h:63,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:7,
from include/linux/slab.h:16,
from include/linux/resource_ext.h:11,
from include/linux/acpi.h:13,
from drivers/platform/x86/asus-wmi.c:16:
include/linux/string.h:190:15: note: in a call to function 'strstr' declared 'nonnull'
190 | extern char * strstr(const char *, const char *);
| ^~~~~~
drivers/platform/x86/asus-wmi.c:4510:20: warning: argument 1 null where non-null expected [-Wnonnull]
4510 | } else if (strstr(product, "13QY")) {
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/string.h:190:15: note: in a call to function 'strstr' declared 'nonnull'
190 | extern char * strstr(const char *, const char *);
| ^~~~~~
drivers/platform/x86/asus-wmi.c:4512:20: warning: argument 1 null where non-null expected [-Wnonnull]
4512 | } else if (strstr(product, "X13")) {
| ^~~~~~~~~~~~~~~~~~~~~~
include/linux/string.h:190:15: note: in a call to function 'strstr' declared 'nonnull'
190 | extern char * strstr(const char *, const char *);
| ^~~~~~
drivers/platform/x86/asus-wmi.c:4515:20: warning: argument 1 null where non-null expected [-Wnonnull]
4515 | } else if (strstr(product, "RC71")) {
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/string.h:190:15: note: in a call to function 'strstr' declared 'nonnull'
190 | extern char * strstr(const char *, const char *);
| ^~~~~~
drivers/platform/x86/asus-wmi.c:4518:20: warning: argument 1 null where non-null expected [-Wnonnull]
4518 | } else if (strstr(product, "G814")
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/string.h:190:15: note: in a call to function 'strstr' declared 'nonnull'
190 | extern char * strstr(const char *, const char *);
| ^~~~~~
drivers/platform/x86/asus-wmi.c:4519:20: warning: argument 1 null where non-null expected [-Wnonnull]
4519 | || strstr(product, "G614")
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/string.h:190:15: note: in a call to function 'strstr' declared 'nonnull'
190 | extern char * strstr(const char *, const char *);
| ^~~~~~
drivers/platform/x86/asus-wmi.c:4520:20: warning: argument 1 null where non-null expected [-Wnonnull]
4520 | || strstr(product, "G834")
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/string.h:190:15: note: in a call to function 'strstr' declared 'nonnull'
190 | extern char * strstr(const char *, const char *);
| ^~~~~~
drivers/platform/x86/asus-wmi.c:4521:20: warning: argument 1 null where non-null expected [-Wnonnull]
4521 | || strstr(product, "G634")) {
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/string.h:190:15: note: in a call to function 'strstr' declared 'nonnull'
190 | extern char * strstr(const char *, const char *);
| ^~~~~~
drivers/platform/x86/asus-wmi.c:4523:20: warning: argument 1 null where non-null expected [-Wnonnull]
4523 | } else if (strstr(product, "GA402X")
| ^~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/string.h:190:15: note: in a call to function 'strstr' declared 'nonnull'
190 | extern char * strstr(const char *, const char *);
| ^~~~~~
drivers/platform/x86/asus-wmi.c:4524:20: warning: argument 1 null where non-null expected [-Wnonnull]
4524 | || strstr(product, "GA403")
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/string.h:190:15: note: in a call to function 'strstr' declared 'nonnull'
190 | extern char * strstr(const char *, const char *);
| ^~~~~~
drivers/platform/x86/asus-wmi.c:4525:20: warning: argument 1 null where non-null expected [-Wnonnull]
4525 | || strstr(product, "FA507N")
| ^~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/string.h:190:15: note: in a call to function 'strstr' declared 'nonnull'
190 | extern char * strstr(const char *, const char *);
| ^~~~~~
drivers/platform/x86/asus-wmi.c:4526:20: warning: argument 1 null where non-null expected [-Wnonnull]
4526 | || strstr(product, "FA507X")
| ^~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/string.h:190:15: note: in a call to function 'strstr' declared 'nonnull'
190 | extern char * strstr(const char *, const char *);
| ^~~~~~
drivers/platform/x86/asus-wmi.c:4527:20: warning: argument 1 null where non-null expected [-Wnonnull]
4527 | || strstr(product, "FA707N")
| ^~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/string.h:190:15: note: in a call to function 'strstr' declared 'nonnull'
190 | extern char * strstr(const char *, const char *);
| ^~~~~~
drivers/platform/x86/asus-wmi.c:4528:20: warning: argument 1 null where non-null expected [-Wnonnull]
4528 | || strstr(product, "FA707X")) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/string.h:190:15: note: in a call to function 'strstr' declared 'nonnull'
190 | extern char * strstr(const char *, const char *);
| ^~~~~~
drivers/platform/x86/asus-wmi.c:4532:13: warning: argument 1 null where non-null expected [-Wnonnull]
4532 | if (strstr(product, "GZ301ZE"))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/string.h:190:15: note: in a call to function 'strstr' declared 'nonnull'
190 | extern char * strstr(const char *, const char *);
| ^~~~~~


vim +4508 drivers/platform/x86/asus-wmi.c

4491
4492 /* Set up the min/max and defaults for ROG tunables */
4493 static void init_rog_tunables(struct asus_wmi *asus)
4494 {
4495 const char *product;
4496 u32 max_boost = NVIDIA_BOOST_MAX;
4497 u32 cpu_default = PPT_CPU_LIMIT_DEFAULT;
4498 u32 cpu_max = PPT_CPU_LIMIT_MAX;
4499 u32 platform_default = PPT_PLATFORM_DEFAULT;
4500 u32 platform_max = PPT_PLATFORM_MAX;
4501
4502 /*
4503 * ASUS product_name contains everything required, e.g,
4504 * "ROG Flow X16 GV601VV_GV601VV_00185149B"
4505 */
4506 product = dmi_get_system_info(DMI_PRODUCT_NAME);
4507
> 4508 if (strstr(product, "GA402R")) {
4509 cpu_default = 125;
4510 } else if (strstr(product, "13QY")) {
4511 cpu_max = 250;
4512 } else if (strstr(product, "X13")) {
4513 cpu_max = 75;
4514 cpu_default = 50;
4515 } else if (strstr(product, "RC71")) {
4516 cpu_max = 50;
4517 cpu_default = 30;
4518 } else if (strstr(product, "G814")
4519 || strstr(product, "G614")
4520 || strstr(product, "G834")
4521 || strstr(product, "G634")) {
4522 cpu_max = 175;
4523 } else if (strstr(product, "GA402X")
4524 || strstr(product, "GA403")
4525 || strstr(product, "FA507N")
4526 || strstr(product, "FA507X")
4527 || strstr(product, "FA707N")
4528 || strstr(product, "FA707X")) {
4529 cpu_max = 90;
4530 }
4531
4532 if (strstr(product, "GZ301ZE"))
4533 max_boost = 5;
4534 else if (strstr(product, "FX507ZC4"))
4535 max_boost = 15;
4536 else if (strstr(product, "GU605"))
4537 max_boost = 20;
4538
4539 /* ensure defaults for tunables */
4540 asus->rog_tunables.cpu_default = cpu_default;
4541 asus->rog_tunables.cpu_max = cpu_max;
4542
4543 asus->rog_tunables.platform_default = platform_default;
4544 asus->rog_tunables.platform_max = platform_max;
4545
4546 asus->rog_tunables.ppt_pl1_spl = cpu_default;
4547 asus->rog_tunables.ppt_pl2_sppt = cpu_default;
4548 asus->rog_tunables.ppt_apu_sppt = cpu_default;
4549
4550 asus->rog_tunables.ppt_platform_sppt = platform_default;
4551 asus->rog_tunables.ppt_fppt = platform_default;
4552
4553 asus->rog_tunables.nv_boost_default = NVIDIA_BOOST_MAX;
4554 asus->rog_tunables.nv_boost_max = max_boost;
4555 asus->rog_tunables.nv_dynamic_boost = NVIDIA_BOOST_MIN;
4556
4557 asus->rog_tunables.nv_temp_default = NVIDIA_TEMP_MAX;
4558 asus->rog_tunables.nv_temp_max = NVIDIA_TEMP_MAX;
4559 asus->rog_tunables.nv_temp_target = NVIDIA_TEMP_MIN;
4560

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