Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp2897802rdb; Tue, 26 Dec 2023 08:33:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGmCEAL+XM/zLytLfvcou0v8vA05aqa/4kkNs0L575S/3XT0FO3gRcEuHzqKR0oTM+nxUhs X-Received: by 2002:a17:902:c791:b0:1d0:af43:9354 with SMTP id w17-20020a170902c79100b001d0af439354mr6547753pla.100.1703608418031; Tue, 26 Dec 2023 08:33:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703608418; cv=none; d=google.com; s=arc-20160816; b=F6jSTikwAlqyanfRs7gHeaLBjpup3H+cx1ZvoKSpLKfzYzKjPYr4HWPmGVnNEWZ0kM +W06n8xnLtdcF0Z5uYeDqaqST8+2copotPvSudekWmLEadbHvAth5fDpICjXElMQpAXG 470O/tkE6DLXxZyBSNj0wf/Or3hOaNDs1wFqCg0m+Ad9nQ+FJrycLeVnQZts/6bCa8rS /Z3Lq+AIR1aUcJD0dJ4rJy3nTDlQf0ATTAwUk17iE+GPUaa0YP5WADauBq0914TFKO59 uku/lyJ/3j7JCtIzuHc9H9pdv0Nm4O7h/+WqWK2Cp2mWPdgSEVg37jtO2TVHnY7IcE+R SU9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=e7vKBoBPzpEmvYuH53f0FBBcuvIX4MqFHkke+XKX500=; fh=IZEyg1r7+rdpYIMPOyKgmlT60DbvHqug0Qte+ho+yjw=; b=a2cl2IIadcZYRdWAtsxijASwCOijPkboDQHcAwBC75xX6sSZYtPWO61cD5a/ZX31Vn 2BWXO0kCRiWYZgalVelvXkZmC1c8L/PKThXxfmqJGbIdkeeAGeY/zPw4g7OtZ2H5xOo6 xK3y2I+dmhTqDyD2R1hZCLy6km2tMRRplHmOXOTNU+u/FTZfHPCoINAP4SkDESmRjEGn 9V/T1rj9l8fhZU1FtH1k1pRJBSD49547JiLrsoAeBkPxhgpA7rDEfQw0Ile0Yhphtf+o gOFGl51FOF1s8aTDPP399vEBHM9iMuYn84grXAw0S6S+I1efWe9wqYwb956erSQttC9O IDHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DW7JsSsf; spf=pass (google.com: domain of linux-kernel+bounces-11579-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11579-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id n13-20020a170902d2cd00b001d4322ed67esi6273412plc.465.2023.12.26.08.33.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 08:33:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11579-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DW7JsSsf; spf=pass (google.com: domain of linux-kernel+bounces-11579-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11579-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9058C282FA4 for ; Tue, 26 Dec 2023 16:33:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4AD854F88B; Tue, 26 Dec 2023 16:33:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DW7JsSsf" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7DA094F880; Tue, 26 Dec 2023 16:33:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36CA7C433C9; Tue, 26 Dec 2023 16:33:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703608408; bh=BLpbEr0p82hU35cCL/WJMYoHLvsmOrAn9yaHxoMbAmI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=DW7JsSsfjLMBTGd8nXVUXHzf+GZ7/kpGKc8X1X9eCgj7QkepA+e+mDEP2CrxG0wI9 NJWSHa9mmZTtpy8nyUWhCMHCLW/W3xYZ4nsKhH+MKXFqR+PuvCdvkX9KY4AihGPAhS qB8O8ZW+bOVvELy4sKnq3G9yX2zM/i7YO9DDrVBSg+r3n+0qhGwJhNnHsVC6RsOKkS M9IL1udH7FBYesxANCBG/+cVcjSho8Hjpm8JNHtwfanJ0sAHdWimOEm6fPNtj+xgSf qmj5uvNMnK155X9qnesHDjlQXiqiCuuFfDJTY21ecdEyGWEdJLb5QMxPbIvFVqn3mZ hyZXSk0f+yrFA== Date: Tue, 26 Dec 2023 16:33:21 +0000 From: Jonathan Cameron To: Petre Rodan Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Andreas Klinger , Lars-Peter Clausen , Andy Shevchenko , Angel Iglesias , Matti Vaittinen Subject: Re: [PATCH v2 04/10] iio: pressure: mprls0025pa.c fix off-by-one enum Message-ID: <20231226163321.33c12ff5@jic23-huawei> In-Reply-To: <20231224143500.10940-5-petre.rodan@subdimension.ro> References: <20231224143500.10940-1-petre.rodan@subdimension.ro> <20231224143500.10940-5-petre.rodan@subdimension.ro> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.38; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sun, 24 Dec 2023 16:34:49 +0200 Petre Rodan wrote: > Fix off-by-one error in transfer-function property. > The honeywell,transfer-function property takes values between 1-3 so > make sure the proper enum gets used. > > Signed-off-by: Petre Rodan > Signed-off-by: Andreas Klinger Hi Petre Same question on what Andreas has to do with this patch and need for some other tag to explain that. Needs a fixes tag as well. > --- > drivers/iio/pressure/mprls0025pa.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/iio/pressure/mprls0025pa.c b/drivers/iio/pressure/mprls0025pa.c > index 30fb2de36821..e3f0de020a40 100644 > --- a/drivers/iio/pressure/mprls0025pa.c > +++ b/drivers/iio/pressure/mprls0025pa.c > @@ -323,6 +323,7 @@ static int mpr_probe(struct i2c_client *client) > struct iio_dev *indio_dev; > struct device *dev = &client->dev; > s64 scale, offset; > + u32 func; > > if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_READ_BYTE)) > return dev_err_probe(dev, -EOPNOTSUPP, > @@ -362,10 +363,11 @@ static int mpr_probe(struct i2c_client *client) > return dev_err_probe(dev, ret, > "honeywell,pmax-pascal could not be read\n"); > ret = device_property_read_u32(dev, > - "honeywell,transfer-function", &data->function); > + "honeywell,transfer-function", &func); > if (ret) > return dev_err_probe(dev, ret, > "honeywell,transfer-function could not be read\n"); > + data->function = func - 1; > if (data->function > MPR_FUNCTION_C) > return dev_err_probe(dev, -EINVAL, > "honeywell,transfer-function %d invalid\n", > -- > 2.41.0 >