Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2332409pxb; Thu, 11 Feb 2021 09:41:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhblcuSYRRnoNhP4C/RliYUG+vlqCsZnX4W/H2twgA+pV3YxGG2phUjLYWf0OEHikLZjj0 X-Received: by 2002:a17:906:c444:: with SMTP id ck4mr9818119ejb.156.1613065270099; Thu, 11 Feb 2021 09:41:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613065270; cv=none; d=google.com; s=arc-20160816; b=U8nTTm7EX88tP/ST6u/sbsmZYNNB1I8PiizNC8B2wvyUihJP9SehM8HE0HfvbUSbUj liKek56M2EQgkhR2JGT2HGqUMrSBZOhChdncCTiXMqFJkGHV0vO8ZQXQycV1qDpHKmC8 mBF7VPNfeSQ2YztIHP4mXat4z2tNATxIdlD9YIuzKX+RnR3d36rKQQwWa8TJ8pjsGMI9 taOqtEQ3rTNKHNGZPI18D5/MDY1JEtYqQ3gslr56hx19LWm8BNcM9lGnaReTwSwSeXnz Tf78t4Yc/thujovq/Ug8LtH4Vd74gJpDN4YSbzsrKxbmKLMpJgDNfbctiUcRF1AFSt78 SmCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=8q2NiznoWVHuUMkmRhG9I02yDUgNpmTMAt3YoQyfIGk=; b=syUrfJ71HquHGg4RoLeM47YEjJjlO4fmerZZhapXjZPOmE8zJSlHJAgM57/S8+7w0y VmEO2Tu9wNmgf4dJFYOcVDP9m7T8zJd3QT34sLXBhwKaw8rKY8aYIcpiOFm3ILohjmqd gisQM8+C/fgk5i1/Isgwz8DndwR7ujByj1o6BnwtbLhIy5udNDfaE9TTH7MvHIsNJt5T QRDEAj8GauzCm/s+T+pIchl4FHhgltCApU374woN36L3WtT3n8qfGbLq4SXfiaBFPAnJ +C0RzzIYvdRSLImIVupSlELi4sXMp2pObh3RJefF3asKPOTlhirPcbWLlCiF+/45EKiA 52ow== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g23si3950821eje.426.2021.02.11.09.40.45; Thu, 11 Feb 2021 09:41:10 -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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232495AbhBKRhz (ORCPT + 99 others); Thu, 11 Feb 2021 12:37:55 -0500 Received: from mail-oi1-f178.google.com ([209.85.167.178]:35583 "EHLO mail-oi1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230191AbhBKQk1 (ORCPT ); Thu, 11 Feb 2021 11:40:27 -0500 Received: by mail-oi1-f178.google.com with SMTP id l3so6778181oii.2; Thu, 11 Feb 2021 08:40:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8q2NiznoWVHuUMkmRhG9I02yDUgNpmTMAt3YoQyfIGk=; b=RGLHmA221z8aU7u1IS1sRT8yqYqIJMDyvqois51hPWANv4R8/5f8t0SUtFkqqM6eaz n7+sQ9TRINJMFq9C+S7DapFyzL/JbIUWQ3rf8G3jftUw9pwBozz+7vdwePQf2HV09xp9 xltSjFLp9grG2HobDHKMFU3vUGESdGToCREWE9aFIeoutP72Hc3eAB0J48nEHDQ7i4bJ GiwRk6HxzI2A6lyeQ4Xp2vwQ0csDP5mXp1O/MqpvbofZznXOjK4hPpxzsWRE2E2Cw8L1 gbQ5fcV7pUirTH2Zak2GGui2v2bdXm/FEYSmVmsVEIMWz6U+HMVPOLH4WEfJlud4raqX yUKw== X-Gm-Message-State: AOAM5334z8Lm7aGeMR7nZELnQOUvdIQzliaDjKOoEgY5xxPk6G3lOQe5 4a0wbt82usxum/k45o0pcO/Xql9s+VisfN51oR8= X-Received: by 2002:aca:3d85:: with SMTP id k127mr3459892oia.157.1613061585919; Thu, 11 Feb 2021 08:39:45 -0800 (PST) MIME-Version: 1.0 References: <20210210114320.3478-1-andriy.shevchenko@linux.intel.com> <3881654.NPl3a4M0kB@kreacher> <1946478.1QpZic6vku@kreacher> In-Reply-To: From: "Rafael J. Wysocki" Date: Thu, 11 Feb 2021 17:39:34 +0100 Message-ID: Subject: Re: [PATCH v1 7/7] ACPI: property: Allow counting a single value as an array of 1 element To: Andy Shevchenko Cc: "Rafael J. Wysocki" , "Rafael J. Wysocki" , ACPI Devel Maling List , Linux Kernel Mailing List , Len Brown , Calvin Johnson Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 11, 2021 at 4:42 PM Andy Shevchenko wrote: > > 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. Well, that's a bug in my patch. I thought that you would reorder the series to put the fix into the front of it, but I didn't really mean to rebase it on top of my patch. Sorry for the confusion. However, not that you have started to do it apparently, let me post that patch properly with all of the issues addressed. > 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. Well, the code has never worked as intended, so why don't we make "stable" work as intended too?