Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5468684pxj; Wed, 23 Jun 2021 01:46:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnxCX0ogyDbaaaXghg+Sgromy850XoOnRSRaFFg5vWAv85Dce01qGpYT8jE75CaEX0f+EQ X-Received: by 2002:a02:8588:: with SMTP id d8mr7870261jai.118.1624437973587; Wed, 23 Jun 2021 01:46:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624437973; cv=none; d=google.com; s=arc-20160816; b=jBql6KS+E4yXKWjUBM7oqhbPQlM9dop9xnXPORz0fWF2mwuuENMAZolAdVV0h7F2sm xuT5Ydh3/3YQQ767TgaaPinX6r4ENVUx23SLN9+k/TZ/7pJcTgzm8jM+3zwqa6vs6we3 k/oQeC/Q5tNn90+62PhA0V7r8Dt4SeCTmPVmy6RIrZAgklhNIa4s0LWPeMBZJIXJT4I4 Hy1VttLAnCKETJGNwVD9n3QU8BJ0TbXUq2AjfdpxCG4rJAqCUT7KexOMSXhhTICua4qX NanXW0H3ufihz1/utWtgzYkXMfoSUt4+7UasAcyh8GsEYQO49uUbxJ5YwW+k9JAAGN6I dMKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=GB18Z5SryujM6CeBwwDua2/LNdFCoUpKQSqcTQmDdUc=; b=cJx/GYzfBU6VzJ7gfDcLwSVPswXUhspHZ4bF3+08V8brfC1FJQO3sYKgwzuMTPWmyQ sq6LX7uheKF2hcAJvHWUwwrYxzuj1urK5S/vJBQy86xHsplkuavVgnz33afbs42U4f53 pieLJEFn1QdXG3jQrdcfLb97HWnfQdTnDNq/SXSGFjYNLxY0T9oGs0ToCdTdizS/FpNU S+b3K2w0a4iObj7rOeRRFgug3aCznJIeK1/rbKXW8nGc5QW+PIGIpBmZJB1cdJyiPjEs YhZ/5bibW32qAVHl//BrYXxUQzQhgQcL8+x8VG+zM3/ChHvSQZWGB6mW7JiNs6mPJr31 k+yQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z11si2023671jap.110.2021.06.23.01.46.01; Wed, 23 Jun 2021 01:46:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230039AbhFWIqR (ORCPT + 99 others); Wed, 23 Jun 2021 04:46:17 -0400 Received: from smtp3.hiworks.co.kr ([121.254.168.205]:34611 "EHLO smtp3.hiworks.co.kr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229833AbhFWIqO (ORCPT ); Wed, 23 Jun 2021 04:46:14 -0400 X-Greylist: delayed 398 seconds by postgrey-1.27 at vger.kernel.org; Wed, 23 Jun 2021 04:46:14 EDT Received: (qmail 155736 invoked from network); 23 Jun 2021 17:37:15 +0900 Received: from unknown (HELO hiworks.co.kr) (192.168.10.101) by 0 (qmail 1.03 + ejcp v14) with SMTP; 23 Jun 2021 17:37:15 +0900 Received: (qmail 109303 invoked from network); 23 Jun 2021 17:37:15 +0900 Received: from unknown (HELO localhost.localdomain) (tykwon@m2i.co.kr@58.75.176.98) by 0 (qmail 1.03 + ejcp v14) with SMTP; 23 Jun 2021 17:37:15 +0900 X-Authinfo: HIWORKS SMTP authenticated From: Kwon Tae-young To: Oleksij Rempel , Pengutronix Kernel Team , Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team Cc: Kwon Tae-young , linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] i2c/imx: Fix some checkpatch warnings Date: Wed, 23 Jun 2021 17:36:43 +0900 Message-Id: <20210623083643.395-1-tykwon@m2i.co.kr> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the following warnings reported by checkpatch:: drivers/i2c/busses/i2c-imx.c:173: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' drivers/i2c/busses/i2c-imx.c:175: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' drivers/i2c/busses/i2c-imx.c:176: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' drivers/i2c/busses/i2c-imx.c:177: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' drivers/i2c/busses/i2c-imx.c:455: WARNING: Unnecessary ftrace-like logging - prefer using ftrace drivers/i2c/busses/i2c-imx.c:602: WARNING: Unnecessary ftrace-like logging - prefer using ftrace drivers/i2c/busses/i2c-imx.c:638: WARNING: Unnecessary ftrace-like logging - prefer using ftrace drivers/i2c/busses/i2c-imx.c:1170: WARNING: Unnecessary ftrace-like logging - prefer using ftrace drivers/i2c/busses/i2c-imx.c:1374: WARNING: Unnecessary ftrace-like logging - prefer using ftrace drivers/i2c/busses/i2c-imx.c:1398: WARNING: Prefer strscpy over strlcpy - see: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Kwon Tae-young --- drivers/i2c/busses/i2c-imx.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index dc5ca71906db..d5b5f084a27d 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -170,11 +170,11 @@ enum imx_i2c_type { struct imx_i2c_hwdata { enum imx_i2c_type devtype; - unsigned regshift; + unsigned int regshift; struct imx_i2c_clk_pair *clk_div; - unsigned ndivs; - unsigned i2sr_clr_opcode; - unsigned i2cr_ien_opcode; + unsigned int ndivs; + unsigned int i2sr_clr_opcode; + unsigned int i2cr_ien_opcode; }; struct imx_i2c_dma { @@ -452,8 +452,6 @@ static int i2c_imx_bus_busy(struct imx_i2c_struct *i2c_imx, int for_busy, bool a unsigned long orig_jiffies = jiffies; unsigned int temp; - dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__); - while (1) { temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2SR); @@ -599,8 +597,6 @@ static int i2c_imx_start(struct imx_i2c_struct *i2c_imx, bool atomic) unsigned int temp = 0; int result; - dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__); - imx_i2c_write_reg(i2c_imx->ifdr, i2c_imx, IMX_I2C_IFDR); /* Enable I2C controller */ imx_i2c_write_reg(i2c_imx->hwdata->i2sr_clr_opcode, i2c_imx, IMX_I2C_I2SR); @@ -635,7 +631,6 @@ static void i2c_imx_stop(struct imx_i2c_struct *i2c_imx, bool atomic) if (!i2c_imx->stopped) { /* Stop I2C transaction */ - dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__); temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR); if (!(temp & I2CR_MSTA)) i2c_imx->stopped = 1; @@ -1167,8 +1162,6 @@ static int i2c_imx_xfer_common(struct i2c_adapter *adapter, bool is_lastmsg = false; struct imx_i2c_struct *i2c_imx = i2c_get_adapdata(adapter); - dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__); - /* Start I2C transfer */ result = i2c_imx_start(i2c_imx, atomic); if (result) { @@ -1371,8 +1364,6 @@ static int i2c_imx_probe(struct platform_device *pdev) dma_addr_t phy_addr; const struct imx_i2c_hwdata *match; - dev_dbg(&pdev->dev, "<%s>\n", __func__); - irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; @@ -1395,7 +1386,7 @@ static int i2c_imx_probe(struct platform_device *pdev) platform_get_device_id(pdev)->driver_data; /* Setup i2c_imx driver structure */ - strlcpy(i2c_imx->adapter.name, pdev->name, sizeof(i2c_imx->adapter.name)); + strscpy(i2c_imx->adapter.name, pdev->name, sizeof(i2c_imx->adapter.name)); i2c_imx->adapter.owner = THIS_MODULE; i2c_imx->adapter.algo = &i2c_imx_algo; i2c_imx->adapter.dev.parent = &pdev->dev; -- 2.17.1