public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Stone <ahs3@redhat.com>
To: kbuild test robot <lkp@intel.com>
Cc: kbuild-all@01.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Jassi Brar <jassisinghbrar@gmail.com>,
	"Rafael J . Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>
Subject: Re: [PATCH 3/3] mailbox: ACPI: erroneous error message when parsing the ACPI PCCT
Date: Wed, 4 Apr 2018 15:12:22 -0600	[thread overview]
Message-ID: <24e06eb5-d23a-5619-b4ed-bc012b9bfbf8@redhat.com> (raw)
In-Reply-To: <201804050450.ecZCFiQT%fengguang.wu@intel.com>

On 04/04/2018 02:39 PM, kbuild test robot wrote:
> Hi Al,
> 
> Thank you for the patch! Perhaps something to improve:
> 
> [auto build test WARNING on pm/linux-next]
> [also build test WARNING on v4.16 next-20180404]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
> 
> url:    https://github.com/0day-ci/linux/commits/Al-Stone/ACPI-improve-function-documentation-for-acpi_parse_entries_array/20180404-151910
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
> 
> smatch warnings:
> drivers/mailbox/pcc.c:392 count_pcc_subspaces() warn: always true condition '(pcct_ss->header.type >= 0) => (0-255 >= 0)'
> 
> vim +392 drivers/mailbox/pcc.c
> 
>    374	
>    375	/*+
>    376	 *
>    377	 * count_pcc_subspaces -- Count the PCC subspaces that are not used in
>    378	 *		reduced hardware systems.
>    379	 * @header: Pointer to the ACPI subtable header under the PCCT.
>    380	 * @end: End of subtable entry.
>    381	 *
>    382	 * Return: 0 for Success, else errno.
>    383	 *
>    384	 * This gets called for each entry in the PCC table.
>    385	 */
>    386	static int count_pcc_subspaces(struct acpi_subtable_header *header,
>    387			const unsigned long end)
>    388	{
>    389		struct acpi_pcct_subspace *pcct_ss =
>    390					(struct acpi_pcct_subspace *) header;
>    391	
>  > 392		if ((pcct_ss->header.type >= ACPI_PCCT_TYPE_GENERIC_SUBSPACE) &&
>    393		    (pcct_ss->header.type <= ACPI_PCCT_TYPE_RESERVED) &&
>    394		    (pcct_ss->header.type != ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE) &&
>    395		    (pcct_ss->header.type !=
>    396					ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2)) {

Aha.  Yup, can be rewritten as:

	if ((pcct_ss->header.type <= ACPI_PCCT_TYPE_RESERVED) &&
	    (pcct_ss->header.type != ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE) &&
	    (pcct_ss->header.type !=
				ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2)) {

I will let this patch sit for a little while to see if there are any further
comments before sending out a v2.

>    397			pr_warn("PCCT count: useful subtype = %d\n",
>    398				pcct_ss->header.type);
>    399			return 0;
>    400		}
>    401		pr_warn("PCCT count: unwanted subtype = %d\n", pcct_ss->header.type);
>    402		return -EINVAL;
>    403	}
>    404	
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
> 


-- 
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Red Hat, Inc.
ahs3@redhat.com
-----------------------------------

      reply	other threads:[~2018-04-04 21:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-04  0:42 [PATCH 0/3] mailbox: ACPI: Remove incorrect error message about parsing PCCT Al Stone
2018-04-04  0:42 ` [PATCH 1/3] ACPI: improve function documentation for acpi_parse_entries_array() Al Stone
2018-04-04  0:42 ` [PATCH 2/3] ACPI: ensure acpi_parse_entries_array() does not access non-existent table data Al Stone
2018-04-04  0:42 ` [PATCH 3/3] mailbox: ACPI: erroneous error message when parsing the ACPI PCCT Al Stone
2018-04-04 20:39   ` kbuild test robot
2018-04-04 21:12     ` Al Stone [this message]

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=24e06eb5-d23a-5619-b4ed-bc012b9bfbf8@redhat.com \
    --to=ahs3@redhat.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=kbuild-all@01.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=rjw@rjwysocki.net \
    /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