Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp328327lqe; Sat, 6 Apr 2024 03:03:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX7DeBggkM8AB+/GUIrx6DFU8Mz8wXQmoeXIkCbX9Gkb7jff4ZKUsT/8001p4UuuK4CWrgyERps+LXB2VWAqPF4eicTgPppz/bmIzcm8w== X-Google-Smtp-Source: AGHT+IEDTuS2rPMmzEmYeUTjUDpUfWHUVPT+8fjjRh7GozkPc94w7Tk/tNRow96XcNn2URYrzfBN X-Received: by 2002:a05:6830:1e72:b0:6e6:f301:dc30 with SMTP id m18-20020a0568301e7200b006e6f301dc30mr3804094otr.33.1712397802196; Sat, 06 Apr 2024 03:03:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712397802; cv=pass; d=google.com; s=arc-20160816; b=JBi/OfRq45uPVrFlQfgzom8Cfwu+oV7K7EBOUaBLlD9Ci/LXvrRRkQjQh4KNN2hMV/ IRYawnPGTbR8j9uFQyx+pPsAROtlnSbobIta/KmnlsSoFdbidOcaVwoyn63kScEBJNMJ 0mXNyc98Mt/h0HVC8AAMavSpclUBvPDaKic8NUJ3veMk3418n7Ag5sObbjeQGoJaQFpm HqYlWUUA0MY7jR0nIejsfTtO601gw5wC1M6+tWng3dt77CDc1ZZQ7IxoT8a8jz8LYGO+ VxveEZEci+2etChWEZeVeROo+40LaD9i+BdNMnuvYOS4Y1xcd0ITuySUUb5qp7xNI+E9 ta/w== 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=lS+o4jmAp1y2ZmzdkfOi+bRqYKdvj7jta7F8CelCNHw=; fh=ULxNTxaaQIEX8Y9ih2rqqI9Lxn2bbvdaV8tkS1+QGD8=; b=MVyNsfICX/n3qegLPxvjH+wUfWH7CAdG1njKX9BmECBntsYjO9jBHb3XbbhjinT/FK oFxSAzxxtu4lq5XAqCzyTAwCcuBaYVAeEZa+vJsV6WeHDNZi1IjGepyMS86/mvCyjz37 aTmQ3JHjvbgTiTV4y/LuNH5nWkAcAuDrzijfFKDK2WoufjZylf4zjULZptAO2lrkRSg0 Gb0M5x4RJ8nbbyxgeoWXysgj3mIrw4470QHMQ84VPjRMhdqc+bBVUOY6wKiu6SVn/laC sXvMegiJ58AqqLRCCwc6V4Zcaa3nrxXmEL6dpi++ZAITDUzY8JKbUhUbpioviRWDXpFM 6/tw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=l0iqZJYj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-133884-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133884-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id q9-20020a05622a04c900b00432cceb9571si3865736qtx.737.2024.04.06.03.03.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 03:03:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133884-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=l0iqZJYj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-133884-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133884-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B8C191C20D90 for ; Sat, 6 Apr 2024 10:03:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A76882561F; Sat, 6 Apr 2024 10:03:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="l0iqZJYj" 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 CE23B17C8B; Sat, 6 Apr 2024 10:03:14 +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=1712397794; cv=none; b=oM3IqqJtXg+6v64k8XG1WL9c0nQe3ho7tnrErZP9w7OpSPn8g8rneLxi1PGYwcn0K0MA7c0L0XWOxkon7CkeWoZW/yKEKTB6hVoKT1VHq8wrqrM7HdUF3tpSxGyuiKMuspQ7sletedWbk4tiO1PrdTJ/+H3iv93uXrhkUVcC+q4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712397794; c=relaxed/simple; bh=ywQNKTlj4Tfn6ae3V2PE/XSgjxl0I5vplDGWumg7GVs=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZZ1rqv142dqlj/DhoW+AZ3xO9mI8EeZL6qhQZcog39anRSzIZjHgSGZ0UW5c1Q2n8sBxQOJq9VXIsRa61gMOef24IV8di/S47swHzcvAX/w3s0suo8Dgnpy3SEnlDdOzBG31vLKW25l2M9Ur2U1s1wpgM87orxT9NydyjF5EfeU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=l0iqZJYj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B953AC433F1; Sat, 6 Apr 2024 10:03:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712397794; bh=ywQNKTlj4Tfn6ae3V2PE/XSgjxl0I5vplDGWumg7GVs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=l0iqZJYj5p+ms49TiP7VKThlu5niXY13bbkLBBPyqx1pNNsIGt2wrnu4/5xTIt1ro DxR3utetNCAlwk3qKJp2yUyi29dYGdmuJ995oJ2nDbZfH0RVgPVw3II19ETnpV+btG 3COOakexyvX6QygYGu3eeV60evK8ueBDefXcjWI170G0jGfFHu57EHlxRQu4u+6FGD 3sOkYLxY7AcU84qvdTViJxuDQondfn8BabRNRT+o3uxQEHH7ct3hoB9Im3fyhIXtRR kXmvafjiAd3QFPLlna9/qHwXkraDVyJ6wMRpJIszcXe8LelGkG9469DtJ6eJ511Eog Emgvz9QeFj0fg== Date: Sat, 6 Apr 2024 11:02:59 +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 Subject: Re: [PATCH v3 6/6] iio: pressure: Add triggered buffer support for BMP280 driver Message-ID: <20240406110259.572a3f25@jic23-huawei> In-Reply-To: <20240402180849.GB18068@vamoiridPC> References: <20240319002925.2121016-1-vassilisamir@gmail.com> <20240319002925.2121016-7-vassilisamir@gmail.com> <20240324121418.570857a9@jic23-huawei> <20240402180849.GB18068@vamoiridPC> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; 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 > > > > > > +static irqreturn_t bmp280_buffer_handler(int irq, void *p) > > > +{ > > > + struct iio_poll_func *pf = p; > > > + struct iio_dev *indio_dev = pf->indio_dev; > > > + struct bmp280_data *data = iio_priv(indio_dev); > > > + s32 adc_temp, adc_press, adc_humidity; > > > + u8 size_of_burst_read; > > > + int ret, chan_value; > > > + > > > + guard(mutex)(&data->lock); > > > + > > > + if (test_bit(BME280_HUMID, indio_dev->active_scan_mask)) > > > > This confuses me a little. Is it allowing reuse of this function for > > multiple devices or aiming to optimise the read in the case of > > the humidity channel being disabled (in which case I don't think > > it works because you aren't providing that combination in avail_scan_masks.) > > > > Add a comment to explain. > > > > Hi Jonathan, > > It is aimed to reuse the function both for BMP280 and BME280 so that's why is > there, it's not in case humidity channel is disabled. I can add a comment it > is definitely not obvious. Thanks for pointing this out. > > By applying the changes that you pointed out + by implementing the changes > that you proposed in a previous patch to split the t_fine calculation this > patch will become much cleaner, thanks a lot! A comment would do the job nicely. Thanks, J