Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2301371pxb; Thu, 11 Feb 2021 09:01:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJyU3SQPVm7CKxRnWIXhXJSJh+WEiUSFGwwvxUAP3M0qQeNDEzA2MfYKBxPOwsAWwOkqQc/z X-Received: by 2002:aa7:c351:: with SMTP id j17mr9183420edr.261.1613062835960; Thu, 11 Feb 2021 09:00:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613062835; cv=none; d=google.com; s=arc-20160816; b=yyLh1LDi5AQCJuTg8tNW6OyafzajgMkyRgIH3zh9IwQvCBjBtpzRZZ9KeS9xmje5c2 wlcpwayB+8l0MM7d7e+ck02/CTV1GuHzRD905gs5rjCV9JeTcbCqh+Z8+VOLIP9dTRGN IYorMaO+vaNDcMczFPalOo8hWVcI2Vr1JbzBhEsY3J21DCIx3TVdnCnLqsrsbJeSWlbP k2IRXk4KA3LcQiQD7Yp74i3Q8oosBBetT1IRd/+eolnlb4QkIMVrh9aKTIX+Vbbq6Lyt hX1FpzeQCs9AJBw9GUevTXvfUFk2ypDivtmQAjsDGIwlkhzrvlin2X+VWWtLWCxoTNxm tMjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=OER4fkbC+k+Pl9TVpr5+HqB3clohNftVlsrr0P1MWug=; b=bRvB/MW/TKw8VJscSEt9XAzH3bRmIWpTEKTnkcz7DS+D9MeMN80YWDT9wFyWuoWbXf KauPktnpaeZAmETTI18HLu8lYn4B+iCB6twv53ZhT6zOJ5OjeFDeTYUXaZq7eu45wT9m rVAUr9iSr8TBdIF7jdYMO+tSYl+1xeyHnMvIAfP3vNGFa+CLtROptWlsxG3lBI7ixiaL Xe0WTwI96Fn35hDiuZdEpZDvZSbWurGwn+WvKBqv5vE5yZ/qyDrbu5olu9GKugdfGka9 AxQKBSNk1HzsgQ4Ky7HBcq6kL24pT7zN2FDcSLrCQZP2uBVrgwP4CH8aZRgrNRD9bW/f YuJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u14si4186237edx.321.2021.02.11.09.00.09; Thu, 11 Feb 2021 09:00:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232032AbhBKQ5d (ORCPT + 99 others); Thu, 11 Feb 2021 11:57:33 -0500 Received: from mga03.intel.com ([134.134.136.65]:52779 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230243AbhBKPoM (ORCPT ); Thu, 11 Feb 2021 10:44:12 -0500 IronPort-SDR: JpQupExjmq6mtb9pF/I915wBApfbGedsPOlt6XjSmXyo8Xm8HSeUpiQ6eeM4P4ZCl5dmEJWEpy D+gzr/MSvDAA== X-IronPort-AV: E=McAfee;i="6000,8403,9892"; a="182332443" X-IronPort-AV: E=Sophos;i="5.81,170,1610438400"; d="scan'208";a="182332443" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Feb 2021 07:42:22 -0800 IronPort-SDR: 1bj7VsNtsDJU38kaYGWQgyRAa6CpRn5nQBB9VLr6ny7kZ2w25e3QviKjulCGQKZj12/UeaVrrb jnrYHSKXgIYw== X-IronPort-AV: E=Sophos;i="5.81,170,1610438400"; d="scan'208";a="437156945" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Feb 2021 07:42:20 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lAE6k-004Fw6-16; Thu, 11 Feb 2021 17:42:18 +0200 Date: Thu, 11 Feb 2021 17:42:18 +0200 From: Andy Shevchenko To: "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" , ACPI Devel Maling List , Linux Kernel Mailing List , Len Brown , Calvin Johnson Subject: Re: [PATCH v1 7/7] ACPI: property: Allow counting a single value as an array of 1 element Message-ID: References: <20210210114320.3478-1-andriy.shevchenko@linux.intel.com> <3881654.NPl3a4M0kB@kreacher> <1946478.1QpZic6vku@kreacher> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 10, 2021 at 04:44:34PM +0100, Rafael J. Wysocki wrote: > On Wed, Feb 10, 2021 at 4:42 PM Andy Shevchenko > wrote: > > On Wed, Feb 10, 2021 at 04:01:16PM +0100, Rafael J. Wysocki wrote: > > > On Wed, Feb 10, 2021 at 3:48 PM Andy Shevchenko > > > wrote: > > > > On Wed, Feb 10, 2021 at 02:48:09PM +0100, Rafael J. Wysocki wrote: > > > > > On Wednesday, February 10, 2021 2:31:48 PM CET Rafael J. Wysocki wrote: > > > > > > On Wednesday, February 10, 2021 1:36:00 PM CET Rafael J. Wysocki wrote: > > > > > > > On Wed, Feb 10, 2021 at 12:51 PM Andy Shevchenko > > > > > > > wrote: ... > > > > > > > > - if (val && nval == 1) { > > > > > > > > + /* Try to read as a single value first */ > > > > > > > > + if (!val || nval == 1) { > > > > > > > > ret = acpi_data_prop_read_single(data, propname, proptype, val); > > > > > > > > > > > > > > This returns -EINVAL if val is NULL. > > > > > > > > Nope. That's why it's a patch 7. Patch 6 solves this. > > > > > > That's my point. Patch 7 should be the first one in the series. > > > > Ah, okay. Since you want this let me rebase. > > Thanks! I started rebasing and realised that your approach has swapped the error codes, i.e. if it's a single-value and it is, e.g., 16-bit wide, the u8 read will return 1, while it has to return -EOVERFLOW. If you prefer, I can move two patches to the beginning, so one will be a good prerequisite for this fix. And I'm still unsure about stable (Fixes tag is okay to me), because the counting never worked from the day 1. -- With Best Regards, Andy Shevchenko