From patchwork Mon Oct 14 15:23:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raghavendra Ganiga X-Patchwork-Id: 283275 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C519C2C0353 for ; Tue, 15 Oct 2013 02:24:22 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756008Ab3JNPXy (ORCPT ); Mon, 14 Oct 2013 11:23:54 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:63780 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755699Ab3JNPXx (ORCPT ); Mon, 14 Oct 2013 11:23:53 -0400 Received: by mail-pd0-f169.google.com with SMTP id r10so7566219pdi.28 for ; Mon, 14 Oct 2013 08:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=CN7ON+Z8vgNGSdm06xj/5BYD6kvV5zLZtEjvfn/XwZs=; b=o0rrF3RbVrjrM+bmsSFevTSZAFSFRHzDKMi5bPUhn4KAzYBPsouVHYYLxTcuHhDGZA Sh6N6spcndscBblWt4YI84YuCk/4mfxOrnD64uWBVhKUImOdBVmJ8hsnAA+cRU/QBlOW rZjAklDPClqBslcfYwzlZiLGW7fcieuZNLiV6I5Fj1DhuxZVNi0hurfQ/tuuxNXGSXZm AEheU0D1XyaZ5FxWM+OmhZ/Q3o5IDFPjGcuHCIzSL+Os9IGiigiae4td0FsP1ZU/F1ar LYJCbkIIBXAju0bL3NuukBq6JZ+HxyjgVggHMeI88Qm+Ld3QeHmK7T9xyMmgdb0c+Y6J t3SA== X-Received: by 10.68.135.132 with SMTP id ps4mr2381442pbb.171.1381764232334; Mon, 14 Oct 2013 08:23:52 -0700 (PDT) Received: from [192.168.0.100] ([123.201.144.19]) by mx.google.com with ESMTPSA id lm2sm92111971pab.2.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Oct 2013 08:23:51 -0700 (PDT) Message-ID: <525C0C5B.6040703@gmail.com> Date: Mon, 14 Oct 2013 20:53:07 +0530 From: RAGHAVENDRA GANIGA User-Agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: wsa@the-dreams.de CC: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, ravi23ganiga@gmail.com Subject: [PATCH 2/3] i2c: i2c-core: fix coding style issues in i2c-core.c Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org From b21e6a52aa9c36e8c01173cff13bbfd2a380d0bd Mon Sep 17 00:00:00 2001 From: Raghavendra Ganiga Date: Mon, 14 Oct 2013 00:29:08 +0530 Subject: [PATCH 2/3] i2c: i2c-core: fix coding style issues in i2c-core.c This is a patch to the i2c-core.c file that fixes up warnings and the code indent error reported by the checkpatch.pl tool Signed-off-by: Raghavendra Chandra Ganiga --- drivers/i2c/i2c-core.c | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index b1197bb..66e38a9 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include "i2c-core.h" @@ -687,8 +687,8 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info) return client; out_err: - dev_err(&adap->dev, "Failed to register i2c client %s at 0x%02x " - "(%d)\n", client->name, client->addr, status); + dev_err(&adap->dev, "Failed to register i2c client %s at 0x%02x (%d)\n", + client->name, client->addr, status); out_err_silent: kfree(client); return NULL; @@ -1158,8 +1158,7 @@ static int i2c_do_add_adapter(struct i2c_driver *driver, if (driver->attach_adapter) { dev_warn(&adap->dev, "%s: attach_adapter method is deprecated\n", driver->driver.name); - dev_warn(&adap->dev, "Please use another way to instantiate " - "your i2c_client\n"); + dev_warn(&adap->dev, "Please use another way to instantiate your i2c_client\n"); /* We ignore the return code; if it fails, too bad */ driver->attach_adapter(adap); } @@ -1183,13 +1182,12 @@ static int i2c_register_adapter(struct i2c_adapter *adap) /* Sanity checks */ if (unlikely(adap->name[0] == '\0')) { - pr_err("i2c-core: Attempt to register an adapter with " - "no name!\n"); + pr_err("i2c-core: Attempt to register an adapter with no name!\n"); return -EINVAL; } if (unlikely(!adap->algo)) { - pr_err("i2c-core: Attempt to register adapter '%s' with " - "no algo!\n", adap->name); + pr_err("i2c-core: Attempt to register adapter '%s' with no algo!\n", + adap->name); return -EINVAL; } @@ -1422,8 +1420,8 @@ void i2c_del_adapter(struct i2c_adapter *adap) found = idr_find(&i2c_adapter_idr, adap->nr); mutex_unlock(&core_lock); if (found != adap) { - pr_debug("i2c-core: attempting to delete unregistered " - "adapter [%s]\n", adap->name); + pr_debug("i2c-core: attempting to delete unregistered adapter [%s]\n", + adap->name); return; } @@ -1737,9 +1735,10 @@ int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) if (adap->algo->master_xfer) { #ifdef DEBUG for (ret = 0; ret < num; ret++) { - dev_dbg(&adap->dev, "master_xfer[%d] %c, addr=0x%02x, " - "len=%d%s\n", ret, (msgs[ret].flags & I2C_M_RD) - ? 'R' : 'W', msgs[ret].addr, msgs[ret].len, + dev_dbg(&adap->dev, "master_xfer[%d] %c, addr=0x%02x, len=%d%s\n", + ret, + ((msgs[ret].flags & I2C_M_RD) ? 'R' : 'W'), + msgs[ret].addr, msgs[ret].len, (msgs[ret].flags & I2C_M_RECV_LEN) ? "+" : ""); } #endif @@ -1905,8 +1904,9 @@ static int i2c_detect_address(struct i2c_client *temp_client, /* Consistency check */ if (info.type[0] == '\0') { - dev_err(&adapter->dev, "%s detection function provided " - "no name for 0x%x\n", driver->driver.name, + dev_err(&adapter->dev, + "%s detection function provided no name for 0x%x\n", + driver->driver.name, addr); } else { struct i2c_client *client; @@ -1946,8 +1946,9 @@ static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver) temp_client->adapter = adapter; for (i = 0; address_list[i] != I2C_CLIENT_END; i += 1) { - dev_dbg(&adapter->dev, "found normal entry for adapter %d, " - "addr 0x%02x\n", adap_id, address_list[i]); + dev_dbg(&adapter->dev, + "found normal entry for adapter %d, addr 0x%02x\n", + adap_id, address_list[i]); temp_client->addr = address_list[i]; err = i2c_detect_address(temp_client, driver); if (unlikely(err)) @@ -1979,15 +1980,16 @@ i2c_new_probed_device(struct i2c_adapter *adap, for (i = 0; addr_list[i] != I2C_CLIENT_END; i++) { /* Check address validity */ if (i2c_check_addr_validity(addr_list[i]) < 0) { - dev_warn(&adap->dev, "Invalid 7-bit address " - "0x%02x\n", addr_list[i]); + dev_warn(&adap->dev, "Invalid 7-bit address 0x%02x\n", + addr_list[i]); continue; } /* Check address availability */ if (i2c_check_addr_busy(adap, addr_list[i])) { - dev_dbg(&adap->dev, "Address 0x%02x already in " - "use, not probing\n", addr_list[i]); + dev_dbg(&adap->dev, + "Address 0x%02x already in use, not probing\n", + addr_list[i]); continue; } @@ -2118,7 +2120,7 @@ EXPORT_SYMBOL(i2c_smbus_read_byte); s32 i2c_smbus_write_byte(const struct i2c_client *client, u8 value) { return i2c_smbus_xfer(client->adapter, client->addr, client->flags, - I2C_SMBUS_WRITE, value, I2C_SMBUS_BYTE, NULL); + I2C_SMBUS_WRITE, value, I2C_SMBUS_BYTE, NULL); } EXPORT_SYMBOL(i2c_smbus_write_byte);