Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2328135imj; Mon, 11 Feb 2019 00:32:30 -0800 (PST) X-Google-Smtp-Source: AHgI3IYHzH9iODoFM7xslXiAYrdjp40Kn8RsEENpJRXDM8v/9mdFzyowkWtB80mZgypsctVYm+xL X-Received: by 2002:a63:1061:: with SMTP id 33mr27448683pgq.108.1549873949979; Mon, 11 Feb 2019 00:32:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549873949; cv=none; d=google.com; s=arc-20160816; b=ADjq+3UM955Ep6HdtlV8rge4UVl281J9Qvv5ax3oZa5Dq5vv03jdQPFueZXQ1F4ctA ncYke1ha8ZhMV1YSB3VWk3Pb4Z7IJCEae5jFO1UX1BmEUOB6wOt1miucWgsBeJ5sO2vC S/BkqAnApR67WHJtePaRXYvpRqSIu+WM1LbtkpbuboiJZH28IfcGfoUrZBtbZkaUXWCc s1Fxwn5PzjYSctm8uHCG7+VyeZlldytSnK+WNWJmByNjzSHWI9/9TiVSh5+f0DHxhz5r hogFdB/YqcIwHHDykU1WHmI9+OghpzpfI4VoIELRj/jc0RcllAE2nfZnL6OycaQOPhDu aMSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=GjQ9QyCeVGip3EFBe+bgRB73v6AVcBnsli83BKrpBVI=; b=gVa2h+7vvYIy5KL0y/FlgYDr7KvdGEd8ResrcMg6yGlHEntqVaZfWyXd9zZhYFGjZF T/J+GhzpKCJKxESVROWThx655MiIxCk2BRUHOO2xGMb50OkUXy2YrZYS8Gd2EjQsB22+ RkZJGkJ9zBF3CN3FggfV28OPQhUakURWS6ylZCAXut3f04jTYF1HF3YAyRrl6gkjtF3M rnpIE3WIHCUk+D+DcP8WZKoneLCZk2Z5Rj1GJ6aOMt/OhLe58ESgcKFqqCVXfmYNwYZs u0Ixfkl59LJ6CKMXhVQTSnLSBh7Zb+AGMoeaYdrRPi9wgBBhKLVGaM2cWUgRNb5+bkPs KF3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cern.onmicrosoft.com header.s=selector1-cern-ch header.b="BDFOk/N+"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h16si8808711pgj.203.2019.02.11.00.32.13; Mon, 11 Feb 2019 00:32:29 -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=@cern.onmicrosoft.com header.s=selector1-cern-ch header.b="BDFOk/N+"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727137AbfBKIb6 (ORCPT + 99 others); Mon, 11 Feb 2019 03:31:58 -0500 Received: from mail-eopbgr30062.outbound.protection.outlook.com ([40.107.3.62]:14976 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727122AbfBKIb4 (ORCPT ); Mon, 11 Feb 2019 03:31:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cern.onmicrosoft.com; s=selector1-cern-ch; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GjQ9QyCeVGip3EFBe+bgRB73v6AVcBnsli83BKrpBVI=; b=BDFOk/N+SLkTa1DmihqrvV3a4HAle2shgMq2HH2z/CO/hCTcKj2vBSilizmzUE58rhokNJ1SXXoTwTAZilxM0Qfp90690QYd6wsKwAL/rqYSNqDkdXrgl2ECr/+qpHpxt6DVY7zfrf31L7HAeEjXnDcZXgHCqxcQjpUNYa85rc0= Received: from VI1PR06CA0128.eurprd06.prod.outlook.com (2603:10a6:803:a0::21) by AM4PR0601MB2146.eurprd06.prod.outlook.com (2603:10a6:200:47::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.22; Mon, 11 Feb 2019 08:31:52 +0000 Received: from AM5EUR02FT051.eop-EUR02.prod.protection.outlook.com (2a01:111:f400:7e1e::207) by VI1PR06CA0128.outlook.office365.com (2603:10a6:803:a0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.17 via Frontend Transport; Mon, 11 Feb 2019 08:31:52 +0000 Authentication-Results: spf=pass (sender IP is 188.184.36.48) smtp.mailfrom=cern.ch; korsgaard.com; dkim=none (message not signed) header.d=none;korsgaard.com; dmarc=bestguesspass action=none header.from=cern.ch; Received-SPF: Pass (protection.outlook.com: domain of cern.ch designates 188.184.36.48 as permitted sender) receiver=protection.outlook.com; client-ip=188.184.36.48; helo=cernmxgwlb4.cern.ch; Received: from cernmxgwlb4.cern.ch (188.184.36.48) by AM5EUR02FT051.mail.protection.outlook.com (10.152.9.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1580.10 via Frontend Transport; Mon, 11 Feb 2019 08:31:52 +0000 Received: from cernfe03.cern.ch (188.184.36.39) by cernmxgwlb4.cern.ch (188.184.36.48) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 11 Feb 2019 09:31:40 +0100 Received: from cwe-513-vol689.cern.ch (188.185.69.206) by smtp.cern.ch (188.184.36.52) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 11 Feb 2019 09:31:38 +0100 From: Federico Vaga To: Peter Korsgaard , Andrew Lunn CC: , , Federico Vaga Subject: [PATCH v4 5/5] i2c:ocores: checkpatch fixes Date: Mon, 11 Feb 2019 09:31:22 +0100 Message-ID: <20190211083122.32485-6-federico.vaga@cern.ch> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190211083122.32485-1-federico.vaga@cern.ch> References: <20190211083122.32485-1-federico.vaga@cern.ch> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [188.185.69.206] X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:188.184.36.48;IPV:NLI;CTRY:CH;EFV:NLI;SFV:NSPM;SFS:(10009020)(346002)(396003)(136003)(376002)(39860400002)(2980300002)(199004)(189003)(4326008)(426003)(486006)(66066001)(8936002)(106002)(126002)(16586007)(476003)(110136005)(11346002)(54906003)(956004)(2616005)(106466001)(336012)(8676002)(51416003)(44832011)(7696005)(47776003)(446003)(246002)(36756003)(6116002)(3846002)(316002)(76176011)(50226002)(7636002)(7736002)(2906002)(305945005)(786003)(74482002)(1076003)(356004)(50466002)(16526019)(86362001)(6666004)(53416004)(14444005)(107886003)(478600001)(26005)(186003)(48376002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM4PR0601MB2146;H:cernmxgwlb4.cern.ch;FPR:;SPF:Pass;LANG:en;PTR:cernmx12.cern.ch;A:1;MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d5bbab8b-f647-422a-bf7e-08d68ffb5fa1 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(5600110)(711020)(4605077)(4608076)(4709027)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:AM4PR0601MB2146; X-MS-TrafficTypeDiagnostic: AM4PR0601MB2146: X-Microsoft-Exchange-Diagnostics: 1;AM4PR0601MB2146;20:QaySrzPlhZBe7x3L3WUnD91O2PV1g7IbAqZqpBqDBmIrYL+hIRVrP4ehEAeFzSGi+XeqSQLl3xHUMHbKhMKuC84bK/NUUwS/fX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Km9l0FaQWbXlQUvZ9oUA87MTfNhynZyItStFNKDAueSXb9YTFndZPeWp3/rbycO6mmaKK3+6l98g==;5:lBwY/Oy+3il7jD6uR+HKPTJRvVOfaVC+Bvj4GpZvyIV2m5fHr6/xrLHgcaCcfRu0h7UfKbc5ZjqN4UNM7C6963y0wzzhhCbnjR9kc3FgezEVBafFuxYUhUhjsV9DT7fWI0cp8TQNZNNMTuUGP/GtmG3BoufjdjEjEYpsigKSK6avsquTCnkCHGs8Sb5yFJNONgH7jrmHPs0jpl7SQcxwLQ==;7:rePxF7Gj0T8H/jusM0bXugVCbi3/EAZpKuLI8xEnInjKl60SaWePkF3CerfobDVfgG94WWghJMtcfhLcKt9rvwRl6q2pgY/DUSSosvfwMIA1LV5kl6bSpQsWj7t3GjGF/Zffx/9y5q0iBIeHXyxk4w== X-OriginatorOrg: cern.ch X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2019 08:31:52.0980 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d5bbab8b-f647-422a-bf7e-08d68ffb5fa1 X-MS-Exchange-CrossTenant-Id: c80d3499-4a40-4a8c-986e-abce017d6b19 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c80d3499-4a40-4a8c-986e-abce017d6b19;Ip=[188.184.36.48];Helo=[cernmxgwlb4.cern.ch] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0601MB2146 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Miscellaneous style fixes from checkpatch Signed-off-by: Federico Vaga Reviewed-by: Andrew Lunn --- drivers/i2c/busses/i2c-ocores.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c index 5b80190..ba35d2a 100644 --- a/drivers/i2c/busses/i2c-ocores.c +++ b/drivers/i2c/busses/i2c-ocores.c @@ -182,8 +182,9 @@ static void ocores_process(struct ocores_i2c *i2c, u8 stat) oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_STOP); goto out; } - } else + } else { msg->buf[i2c->pos++] = oc_getreg(i2c, OCI2C_DATA); + } /* end of msg? */ if (i2c->pos == msg->len) { @@ -202,9 +203,9 @@ static void ocores_process(struct ocores_i2c *i2c, u8 stat) oc_setreg(i2c, OCI2C_DATA, addr); oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_START); goto out; - } else - i2c->state = (msg->flags & I2C_M_RD) - ? STATE_READ : STATE_WRITE; + } + i2c->state = (msg->flags & I2C_M_RD) + ? STATE_READ : STATE_WRITE; } else { i2c->state = STATE_DONE; oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_STOP); @@ -405,7 +406,8 @@ static int ocores_init(struct device *dev, struct ocores_i2c *i2c) u8 ctrl = oc_getreg(i2c, OCI2C_CONTROL); /* make sure the device is disabled */ - oc_setreg(i2c, OCI2C_CONTROL, ctrl & ~(OCI2C_CTRL_EN|OCI2C_CTRL_IEN)); + ctrl &= ~(OCI2C_CTRL_EN | OCI2C_CTRL_IEN); + oc_setreg(i2c, OCI2C_CONTROL, ctrl); prescale = (i2c->ip_clock_khz / (5 * i2c->bus_clock_khz)) - 1; prescale = clamp(prescale, 0, 0xffff); @@ -462,11 +464,13 @@ MODULE_DEVICE_TABLE(of, ocores_i2c_match); #ifdef CONFIG_OF /* Read and write functions for the GRLIB port of the controller. Registers are * 32-bit big endian and the PRELOW and PREHIGH registers are merged into one - * register. The subsequent registers has their offset decreased accordingly. */ + * register. The subsequent registers has their offset decreased accordingly. + */ static u8 oc_getreg_grlib(struct ocores_i2c *i2c, int reg) { u32 rd; int rreg = reg; + if (reg != OCI2C_PRELOW) rreg--; rd = ioread32be(i2c->base + (rreg << i2c->reg_shift)); @@ -480,6 +484,7 @@ static void oc_setreg_grlib(struct ocores_i2c *i2c, int reg, u8 value) { u32 curr, wr; int rreg = reg; + if (reg != OCI2C_PRELOW) rreg--; if (reg == OCI2C_PRELOW || reg == OCI2C_PREHIGH) { @@ -568,7 +573,7 @@ static int ocores_i2c_of_probe(struct platform_device *pdev, return 0; } #else -#define ocores_i2c_of_probe(pdev,i2c) -ENODEV +#define ocores_i2c_of_probe(pdev, i2c) -ENODEV #endif static int ocores_i2c_probe(struct platform_device *pdev) -- 2.15.0