From patchwork Mon Feb 19 16:28:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Siqueira X-Patchwork-Id: 10228223 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 210CE60392 for ; Mon, 19 Feb 2018 16:28:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F758288A9 for ; Mon, 19 Feb 2018 16:28:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 032AD28947; Mon, 19 Feb 2018 16:28:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2DC44288A9 for ; Mon, 19 Feb 2018 16:28:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753012AbeBSQ2j (ORCPT ); Mon, 19 Feb 2018 11:28:39 -0500 Received: from mail-qt0-f195.google.com ([209.85.216.195]:33128 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752692AbeBSQ2i (ORCPT ); Mon, 19 Feb 2018 11:28:38 -0500 Received: by mail-qt0-f195.google.com with SMTP id d8so12908558qtm.0; Mon, 19 Feb 2018 08:28:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=DqZsaHYtBUeIaVNT2ahbdnXOlXTCOg4GQg+4CaVrf9c=; b=D3oPoLUBpugLeLulocB7Gdbg4kpKa1wGeguJ563/ktEAlg3zn+10tQsK8Y1YCywMqm dDiVye9R9T6MXohJJBX2x3MkZ5SdxkqAe0+hu2qnWJj2oTyQdS/9hopQWHC/kUdogawD lM9xCxqdfhW9mLZgXtiTgjMFLlPX0lYAFNwPaNyLE3dHzy1SjCu/NkJSkgw7jkmK403e WsG88csUXOfLzlBLR6Evnx8soexSi708y8DhatFgTSsjZOG6bwW6D6zoYrXos0OwfwjA DAX+eTCdEz8zUTJbDwTQ6wE/LpoTMHp5/s94Z4/rlFUlV7pNF35uL7H7ZkhLt38QeEBq uDWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=DqZsaHYtBUeIaVNT2ahbdnXOlXTCOg4GQg+4CaVrf9c=; b=uRp7kzik+QRvyoWodoYesNI5YHfX6yPzCZBwOc2yW+ee19mwol4yqx1X+LWYhGpiMP MzEWUQpweavPczVzRy8aBJ38lbqcCL6JoVP0zbcwC7wZOchdxQpWRE/xiuMpsxTQ6GFb 87s1xAy2e5ZAsiFqlZcaJnSkQfAwn7bO4EZW1aNRtiGeMdEpJghHIix1q7OaQkPT9/kq GzEjFSkOmeoXsboJToqfobI06Y5N7znJW2lh1JAP72NgCxL37OD+/hKSVCEV4hYas1xr 8PNoc8PGGlEOjSl9ySiAcRTHsToZgnuFgz2Fg/gOdhc8UlR07x93VhEBtd96X9o+0xIE Yg0w== X-Gm-Message-State: APf1xPDuKTpGr95ueIMJ/Cb7NUwO+Gojvj+fhetw7gJWH4Vi68daOPae lbuGnCfWPGtQDNiqN8hsCPQ= X-Google-Smtp-Source: AH8x227bj9uhh3E4g1hv9M/d+0Ie7AczAILO6hPbHxosJl+A6XCCw/w8fn/0RWVzrycbolIGfEWx6A== X-Received: by 10.237.48.103 with SMTP id 94mr2820688qte.48.1519057717260; Mon, 19 Feb 2018 08:28:37 -0800 (PST) Received: from smtp.gmail.com ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id h55sm9532194qta.80.2018.02.19.08.28.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Feb 2018 08:28:36 -0800 (PST) Date: Mon, 19 Feb 2018 13:28:32 -0300 From: rodrigosiqueira To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Hartmut Knaack , Peter Meerwald-Stadler , Greg Kroah-Hartman Cc: daniel.baluta@nxp.com, linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] staging:iio:meter: Add name to function definition arguments Message-ID: <20180219162832.qbkogggfzwbgsqlt@smtp.gmail.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20171215 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes the checkpatch.pl warning: drivers/staging/iio/meter/ade7854.h:157: WARNING: function definition argument 'struct device *' should also have an identifier name... This commit adds arguments names to the signature declared in the ade7854_state struct. For consistency reason, It also renames all arguments in function definitions. Signed-off-by: Rodrigo Siqueira --- Changes in v2: - Make the commit message clearer. - Use the same arguments name across signatures and definitions. drivers/staging/iio/meter/ade7754.c | 6 +++--- drivers/staging/iio/meter/ade7854-i2c.c | 28 ++++++++++++++-------------- drivers/staging/iio/meter/ade7854-spi.c | 28 ++++++++++++++-------------- drivers/staging/iio/meter/ade7854.h | 28 ++++++++++++++-------------- 4 files changed, 45 insertions(+), 45 deletions(-) diff --git a/drivers/staging/iio/meter/ade7754.c b/drivers/staging/iio/meter/ade7754.c index 3a1e342d75fb..9aa067736715 100644 --- a/drivers/staging/iio/meter/ade7754.c +++ b/drivers/staging/iio/meter/ade7754.c @@ -132,7 +132,7 @@ static int ade7754_spi_write_reg_8(struct device *dev, u8 reg_address, u8 val) } static int ade7754_spi_write_reg_16(struct device *dev, - u8 reg_address, u16 value) + u8 reg_address, u16 val) { int ret; struct iio_dev *indio_dev = dev_to_iio_dev(dev); @@ -140,8 +140,8 @@ static int ade7754_spi_write_reg_16(struct device *dev, mutex_lock(&st->buf_lock); st->tx[0] = ADE7754_WRITE_REG(reg_address); - st->tx[1] = (value >> 8) & 0xFF; - st->tx[2] = value & 0xFF; + st->tx[1] = (val >> 8) & 0xFF; + st->tx[2] = val & 0xFF; ret = spi_write(st->us, st->tx, 3); mutex_unlock(&st->buf_lock); diff --git a/drivers/staging/iio/meter/ade7854-i2c.c b/drivers/staging/iio/meter/ade7854-i2c.c index 8106f8cceeab..317e4f0d8176 100644 --- a/drivers/staging/iio/meter/ade7854-i2c.c +++ b/drivers/staging/iio/meter/ade7854-i2c.c @@ -17,7 +17,7 @@ static int ade7854_i2c_write_reg_8(struct device *dev, u16 reg_address, - u8 value) + u8 val) { int ret; struct iio_dev *indio_dev = dev_to_iio_dev(dev); @@ -26,7 +26,7 @@ static int ade7854_i2c_write_reg_8(struct device *dev, mutex_lock(&st->buf_lock); st->tx[0] = (reg_address >> 8) & 0xFF; st->tx[1] = reg_address & 0xFF; - st->tx[2] = value; + st->tx[2] = val; ret = i2c_master_send(st->i2c, st->tx, 3); mutex_unlock(&st->buf_lock); @@ -36,7 +36,7 @@ static int ade7854_i2c_write_reg_8(struct device *dev, static int ade7854_i2c_write_reg_16(struct device *dev, u16 reg_address, - u16 value) + u16 val) { int ret; struct iio_dev *indio_dev = dev_to_iio_dev(dev); @@ -45,8 +45,8 @@ static int ade7854_i2c_write_reg_16(struct device *dev, mutex_lock(&st->buf_lock); st->tx[0] = (reg_address >> 8) & 0xFF; st->tx[1] = reg_address & 0xFF; - st->tx[2] = (value >> 8) & 0xFF; - st->tx[3] = value & 0xFF; + st->tx[2] = (val >> 8) & 0xFF; + st->tx[3] = val & 0xFF; ret = i2c_master_send(st->i2c, st->tx, 4); mutex_unlock(&st->buf_lock); @@ -56,7 +56,7 @@ static int ade7854_i2c_write_reg_16(struct device *dev, static int ade7854_i2c_write_reg_24(struct device *dev, u16 reg_address, - u32 value) + u32 val) { int ret; struct iio_dev *indio_dev = dev_to_iio_dev(dev); @@ -65,9 +65,9 @@ static int ade7854_i2c_write_reg_24(struct device *dev, mutex_lock(&st->buf_lock); st->tx[0] = (reg_address >> 8) & 0xFF; st->tx[1] = reg_address & 0xFF; - st->tx[2] = (value >> 16) & 0xFF; - st->tx[3] = (value >> 8) & 0xFF; - st->tx[4] = value & 0xFF; + st->tx[2] = (val >> 16) & 0xFF; + st->tx[3] = (val >> 8) & 0xFF; + st->tx[4] = val & 0xFF; ret = i2c_master_send(st->i2c, st->tx, 5); mutex_unlock(&st->buf_lock); @@ -77,7 +77,7 @@ static int ade7854_i2c_write_reg_24(struct device *dev, static int ade7854_i2c_write_reg_32(struct device *dev, u16 reg_address, - u32 value) + u32 val) { int ret; struct iio_dev *indio_dev = dev_to_iio_dev(dev); @@ -86,10 +86,10 @@ static int ade7854_i2c_write_reg_32(struct device *dev, mutex_lock(&st->buf_lock); st->tx[0] = (reg_address >> 8) & 0xFF; st->tx[1] = reg_address & 0xFF; - st->tx[2] = (value >> 24) & 0xFF; - st->tx[3] = (value >> 16) & 0xFF; - st->tx[4] = (value >> 8) & 0xFF; - st->tx[5] = value & 0xFF; + st->tx[2] = (val >> 24) & 0xFF; + st->tx[3] = (val >> 16) & 0xFF; + st->tx[4] = (val >> 8) & 0xFF; + st->tx[5] = val & 0xFF; ret = i2c_master_send(st->i2c, st->tx, 6); mutex_unlock(&st->buf_lock); diff --git a/drivers/staging/iio/meter/ade7854-spi.c b/drivers/staging/iio/meter/ade7854-spi.c index 63e200ffd1f2..72eddfec21f7 100644 --- a/drivers/staging/iio/meter/ade7854-spi.c +++ b/drivers/staging/iio/meter/ade7854-spi.c @@ -17,7 +17,7 @@ static int ade7854_spi_write_reg_8(struct device *dev, u16 reg_address, - u8 value) + u8 val) { int ret; struct iio_dev *indio_dev = dev_to_iio_dev(dev); @@ -32,7 +32,7 @@ static int ade7854_spi_write_reg_8(struct device *dev, st->tx[0] = ADE7854_WRITE_REG; st->tx[1] = (reg_address >> 8) & 0xFF; st->tx[2] = reg_address & 0xFF; - st->tx[3] = value & 0xFF; + st->tx[3] = val & 0xFF; ret = spi_sync_transfer(st->spi, &xfer, 1); mutex_unlock(&st->buf_lock); @@ -42,7 +42,7 @@ static int ade7854_spi_write_reg_8(struct device *dev, static int ade7854_spi_write_reg_16(struct device *dev, u16 reg_address, - u16 value) + u16 val) { int ret; struct iio_dev *indio_dev = dev_to_iio_dev(dev); @@ -57,8 +57,8 @@ static int ade7854_spi_write_reg_16(struct device *dev, st->tx[0] = ADE7854_WRITE_REG; st->tx[1] = (reg_address >> 8) & 0xFF; st->tx[2] = reg_address & 0xFF; - st->tx[3] = (value >> 8) & 0xFF; - st->tx[4] = value & 0xFF; + st->tx[3] = (val >> 8) & 0xFF; + st->tx[4] = val & 0xFF; ret = spi_sync_transfer(st->spi, &xfer, 1); mutex_unlock(&st->buf_lock); @@ -68,7 +68,7 @@ static int ade7854_spi_write_reg_16(struct device *dev, static int ade7854_spi_write_reg_24(struct device *dev, u16 reg_address, - u32 value) + u32 val) { int ret; struct iio_dev *indio_dev = dev_to_iio_dev(dev); @@ -83,9 +83,9 @@ static int ade7854_spi_write_reg_24(struct device *dev, st->tx[0] = ADE7854_WRITE_REG; st->tx[1] = (reg_address >> 8) & 0xFF; st->tx[2] = reg_address & 0xFF; - st->tx[3] = (value >> 16) & 0xFF; - st->tx[4] = (value >> 8) & 0xFF; - st->tx[5] = value & 0xFF; + st->tx[3] = (val >> 16) & 0xFF; + st->tx[4] = (val >> 8) & 0xFF; + st->tx[5] = val & 0xFF; ret = spi_sync_transfer(st->spi, &xfer, 1); mutex_unlock(&st->buf_lock); @@ -95,7 +95,7 @@ static int ade7854_spi_write_reg_24(struct device *dev, static int ade7854_spi_write_reg_32(struct device *dev, u16 reg_address, - u32 value) + u32 val) { int ret; struct iio_dev *indio_dev = dev_to_iio_dev(dev); @@ -110,10 +110,10 @@ static int ade7854_spi_write_reg_32(struct device *dev, st->tx[0] = ADE7854_WRITE_REG; st->tx[1] = (reg_address >> 8) & 0xFF; st->tx[2] = reg_address & 0xFF; - st->tx[3] = (value >> 24) & 0xFF; - st->tx[4] = (value >> 16) & 0xFF; - st->tx[5] = (value >> 8) & 0xFF; - st->tx[6] = value & 0xFF; + st->tx[3] = (val >> 24) & 0xFF; + st->tx[4] = (val >> 16) & 0xFF; + st->tx[5] = (val >> 8) & 0xFF; + st->tx[6] = val & 0xFF; ret = spi_sync_transfer(st->spi, &xfer, 1); mutex_unlock(&st->buf_lock); diff --git a/drivers/staging/iio/meter/ade7854.h b/drivers/staging/iio/meter/ade7854.h index c27247a7891a..a82d38224cbd 100644 --- a/drivers/staging/iio/meter/ade7854.h +++ b/drivers/staging/iio/meter/ade7854.h @@ -152,20 +152,20 @@ * @rx: receive buffer **/ struct ade7854_state { - struct spi_device *spi; - struct i2c_client *i2c; - int (*read_reg_8)(struct device *, u16, u8 *); - int (*read_reg_16)(struct device *, u16, u16 *); - int (*read_reg_24)(struct device *, u16, u32 *); - int (*read_reg_32)(struct device *, u16, u32 *); - int (*write_reg_8)(struct device *, u16, u8); - int (*write_reg_16)(struct device *, u16, u16); - int (*write_reg_24)(struct device *, u16, u32); - int (*write_reg_32)(struct device *, u16, u32); - int irq; - struct mutex buf_lock; - u8 tx[ADE7854_MAX_TX] ____cacheline_aligned; - u8 rx[ADE7854_MAX_RX]; + struct spi_device *spi; + struct i2c_client *i2c; + int (*read_reg_8)(struct device *dev, u16 reg_address, u8 *val); + int (*read_reg_16)(struct device *dev, u16 reg_address, u16 *val); + int (*read_reg_24)(struct device *dev, u16 reg_address, u32 *val); + int (*read_reg_32)(struct device *dev, u16 reg_address, u32 *val); + int (*write_reg_8)(struct device *dev, u16 reg_address, u8 val); + int (*write_reg_16)(struct device *dev, u16 reg_address, u16 val); + int (*write_reg_24)(struct device *dev, u16 reg_address, u32 val); + int (*write_reg_32)(struct device *dev, u16 reg_address, u32 val); + int irq; + struct mutex buf_lock; + u8 tx[ADE7854_MAX_TX] ____cacheline_aligned; + u8 rx[ADE7854_MAX_RX]; };