Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2513302yba; Fri, 17 May 2019 19:33:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqxF8Aq+DMcjeZUcec7bLq6B/QX9qk4EH+UvOmUNq7AkeY68w5DDg9CUxeyfuxueIorzkD+e X-Received: by 2002:a17:902:b695:: with SMTP id c21mr61360712pls.160.1558146819310; Fri, 17 May 2019 19:33:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558146819; cv=none; d=google.com; s=arc-20160816; b=RdEeIyAkRWOsUr7Tpv/oQK6HUNVRmgpHTh3J5jeotfseYCVAgEs5lXNeZNJYNWUd8L XacXNnO+aoRUpNiPe92mAvSm7fQPQC7n4Wu26kPHxvem8F5ww/TigRe0PGU7uermNhBA WYCwGzY1fTZxnXpWx07cBzzt1AlAjto43hLFTzKmbpxAJkQ0bVAlJithN9wnHZAQjV12 4+qzmZwdYbNEDz1bhhIi31roUwtxcH8dS6U0AAmKRT3MxuyebdodqVL4I8w8R3YS+0d9 3JtufiO0aEASieQ2LzzfyoDI6b8NYA6dU1ewLxsw78HlYx/Zn+vxhDMvKpxsNMgpV1By Jwbg== 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:date:subject:to:from :dkim-signature; bh=NZaB6D1v98BSotvfZL2UYvLWY18MGsNTAI6RIeVlR9A=; b=VWbuEvD+sHKLNJAEoq62O3w+kEEbzc9mFX3vIOSAFI+OQ4Uj+UUEc0Zhd8KbQGwxZf pkt1QpKyzW04p9KFBPphUFOI2bhWJmAFFk/MBEcgiq9Mbh0wVHcWBvbdvwkjlJ3YZaQN A6opp54SFwdto4L2COYdNbNOfdbSRjhmsqnHlld164Yx9BRMUpQM9a0aP4/gwnRk9AQt bKJ8OoufSQ+2dIfkOslRd3Fu/IrwMGa/zisvrmRQABdX+19rIXtAuZxEYAx365OQTtB8 xvuHgTGWqAB1rUAI/FR13/kwNYuy951+XV+uXfwssx+3AE+FQUs5YGVeHcW/Q2e16sNc vJVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mhEakHBC; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o20si9659369pgm.94.2019.05.17.19.33.24; Fri, 17 May 2019 19:33:39 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=mhEakHBC; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728395AbfERCbM (ORCPT + 99 others); Fri, 17 May 2019 22:31:12 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:36041 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727367AbfERCbL (ORCPT ); Fri, 17 May 2019 22:31:11 -0400 Received: by mail-qk1-f194.google.com with SMTP id c14so5669922qke.3 for ; Fri, 17 May 2019 19:31:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=NZaB6D1v98BSotvfZL2UYvLWY18MGsNTAI6RIeVlR9A=; b=mhEakHBCsSo1vVLiZzDZ24I9vPAulkvQqO9q3eJQWCDmrjVmDQ1TGGoOXp/4rHREdC t8i/LLizPaikksaU7F7jiyPkYgwKagRwUyebTPft8eqtXD0FfoFtnkq+7MfUddkIf7Bv LvMyh5Bm9VJ5xKpfoQPNr7S7Kt+gs0xu7ZhJekfIs76iTX509aKPjO6L8lTmtC1anWT0 y9gso/Tsj84CsNkUAnNhLUpFnaHLK4vwpiJDKB2GWY4dCwrIOH7v/oWv34eF9H6kuOWg 7VaRPmSIW4ogTPqxz1W+r66PwmUhiSfN1OakzM4oh1uIc0IikVGrVUT+bQTmgVwayUN/ JjMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NZaB6D1v98BSotvfZL2UYvLWY18MGsNTAI6RIeVlR9A=; b=nSS83H2/QEQ5jwrz3h6XJ7dO4ZKFWY5i7BSXsjET2FDsJ4Jf+q/HggOSc9pDYwFFqd AzO17qxhyTAuCPQZgkVkJxYb0HWtXhB3bji1qHxvYHTmYv+a0kVRbXdAAThnS13gRjr7 Oe4UkqRlWNHg3c5EY0pPhgfq9wh+fb5n5e4JVqFEqDL+lrGJMPq5UlGgZKBLoIxpRcfv fPdYy1ltKnfHWfHTgUpydEmmoTpR3cx312WJj72QQPTkXYuotvN5Ikg+QCcEHXhXJKRX CjP9Q5sztxmnSQd3UZKxPnLm67GOyhPy+xzF5T/pqrM57JO8xhsXQxlRCx5eBwbAnRAX lukA== X-Gm-Message-State: APjAAAVTHQXBTin9/OwypVlgQCtW7COiIB6YSGMQiH48IRb4GWmhIeuw RuaBcISQw6El2ycKBeYPIM0= X-Received: by 2002:a05:620a:15ac:: with SMTP id f12mr37585531qkk.311.1558146670637; Fri, 17 May 2019 19:31:10 -0700 (PDT) Received: from arch-01.home (c-73-132-202-198.hsd1.dc.comcast.net. [73.132.202.198]) by smtp.gmail.com with ESMTPSA id n66sm5210322qke.6.2019.05.17.19.31.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 May 2019 19:31:10 -0700 (PDT) From: Geordan Neukum To: gneukum1@gmail.com, Greg Kroah-Hartman , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] staging: kpc2000: kpc_i2c: use %s with __func__ identifier in log messages Date: Sat, 18 May 2019 02:29:59 +0000 Message-Id: X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Throughout i2c_driver.c, there are instances where the log strings contain the function's name hardcoded into the string. Instead, use the printk conversion specifier '%s' with the __func__ preprocessor identifier to more maintainably print the function's name. Signed-off-by: Geordan Neukum --- drivers/staging/kpc2000/kpc_i2c/i2c_driver.c | 27 +++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/staging/kpc2000/kpc_i2c/i2c_driver.c b/drivers/staging/kpc2000/kpc_i2c/i2c_driver.c index 9b9de81c8548..03e401322a18 100644 --- a/drivers/staging/kpc2000/kpc_i2c/i2c_driver.c +++ b/drivers/staging/kpc2000/kpc_i2c/i2c_driver.c @@ -142,7 +142,7 @@ static int i801_check_pre(struct i2c_device *priv) { int status; - dev_dbg(&priv->adapter.dev, "i801_check_pre\n"); + dev_dbg(&priv->adapter.dev, "%s\n", __func__); status = inb_p(SMBHSTSTS(priv)); if (status & SMBHSTSTS_HOST_BUSY) { @@ -168,7 +168,7 @@ static int i801_check_post(struct i2c_device *priv, int status, int timeout) { int result = 0; - dev_dbg(&priv->adapter.dev, "i801_check_post\n"); + dev_dbg(&priv->adapter.dev, "%s\n", __func__); /* If the SMBus is still busy, we give up */ if (timeout) { @@ -219,7 +219,7 @@ static int i801_transaction(struct i2c_device *priv, int xact) int result; int timeout = 0; - dev_dbg(&priv->adapter.dev, "i801_transaction\n"); + dev_dbg(&priv->adapter.dev, "%s\n", __func__); result = i801_check_pre(priv); if (result < 0) { @@ -250,7 +250,7 @@ static void i801_wait_hwpec(struct i2c_device *priv) int timeout = 0; int status; - dev_dbg(&priv->adapter.dev, "i801_wait_hwpec\n"); + dev_dbg(&priv->adapter.dev, "%s\n", __func__); do { usleep_range(250, 500); @@ -269,7 +269,7 @@ static int i801_block_transaction_by_block(struct i2c_device *priv, union i2c_sm int i, len; int status; - dev_dbg(&priv->adapter.dev, "i801_block_transaction_by_block\n"); + dev_dbg(&priv->adapter.dev, "%s\n", __func__); inb_p(SMBHSTCNT(priv)); /* reset the data buffer index */ @@ -309,7 +309,7 @@ static int i801_block_transaction_byte_by_byte(struct i2c_device *priv, union i2 int result; int timeout; - dev_dbg(&priv->adapter.dev, "i801_block_transaction_byte_by_byte\n"); + dev_dbg(&priv->adapter.dev, "%s\n", __func__); result = i801_check_pre(priv); if (result < 0) { @@ -383,7 +383,7 @@ static int i801_block_transaction_byte_by_byte(struct i2c_device *priv, union i2 static int i801_set_block_buffer_mode(struct i2c_device *priv) { - dev_dbg(&priv->adapter.dev, "i801_set_block_buffer_mode\n"); + dev_dbg(&priv->adapter.dev, "%s\n", __func__); outb_p(inb_p(SMBAUXCTL(priv)) | SMBAUXCTL_E32B, SMBAUXCTL(priv)); if ((inb_p(SMBAUXCTL(priv)) & SMBAUXCTL_E32B) == 0) { @@ -398,7 +398,7 @@ static int i801_block_transaction(struct i2c_device *priv, union i2c_smbus_data int result = 0; //unsigned char hostc; - dev_dbg(&priv->adapter.dev, "i801_block_transaction\n"); + dev_dbg(&priv->adapter.dev, "%s\n", __func__); if (command == I2C_SMBUS_I2C_BLOCK_DATA) { if (read_write == I2C_SMBUS_WRITE) { @@ -450,8 +450,9 @@ static s32 i801_access(struct i2c_adapter *adap, u16 addr, unsigned short flags, int ret, xact = 0; struct i2c_device *priv = i2c_get_adapdata(adap); - dev_dbg(&priv->adapter.dev, "i801_access (addr=%0d) flags=%x read_write=%x command=%x size=%x", - addr, flags, read_write, command, size ); + dev_dbg(&priv->adapter.dev, + "%s (addr=%0d) flags=%x read_write=%x command=%x size=%x", + __func__, addr, flags, read_write, command, size); hwpec = (priv->features & FEATURE_SMBUS_PEC) && (flags & I2C_CLIENT_PEC) && size != I2C_SMBUS_QUICK && size != I2C_SMBUS_I2C_BLOCK_DATA; @@ -626,7 +627,8 @@ int pi2c_probe(struct platform_device *pldev) struct i2c_device *priv; struct resource *res; - dev_dbg(&pldev->dev, "pi2c_probe(pldev = %p '%s')\n", pldev, pldev->name); + dev_dbg(&pldev->dev, "%s(pldev = %p '%s')\n", __func__, pldev, + pldev->name); priv = devm_kzalloc(&pldev->dev, sizeof(*priv), GFP_KERNEL); if (!priv) { @@ -673,7 +675,8 @@ int pi2c_probe(struct platform_device *pldev) int pi2c_remove(struct platform_device *pldev) { struct i2c_device *lddev; - dev_dbg(&pldev->dev, "pi2c_remove(pldev = %p '%s')\n", pldev, pldev->name); + dev_dbg(&pldev->dev, "%s(pldev = %p '%s')\n", __func__, pldev, + pldev->name); lddev = (struct i2c_device *)pldev->dev.platform_data; -- 2.21.0