From patchwork Wed Nov 24 02:36:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Li X-Patchwork-Id: 12635891 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DF7DC433EF for ; Wed, 24 Nov 2021 02:36:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240753AbhKXCjl (ORCPT ); Tue, 23 Nov 2021 21:39:41 -0500 Received: from out30-57.freemail.mail.aliyun.com ([115.124.30.57]:51447 "EHLO out30-57.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235796AbhKXCjl (ORCPT ); Tue, 23 Nov 2021 21:39:41 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R581e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04423;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0Uy37Bby_1637721389; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0Uy37Bby_1637721389) by smtp.aliyun-inc.com(127.0.0.1); Wed, 24 Nov 2021 10:36:30 +0800 From: Yang Li To: davem@davemloft.net Cc: kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li Subject: [PATCH -next 1/2] tsnep: fix resource_size.cocci warnings Date: Wed, 24 Nov 2021 10:36:23 +0800 Message-Id: <1637721384-70836-1-git-send-email-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Use resource_size function on resource object instead of explicit computation. Clean up coccicheck warning: ./drivers/net/ethernet/engleder/tsnep_main.c:1155:21-24: ERROR: Missing resource_size with io Reported-by: Abaci Robot Signed-off-by: Yang Li --- drivers/net/ethernet/engleder/tsnep_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/engleder/tsnep_main.c b/drivers/net/ethernet/engleder/tsnep_main.c index 6a7feb2..c48e8ea 100644 --- a/drivers/net/ethernet/engleder/tsnep_main.c +++ b/drivers/net/ethernet/engleder/tsnep_main.c @@ -1152,7 +1152,7 @@ static int tsnep_probe(struct platform_device *pdev) adapter->addr = devm_ioremap_resource(&pdev->dev, io); if (IS_ERR(adapter->addr)) return PTR_ERR(adapter->addr); - adapter->size = io->end - io->start + 1; + adapter->size = resource_size(io); adapter->irq = platform_get_irq(pdev, 0); netdev->mem_start = io->start; netdev->mem_end = io->end; From patchwork Wed Nov 24 02:36:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Li X-Patchwork-Id: 12635893 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3014C433EF for ; Wed, 24 Nov 2021 02:36:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240763AbhKXCjo (ORCPT ); Tue, 23 Nov 2021 21:39:44 -0500 Received: from out30-45.freemail.mail.aliyun.com ([115.124.30.45]:44960 "EHLO out30-45.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235796AbhKXCjo (ORCPT ); Tue, 23 Nov 2021 21:39:44 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0Uy37Bby_1637721389; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0Uy37Bby_1637721389) by smtp.aliyun-inc.com(127.0.0.1); Wed, 24 Nov 2021 10:36:33 +0800 From: Yang Li To: davem@davemloft.net Cc: kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li Subject: [PATCH -next 2/2] tsnep: fix platform_no_drv_owner.cocci warning Date: Wed, 24 Nov 2021 10:36:24 +0800 Message-Id: <1637721384-70836-2-git-send-email-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1637721384-70836-1-git-send-email-yang.lee@linux.alibaba.com> References: <1637721384-70836-1-git-send-email-yang.lee@linux.alibaba.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Remove .owner field if calls are used which set it automatically Eliminate the following coccicheck warning: ./drivers/net/ethernet/engleder/tsnep_main.c:1263:3-8: No need to set .owner here. The core will do it. Reported-by: Abaci Robot Signed-off-by: Yang Li Reviewed-by: Gerhard Engleder --- drivers/net/ethernet/engleder/tsnep_main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/engleder/tsnep_main.c b/drivers/net/ethernet/engleder/tsnep_main.c index c48e8ea..3d0408e 100644 --- a/drivers/net/ethernet/engleder/tsnep_main.c +++ b/drivers/net/ethernet/engleder/tsnep_main.c @@ -1260,7 +1260,6 @@ static int tsnep_remove(struct platform_device *pdev) static struct platform_driver tsnep_driver = { .driver = { .name = TSNEP, - .owner = THIS_MODULE, .of_match_table = of_match_ptr(tsnep_of_match), }, .probe = tsnep_probe,