From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2CCDDC433DF for ; Sat, 16 May 2020 17:20:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E757720709 for ; Sat, 16 May 2020 17:20:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589649651; bh=aTUSYRNg1AIN3df6ElQSFIwBjTcgJ60HMWA94BnEMIk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=oYLDigSAc7OzkwNhEt0hZerLQnYbwpZe2QUTICx/vMzk/ZPI6Fe5bDdmHEy0QFTjk qhpIokcoUDsYSMFFRk7EudfujGbrq/omUVTwrNGBWP2/PbNkSxJk4jD3u7L3rDCrKQ QQbUky+6BBZfSGZww12OGKJqGiPha22V1+AgyRIA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726551AbgEPRUu (ORCPT ); Sat, 16 May 2020 13:20:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:48218 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726269AbgEPRUu (ORCPT ); Sat, 16 May 2020 13:20:50 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7DD06207D4; Sat, 16 May 2020 17:20:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589649649; bh=aTUSYRNg1AIN3df6ElQSFIwBjTcgJ60HMWA94BnEMIk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=slPnHaD4n6jUrADNzVFJyfZeQgAXJHcT2NZQmV9SyUP+6SJmZdWy3lUIKwsuFlXMe 8pE+MnMxuBhUgxWjnjnrD7qgo+z4fZQwlvvADD69hmeHPEPue69NFQB1gap3n0EHEY 0yfZgAhdfekHmT8/Mx+PIIF4bfxLa3eCmxO9TVlk= Date: Sat, 16 May 2020 18:20:44 +0100 From: Jonathan Cameron To: Alexandru Ardelean Cc: , , , , , , , , , , Subject: Re: [PATCH v2 4/8] iio: stm32-dfsdm-adc: pass iio device as arg for the interrupt handler Message-ID: <20200516182044.373adf4b@archlinux> In-Reply-To: <20200514131710.84201-5-alexandru.ardelean@analog.com> References: <20200514131710.84201-1-alexandru.ardelean@analog.com> <20200514131710.84201-5-alexandru.ardelean@analog.com> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 14 May 2020 16:17:06 +0300 Alexandru Ardelean wrote: > This changes the argument for the interrupt handler to be the IIO device > instead of the state-struct. > Since there will be some changes to how iio_priv_to_dev() is implemented, > it could be that the helper becomes a bit slower, as it will be hidden away > in the IIO core. > > The iio_priv() call will still be fast enough, as it will return a void > pointer from the public IIO device structure. So it's better to switch the > order. > > Signed-off-by: Alexandru Ardelean Whilst this one looks fine to me. I'd definitely like an Ack from one of the stm people in case I'm missing something. > --- > drivers/iio/adc/stm32-dfsdm-adc.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c > index 76a60d93fe23..28ef02887bd3 100644 > --- a/drivers/iio/adc/stm32-dfsdm-adc.c > +++ b/drivers/iio/adc/stm32-dfsdm-adc.c > @@ -1313,8 +1313,8 @@ static const struct iio_info stm32_dfsdm_info_adc = { > > static irqreturn_t stm32_dfsdm_irq(int irq, void *arg) > { > - struct stm32_dfsdm_adc *adc = arg; > - struct iio_dev *indio_dev = iio_priv_to_dev(adc); > + struct iio_dev *indio_dev = arg; > + struct stm32_dfsdm_adc *adc = iio_priv(indio_dev); > struct regmap *regmap = adc->dfsdm->regmap; > unsigned int status, int_en; > > @@ -1603,7 +1603,7 @@ static int stm32_dfsdm_adc_probe(struct platform_device *pdev) > return irq; > > ret = devm_request_irq(dev, irq, stm32_dfsdm_irq, > - 0, pdev->name, adc); > + 0, pdev->name, iio); > if (ret < 0) { > dev_err(dev, "Failed to request IRQ\n"); > return ret; From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8640C433E0 for ; Sat, 16 May 2020 17:21:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 91564206D4 for ; Sat, 16 May 2020 17:21:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jGYSvWKR"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="slPnHaD4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 91564206D4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zgffTWpV7FEu++h3bLHOBO6E2cpvs4Se9+LoM5iKy1I=; b=jGYSvWKRbpShQU vLUlrkcQTrfqiciBEBA3g8ufuLXDx5nraXyJhSWdC+WZ6fBeV8fB0FUTqZziSdz+kr7JzVvrxvlWp McdwclwbcnJncvJSZpBZ6kpb9zxVFe2k6lOcOHbPaXRo27IqfRLbshp4GQkvBT/yxDdroY6UhyBiA opJyhyzgVZ8cz24ccwaWVOhcnzeF5nNHSmRFuDL1YpoCPLYA25wLrL94O5qsyj5A4nP/WXPmn1JuF a4cFUYzl/opuRE7hpRqzmsSo4teYr9hIcTLnE5EoK5L6NwXTVS2l4fzcgwb1r74iMwpIIdZkiTnKa 8Dhr4G2T+Sn2Ts1Kq6HQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ja0Uf-0007GK-Kj; Sat, 16 May 2020 17:21:01 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ja0UT-00078K-Tp for linux-arm-kernel@lists.infradead.org; Sat, 16 May 2020 17:20:51 +0000 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7DD06207D4; Sat, 16 May 2020 17:20:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589649649; bh=aTUSYRNg1AIN3df6ElQSFIwBjTcgJ60HMWA94BnEMIk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=slPnHaD4n6jUrADNzVFJyfZeQgAXJHcT2NZQmV9SyUP+6SJmZdWy3lUIKwsuFlXMe 8pE+MnMxuBhUgxWjnjnrD7qgo+z4fZQwlvvADD69hmeHPEPue69NFQB1gap3n0EHEY 0yfZgAhdfekHmT8/Mx+PIIF4bfxLa3eCmxO9TVlk= Date: Sat, 16 May 2020 18:20:44 +0100 From: Jonathan Cameron To: Alexandru Ardelean Subject: Re: [PATCH v2 4/8] iio: stm32-dfsdm-adc: pass iio device as arg for the interrupt handler Message-ID: <20200516182044.373adf4b@archlinux> In-Reply-To: <20200514131710.84201-5-alexandru.ardelean@analog.com> References: <20200514131710.84201-1-alexandru.ardelean@analog.com> <20200514131710.84201-5-alexandru.ardelean@analog.com> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200516_102050_041709_71EA85DF X-CRM114-Status: GOOD ( 18.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, alexandre.torgue@st.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, ludovic.desroches@microchip.com, ak@it-klinger.de, mcoquelin.stm32@gmail.com, eugen.hristev@microchip.com, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 14 May 2020 16:17:06 +0300 Alexandru Ardelean wrote: > This changes the argument for the interrupt handler to be the IIO device > instead of the state-struct. > Since there will be some changes to how iio_priv_to_dev() is implemented, > it could be that the helper becomes a bit slower, as it will be hidden away > in the IIO core. > > The iio_priv() call will still be fast enough, as it will return a void > pointer from the public IIO device structure. So it's better to switch the > order. > > Signed-off-by: Alexandru Ardelean Whilst this one looks fine to me. I'd definitely like an Ack from one of the stm people in case I'm missing something. > --- > drivers/iio/adc/stm32-dfsdm-adc.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c > index 76a60d93fe23..28ef02887bd3 100644 > --- a/drivers/iio/adc/stm32-dfsdm-adc.c > +++ b/drivers/iio/adc/stm32-dfsdm-adc.c > @@ -1313,8 +1313,8 @@ static const struct iio_info stm32_dfsdm_info_adc = { > > static irqreturn_t stm32_dfsdm_irq(int irq, void *arg) > { > - struct stm32_dfsdm_adc *adc = arg; > - struct iio_dev *indio_dev = iio_priv_to_dev(adc); > + struct iio_dev *indio_dev = arg; > + struct stm32_dfsdm_adc *adc = iio_priv(indio_dev); > struct regmap *regmap = adc->dfsdm->regmap; > unsigned int status, int_en; > > @@ -1603,7 +1603,7 @@ static int stm32_dfsdm_adc_probe(struct platform_device *pdev) > return irq; > > ret = devm_request_irq(dev, irq, stm32_dfsdm_irq, > - 0, pdev->name, adc); > + 0, pdev->name, iio); > if (ret < 0) { > dev_err(dev, "Failed to request IRQ\n"); > return ret; _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel