Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp1975239lqo; Sun, 19 May 2024 07:22:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV+c22E/Vy/nd8Pao8I+JCo3gXoGFLQnG2uHBRSOU7wzCcQtxMGcrEHGnt/JASsIf4tetpy52DKvDUCDdQYtq+2HBD8GIdp4Jmt5B8emg== X-Google-Smtp-Source: AGHT+IHZC6AP7J1KwI5xFDkug48G2Qv8A2cg0HyNMPWbBehKsfZORIQ4qfEBbKKDlkHEG8O94MxV X-Received: by 2002:a17:906:e945:b0:a59:a3ef:21f4 with SMTP id a640c23a62f3a-a5a2d66b514mr1672286166b.53.1716128579094; Sun, 19 May 2024 07:22:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716128579; cv=pass; d=google.com; s=arc-20160816; b=lSh18f6zupk+xXIjOTEt5rsJak6zfdTMGzAe/mjOl/Labmsa/ics4Lv2EQ1KM/cAH7 bDclO02R17+rjbz+kd805Jp9/YwIx8EmkjXjq+ehEARuPFSCeg4x03+tb+kyH/SXs39N yXyVPEL0z8caICqk4zYzEkFQGb6muk23X2dTQXmi/OMaYQhvi04/2MKTr/4W8vxclWVX 2LriqUKQCfDBOSvdqbcftgqJZTC3P5nE5/r6rsIRx5hHL6ejxwvYruJM+QWuHpTGYwSL n9RRX33WambQ9n4f351Q28Whm5V4blg9ouDHiIcdZDBm7vvAQEqOcIPPYtwUF4gzkqLM 8+RQ== ARC-Message-Signature: i=2; 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=yVVEvzo1iBAgXf/euVsiy+rzZd1ldbS/bvZMIRlr1aI=; fh=5qz+MjtH+DgodhGlQ6KpQbQDfbWjmtLGh9743vD1Hjs=; b=wcRvYROvxyi6+fFsUxS03fuFVAqgV21g8jKJLlgNnhxIOWH9BMraMe+wfzuhUB/xyD 73/VFm/lynmnD5PBMWOUW4V5zM12EfT4/Vd40mutImRdIjIERW5ggjM3BU6pn5bG80tP i8nFM98ZYB4i1+Yk/Bx5F5L0RC4zIaq+ZLEIY+oFmNMmHhWJx9+et7EtJGLuljHQdaP4 frFXFNqkKvooAwOSVFhn9JohUTAbSOdvo8JkKJY4Ig6dUTVMIczzQLcVXDzDVO7mPoew 997DdmNmBxg1GJ+tA4KZZfAbhb3mtOVDbdbFSqR0x4skZDkk1vTN6ljMRJHTyDMhyYx0 X4iw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RVf7AfrN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-183126-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183126-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17c2c1a9si1228094366b.964.2024.05.19.07.22.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 07:22:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183126-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RVf7AfrN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-183126-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183126-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 am.mirrors.kernel.org (Postfix) with ESMTPS id CD1031F2187F for ; Sun, 19 May 2024 14:22:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6C1C14C62A; Sun, 19 May 2024 14:22:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RVf7AfrN" 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 90A4B4596E; Sun, 19 May 2024 14:22:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716128570; cv=none; b=G+7A0Uu0VjBeDiyE/re4VSW+y2GygyMJYyPxbK5E8U7nB1t+UY5bui5bkz6x4wF+8D7qU0IWT91xuQMeWEWTW02FvT7Cbh7bTacP/4+5RKUJ5fjE6pvYbjtGBANlJidAuullpDWsCW32izKJwxROAfrwFHrKHo6YLUaLrWoaOv4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716128570; c=relaxed/simple; bh=HdRqtefJzU/1IVN9Z74ykRZLCT25VVz0Y8vi96reINI=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AcaZbNxfWWop9lGeifjXsKF4OAN70J9vasb7ZquXqPxO4RdM6Xk/82/C84Ecnn2+EOr0ZJIIdF4tgcr0NTLqP5Oa0If8QA2n1PCBYHscHJTL6pB7ZRLzRw24F6GNaBYL8lmtCLYy61nEsPd6PJYFCznaPBulLieeY5pRhmBkxB0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RVf7AfrN; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E748BC32781; Sun, 19 May 2024 14:22:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716128570; bh=HdRqtefJzU/1IVN9Z74ykRZLCT25VVz0Y8vi96reINI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=RVf7AfrN63c+ptmV918ypaSyiyXchSaL6UbnE4k33z8f+Msfpc6r2NYXuJH/et5kE lnsrI6d27/iYDGqIWUJKDFlWjn5bZ2sLTibUn1MdrEd2bIK5z4w9DS3/2lG2Ae/BFu E3lWKZVW8ob6mMB2nhqF1P+Hu/coOjPyW4XTk05DHOnibpJB2yWfyyjNKmlFX9DoBq AGRqDFFtKtGfkMGKgNjHOaoxsskQO5pSPXbPKdWY7g52rQHgyhHN1fx7JyIBx1T4zx Ge7w/7eK5+kMPfGYSwZA7IZ3yTxkA9uKHqC+CHtj+8E9lXlHwfkoeDHMv0HwXGv4Gg ciNkSDgbefDPA== Date: Sun, 19 May 2024 15:22:35 +0100 From: Jonathan Cameron To: Vasileios Amoiridis Cc: lars@metafoo.de, andriy.shevchenko@linux.intel.com, ang.iglesiasg@gmail.com, mazziesaccount@gmail.com, ak@it-klinger.de, petre.rodan@subdimension.ro, phil@raspberrypi.com, 579lpy@gmail.com, linus.walleij@linaro.org, semen.protsenko@linaro.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Jonathan Cameron Subject: Re: [PATCH v7 1/5] iio: pressure: bmp280: Refactorize reading functions Message-ID: <20240519152130.32ec84b9@jic23-huawei> In-Reply-To: <20240512230524.53990-2-vassilisamir@gmail.com> References: <20240512230524.53990-1-vassilisamir@gmail.com> <20240512230524.53990-2-vassilisamir@gmail.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.42; 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=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, 13 May 2024 01:05:20 +0200 Vasileios Amoiridis wrote: > For BMP18x, BMP28x, BME280, BMP38x the reading of the pressure > value requires an update of the t_fine variable which happens > through reading the temperature value. >=20 > So all the bmpxxx_read_press() functions of the above sensors > are internally calling the equivalent bmpxxx_read_temp() function > in order to update the t_fine value. By just looking at the code > this functionality is a bit hidden and is not easy to understand > why those channels are not independent. >=20 > This commit tries to clear these things a bit by splitting the > bmpxxx_{read/compensate}_{temp/press/humid}() to the following: >=20 > i. bmpxxx_read_{temp/press/humid}_adc(): read the raw value from > the sensor. >=20 > ii. bmpxx_calc_t_fine(): calculate the t_fine variable. >=20 > iii. bmpxxx_get_t_fine(): get the t_fine variable. >=20 > iv. bmpxxx_compensate_{temp/press/humid}(): compensate the adc > values and return the calculated value. >=20 > v. bmpxxx_read_{temp/press/humid}(): combine calls of the > aforementioned functions to return the requested value. >=20 > Suggested-by: Jonathan Cameron > Signed-off-by: Vasileios Amoiridis Applied with a fix... drivers/iio/pressure/bmp280-core.c: In function =E2=80=98bmp180_read_press= =E2=80=99: drivers/iio/pressure/bmp280-core.c:2091:9: error: =E2=80=98ret=E2=80=99 und= eclared (first use in this function); did you mean =E2=80=98net=E2=80=99? 2091 | ret =3D bmp180_get_t_fine(data, &t_fine); | ^~~ | net I guess something got lost in rebasing. Anyhow, fix obvious so not problem. Thanks, Jonathan