From patchwork Fri Jul 17 14:08:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 6816041 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C9F90C05AC for ; Fri, 17 Jul 2015 14:09:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D42A62060B for ; Fri, 17 Jul 2015 14:09:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E52A820751 for ; Fri, 17 Jul 2015 14:09:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758016AbbGQOJF (ORCPT ); Fri, 17 Jul 2015 10:09:05 -0400 Received: from sauhun.de ([89.238.76.85]:45229 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757828AbbGQOJE (ORCPT ); Fri, 17 Jul 2015 10:09:04 -0400 Received: from p4fe258cf.dip0.t-ipconnect.de ([79.226.88.207]:49569 helo=localhost) by pokefinder.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1ZG6Jy-0006Zp-4D; Fri, 17 Jul 2015 16:09:02 +0200 From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: linux-sh@vger.kernel.org, Magnus Damm , Simon Horman , Laurent Pinchart , Geert Uytterhoeven , Wolfram Sang , Andrey Danin , linux-tegra@vger.kernel.org Subject: [RFC 5/9] i2c: rename address check functions Date: Fri, 17 Jul 2015 16:08:25 +0200 Message-Id: <1437142109-31975-6-git-send-email-wsa@the-dreams.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1437142109-31975-1-git-send-email-wsa@the-dreams.de> References: <1437142109-31975-1-git-send-email-wsa@the-dreams.de> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wolfram Sang The current naming is based on the arguments of the functions and not on what they do. Even I as the maintainer find this confusing, so let's rename them to something more descriptive. Signed-off-by: Wolfram Sang --- drivers/i2c/i2c-core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index a807e272e1fc2e..b54a0f092d53f6 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -793,7 +793,7 @@ static unsigned short i2c_encode_flags_to_addr(struct i2c_client *client) /* This is a permissive address validity check, I2C address map constraints * are purposely not enforced, except for the general call address. */ -static int i2c_check_client_addr_validity(const struct i2c_client *client) +static int i2c_check_addr_validity(const struct i2c_client *client) { if (client->flags & I2C_CLIENT_TEN) { /* 10-bit address, all values are valid */ @@ -811,7 +811,7 @@ static int i2c_check_client_addr_validity(const struct i2c_client *client) * device uses a reserved address, then it shouldn't be probed. 7-bit * addressing is assumed, 10-bit address devices are rare and should be * explicitly enumerated. */ -static int i2c_check_addr_validity(unsigned short addr) +static int i2c_check_7bit_addr_validity_strict(unsigned short addr) { /* * Reserved addresses per I2C specification: @@ -980,7 +980,7 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info) strlcpy(client->name, info->type, sizeof(client->name)); /* Check for address validity */ - status = i2c_check_client_addr_validity(client); + status = i2c_check_addr_validity(client); if (status) { dev_err(&adap->dev, "Invalid %d-bit I2C address 0x%02hx\n", client->flags & I2C_CLIENT_TEN ? 10 : 7, client->addr); @@ -2265,7 +2265,7 @@ static int i2c_detect_address(struct i2c_client *temp_client, int err; /* Make sure the address is valid */ - err = i2c_check_addr_validity(addr); + err = i2c_check_7bit_addr_validity_strict(addr); if (err) { dev_warn(&adapter->dev, "Invalid probe address 0x%02x\n", addr); @@ -2382,7 +2382,7 @@ 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) { + if (i2c_check_7bit_addr_validity_strict(addr_list[i]) < 0) { dev_warn(&adap->dev, "Invalid 7-bit address " "0x%02x\n", addr_list[i]); continue; @@ -2957,7 +2957,7 @@ int i2c_slave_register(struct i2c_client *client, i2c_slave_cb_t slave_cb) if (!(client->flags & I2C_CLIENT_TEN)) { /* Enforce stricter address checking */ - ret = i2c_check_addr_validity(client->addr); + ret = i2c_check_7bit_addr_validity_strict(client->addr); if (ret) { dev_err(&client->dev, "%s: invalid address\n", __func__); return ret;