Hi Andy,

kernel test robot noticed the following build warnings:

[auto build test WARNING on rafael-pm/linux-next]
[also build test WARNING on rafael-pm/bleeding-edge linus/master v7.0-rc4 
next-20260316]
[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/Andy-Shevchenko/ACPI-processor-idle-Replace-strlcat-with-better-alternative/20260317-014800
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git 
linux-next
patch link:    
https://lore.kernel.org/r/20260316170158.1596857-1-andriy.shevchenko%40linux.intel.com
patch subject: [PATCH v1 1/1] ACPI: processor: idle: Replace strlcat() with 
better alternative
config: x86_64-rhel-9.4 
(https://download.01.org/0day-ci/archive/20260317/[email protected]/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): 
(https://download.01.org/0day-ci/archive/20260317/[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]>
| Closes: 
https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

   drivers/acpi/processor_idle.c: In function 'flatten_lpi_states':
>> drivers/acpi/processor_idle.c:1013:56: warning: 'snprintf' output may be 
>> truncated before the last format character [-Wformat-truncation=]
    1013 |         snprintf(result->desc, ACPI_CX_DESC_LEN, "%s+%s", 
local->desc, parent->desc);
         |                                                        ^
   In function 'combine_lpi_states',
       inlined from 'flatten_lpi_states' at 
drivers/acpi/processor_idle.c:1059:8:
   drivers/acpi/processor_idle.c:1013:9: note: 'snprintf' output 2 or more 
bytes (assuming 33) into a destination of size 32
    1013 |         snprintf(result->desc, ACPI_CX_DESC_LEN, "%s+%s", 
local->desc, parent->desc);
         |         
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/snprintf +1013 drivers/acpi/processor_idle.c

   984  
   985  /**
   986   * combine_lpi_states - combine local and parent LPI states to form a 
composite LPI state
   987   *
   988   * @local: local LPI state
   989   * @parent: parent LPI state
   990   * @result: composite LPI state
   991   */
   992  static bool combine_lpi_states(struct acpi_lpi_state *local,
   993                                 struct acpi_lpi_state *parent,
   994                                 struct acpi_lpi_state *result)
   995  {
   996          if (parent->entry_method == ACPI_CSTATE_INTEGER) {
   997                  if (!parent->address) /* 0 means autopromotable */
   998                          return false;
   999                  result->address = local->address + parent->address;
  1000          } else {
  1001                  result->address = parent->address;
  1002          }
  1003  
  1004          result->min_residency = max(local->min_residency, 
parent->min_residency);
  1005          result->wake_latency = local->wake_latency + 
parent->wake_latency;
  1006          result->enable_parent_state = parent->enable_parent_state;
  1007          result->entry_method = local->entry_method;
  1008  
  1009          result->flags = parent->flags;
  1010          result->arch_flags = parent->arch_flags;
  1011          result->index = parent->index;
  1012  
> 1013          snprintf(result->desc, ACPI_CX_DESC_LEN, "%s+%s", local->desc, 
> parent->desc);
  1014          return true;
  1015  }
  1016  

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

Reply via email to