Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4440988imu; Sun, 25 Nov 2018 03:51:05 -0800 (PST) X-Google-Smtp-Source: AFSGD/XcFDrbu3NkgsBTSssx+XgNrjYB7sgSt9XzhLEbWumSDHKyzbxArDPX9zutGpU9/u1aoiJu X-Received: by 2002:a63:f241:: with SMTP id d1mr20869533pgk.2.1543146665576; Sun, 25 Nov 2018 03:51:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543146665; cv=none; d=google.com; s=arc-20160816; b=v6NCpO8g9wN/TFtjVOmNIHKGDlGBATpgLuMQBhdZBP0yzW5AiXy46E1KlnfpztOM0J dyKSkXMgVFx7cbBRqVtjXPEpJ464Us6mT8vz7g8HskUlzsmJnu4fTNM5tgY93H+WJBgh Errcu03z6f9Ae/VmQwFgzJsxWIsbpP1jt5PtDIXwgW0tuZ2DFgXNbDY1TEP/wo29tg4d Oh6HYnzyxHZFd9igxxBTOp9Y2NSgLczv91ykc3vmW/7CKGU9sWQnJPolsrEzNwwrN7Sa jDcwWsHaDw0gsLMHQtb/DSaHJPUQz4pva/XYVXDW3Q9OMTNSdUuhT61xA6mSEfkJfhyb axfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=s6Qs4uUY9XBl+BnMPhZYG8wtdLLEJX5/N0VqVFbhIok=; b=uWTG+QzIBqky0yqbPmik9+isGocUBiarOehPAdEl5D024elJxWF8xrCz03tUULvZw2 2vIZQYHK3Ydx8A/A6tUHraPTGRb5aV+dIvEjK+DuFOXN7sXRrYUrvN/Fc8mvHIZm86d4 eoLP+GapIkP4YZGTimCy30f/XiN+ahoc0m4RGju5Ax+cRT90CqdFrNyFmdlehcPn4fDv j2WRD2vdVrT8/6SHginPST+w7/tjRl8Aab7csC8ehHV8TqSz6DJLlbM3Jp8UA4h/8cWu WjVz9w0Zz4FYnEck5fDE3HPfBZXbY7X3ituuJYPR0g/O/XwzQZwyAjGpPyKE+4rcv6OA qrhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KpbZDFtF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id d1si16480896pgg.301.2018.11.25.03.50.50; Sun, 25 Nov 2018 03:51:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KpbZDFtF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726336AbeKYWk5 (ORCPT + 99 others); Sun, 25 Nov 2018 17:40:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:37078 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726023AbeKYWk5 (ORCPT ); Sun, 25 Nov 2018 17:40:57 -0500 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (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 E9E8020865; Sun, 25 Nov 2018 11:49:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543146601; bh=uJ0J7WjdBTq5EEmsuVh07BHNEm8mlhyG/hOw5eDVOoE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KpbZDFtFbdRAjls5oEq67X3aTYdoNNxTPAfnl4dWKfbg75uNcQ0FpWq28bT8w4n35 4+IxI1yj6BcTCLq3at2uKQcRUu0MMy7Y+2Td1zLyfzsCGlTmP56FomGFcPMCR0q3b5 en90+arVa5jplRyshpW3YVccB/C90ZFKBi6PtVzs= Date: Sun, 25 Nov 2018 11:49:57 +0000 From: Jonathan Cameron To: Shreeya Patel Cc: lars@metafoo.de, Michael.Hennerich@analog.com, knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org, linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/5] Staging: iio: adt7316: Switch irq_flags to a local variable Message-ID: <20181125114957.4714a2ea@archlinux> In-Reply-To: <20181120165658.7259-1-shreeya.patel23498@gmail.com> References: <20181120165658.7259-1-shreeya.patel23498@gmail.com> X-Mailer: Claws Mail 3.17.1 (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 Tue, 20 Nov 2018 22:26:58 +0530 Shreeya Patel wrote: > There is no need to store irq_flags into the structure as it > is always set to the same thing. Hence switch irq_flags to a > local variable. > > Signed-off-by: Shreeya Patel Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > drivers/staging/iio/addac/adt7316-i2c.c | 1 - > drivers/staging/iio/addac/adt7316-spi.c | 1 - > drivers/staging/iio/addac/adt7316.c | 8 ++++---- > drivers/staging/iio/addac/adt7316.h | 1 - > 4 files changed, 4 insertions(+), 7 deletions(-) > > diff --git a/drivers/staging/iio/addac/adt7316-i2c.c b/drivers/staging/iio/addac/adt7316-i2c.c > index 41bc4ca008bc..ac91163656b5 100644 > --- a/drivers/staging/iio/addac/adt7316-i2c.c > +++ b/drivers/staging/iio/addac/adt7316-i2c.c > @@ -104,7 +104,6 @@ static int adt7316_i2c_probe(struct i2c_client *client, > struct adt7316_bus bus = { > .client = client, > .irq = client->irq, > - .irq_flags = IRQF_TRIGGER_LOW, > .read = adt7316_i2c_read, > .write = adt7316_i2c_write, > .multi_read = adt7316_i2c_multi_read, > diff --git a/drivers/staging/iio/addac/adt7316-spi.c b/drivers/staging/iio/addac/adt7316-spi.c > index 5cd22743e140..e75827e326a6 100644 > --- a/drivers/staging/iio/addac/adt7316-spi.c > +++ b/drivers/staging/iio/addac/adt7316-spi.c > @@ -94,7 +94,6 @@ static int adt7316_spi_probe(struct spi_device *spi_dev) > struct adt7316_bus bus = { > .client = spi_dev, > .irq = spi_dev->irq, > - .irq_flags = IRQF_TRIGGER_LOW, > .read = adt7316_spi_read, > .write = adt7316_spi_write, > .multi_read = adt7316_spi_multi_read, > diff --git a/drivers/staging/iio/addac/adt7316.c b/drivers/staging/iio/addac/adt7316.c > index deb2f7b40f60..dfae22619287 100644 > --- a/drivers/staging/iio/addac/adt7316.c > +++ b/drivers/staging/iio/addac/adt7316.c > @@ -2102,6 +2102,7 @@ int adt7316_probe(struct device *dev, struct adt7316_bus *bus, > struct adt7316_chip_info *chip; > struct iio_dev *indio_dev; > unsigned short *adt7316_platform_data = dev->platform_data; > + int irq_flags = IRQF_TRIGGER_LOW; > int ret = 0; > > indio_dev = devm_iio_device_alloc(dev, sizeof(*chip)); > @@ -2146,19 +2147,18 @@ int adt7316_probe(struct device *dev, struct adt7316_bus *bus, > > if (chip->bus.irq > 0) { > if (adt7316_platform_data[0]) > - chip->bus.irq_flags = adt7316_platform_data[0]; > + irq_flags = adt7316_platform_data[0]; > > ret = devm_request_threaded_irq(dev, chip->bus.irq, > NULL, > adt7316_event_handler, > - chip->bus.irq_flags | > - IRQF_ONESHOT, > + irq_flags | IRQF_ONESHOT, > indio_dev->name, > indio_dev); > if (ret) > return ret; > > - if (chip->bus.irq_flags & IRQF_TRIGGER_HIGH) > + if (irq_flags & IRQF_TRIGGER_HIGH) > chip->config1 |= ADT7316_INT_POLARITY; > } > > diff --git a/drivers/staging/iio/addac/adt7316.h b/drivers/staging/iio/addac/adt7316.h > index ec40fbb698a6..fd7c5c92b599 100644 > --- a/drivers/staging/iio/addac/adt7316.h > +++ b/drivers/staging/iio/addac/adt7316.h > @@ -17,7 +17,6 @@ > struct adt7316_bus { > void *client; > int irq; > - int irq_flags; > int (*read)(void *client, u8 reg, u8 *data); > int (*write)(void *client, u8 reg, u8 val); > int (*multi_read)(void *client, u8 first_reg, u8 count, u8 *data);