Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Stefan Binding <sbinding@opensource.cirrus.com>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>, Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>
Cc: alsa-devel@alsa-project.org, kbuild-all@lists.01.org,
	patches@opensource.cirrus.com,
	Stefan Binding <sbinding@opensource.cirrus.com>,
	linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: [PATCH v3 1/2] ACPI: utils: Add api to read _SUB from ACPI
Date: Tue, 28 Jun 2022 07:31:18 +0800	[thread overview]
Message-ID: <202206280722.5wvfmDeu-lkp@intel.com> (raw)
In-Reply-To: <20220627155138.807420-2-sbinding@opensource.cirrus.com>

Hi Stefan,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on rafael-pm/linux-next]
[also build test WARNING on broonie-sound/for-next linus/master v5.19-rc4 next-20220627]
[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]

url:    https://github.com/intel-lab-lkp/linux/commits/Stefan-Binding/Read-_SUB-from-ACPI-to-be-able-to-identify-firmware/20220627-235448
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: x86_64-defconfig (https://download.01.org/0day-ci/archive/20220628/202206280722.5wvfmDeu-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/7dd124b65442fd6622e7df2949795f735d8356be
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Stefan-Binding/Read-_SUB-from-ACPI-to-be-able-to-identify-firmware/20220627-235448
        git checkout 7dd124b65442fd6622e7df2949795f735d8356be
        # 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/acpi/

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 >>):

   In file included from drivers/acpi/utils.c:17:
   drivers/acpi/utils.c: In function 'acpi_get_subsystem_id':
>> drivers/acpi/utils.c:317:49: warning: format '%d' expects argument of type 'int', but argument 4 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]
     317 |                         acpi_handle_err(handle, "ACPI _SUB Length %d is Invalid\n",
         |                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     318 |                                         strlen(obj->string.pointer));
         |                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
         |                                         |
         |                                         size_t {aka long unsigned int}
   include/linux/acpi.h:1172:46: note: in definition of macro 'acpi_handle_err'
    1172 |         acpi_handle_printk(KERN_ERR, handle, fmt, ##__VA_ARGS__)
         |                                              ^~~
   drivers/acpi/utils.c:317:68: note: format string is defined here
     317 |                         acpi_handle_err(handle, "ACPI _SUB Length %d is Invalid\n",
         |                                                                   ~^
         |                                                                    |
         |                                                                    int
         |                                                                   %ld


vim +317 drivers/acpi/utils.c

   295	
   296	const char *acpi_get_subsystem_id(acpi_handle handle)
   297	{
   298		struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
   299		union acpi_object *obj;
   300		acpi_status status;
   301		const char *sub;
   302	
   303		status = acpi_evaluate_object(handle, METHOD_NAME__SUB, NULL, &buffer);
   304		if (ACPI_FAILURE(status)) {
   305			acpi_handle_debug(handle, "Reading ACPI _SUB failed: %#x\n", status);
   306			return ERR_PTR(-ENODATA);
   307		}
   308	
   309		obj = buffer.pointer;
   310		if (obj->type == ACPI_TYPE_STRING) {
   311			if (strlen(obj->string.pointer) < ACPI_MAX_SUB_BUF_SIZE &&
   312			    strlen(obj->string.pointer) > 0) {
   313				sub = kstrdup(obj->string.pointer, GFP_KERNEL);
   314				if (!sub)
   315					sub = ERR_PTR(-ENOMEM);
   316			} else {
 > 317				acpi_handle_err(handle, "ACPI _SUB Length %d is Invalid\n",
   318						strlen(obj->string.pointer));
   319				sub = ERR_PTR(-EINVAL);
   320			}
   321		} else {
   322			acpi_handle_warn(handle, "Warning ACPI _SUB did not return a string\n");
   323			sub = ERR_PTR(-EINVAL);
   324		}
   325	
   326		acpi_os_free(buffer.pointer);
   327	
   328		return sub;
   329	}
   330	EXPORT_SYMBOL_GPL(acpi_get_subsystem_id);
   331	

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

  reply	other threads:[~2022-06-27 23:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-27 15:51 [PATCH v3 0/2] Read _SUB from ACPI to be able to identify firmware Stefan Binding
2022-06-27 15:51 ` [PATCH v3 1/2] ACPI: utils: Add api to read _SUB from ACPI Stefan Binding
2022-06-27 23:31   ` kernel test robot [this message]
2022-06-28  0:12   ` kernel test robot
2022-06-27 15:51 ` [PATCH v3 2/2] ASoC: cs35l41: Read System Name from ACPI _SUB to identify firmware Stefan Binding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202206280722.5wvfmDeu-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kbuild-all@lists.01.org \
    --cc=lenb@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=rafael@kernel.org \
    --cc=sbinding@opensource.cirrus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox