Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2957789pxb; Sun, 26 Sep 2021 00:48:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCvscemggb5tyoImdJH5Kn5bUi/OXelfYn4OpALfurz7VH8eBPCTC/N63m6cLk/quBj19D X-Received: by 2002:a17:907:1ddd:: with SMTP id og29mr3878994ejc.501.1632642513902; Sun, 26 Sep 2021 00:48:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632642513; cv=none; d=google.com; s=arc-20160816; b=Lm5f2KLG+NyiF3Y30vxjNKg4bjLZSXget+zSiD7WXJzNrpctGhJII87o1XqOhM3/yG GDVKnO+6lQVh0eKAXu3+RpwuVr78FDER5mhdIZ9ectEjuL8d46/kQ6bUMJ4vW6o9qhFP RUu/yKI9hzF5v6QRavcXumsmnXTaUL1P3sEHVKMIhOyv98hL7t19pg+Wuzn4xhOaWGqK IEHyyZARKiU4NZSobiP84D/ieaE1M6DHb+j6NdIQqdlFpacBC30AMYdBCQNxlNYYlglo Tt21xP/MZFHF/CfCVpLjCuzs+tCYuPseCnDBA45qx6MRh1Lorfxz3i0YNv/C6mGkatdP 0OLA== 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=cljzLB45Lk1ZShArNE2JPyOOaKVtaGyxe96Duac+/Ns=; b=u3TBAagxTasN1v9GqOpYOjDtbc//zWf/46J/MBuL7lwXq4kV0ZbBb7lGQhuZhCP3Ul 8/oNLcxX0dY9BHNpQfJUvP+7J1pVu5pbebTOjU7NqqNxLuvJRjdEeyguQVscXRRjEBNt E61XPXWN7AM0Sh1sCkkxXx5KYU4uohGgicCAjMhtnRoMaXmoeMWkIF6MrtEE5wjDA56a 9oz7nNeAJ0kFqpBUd+QYR2o6sSSFZZj8uT/CwWwD5Zkh7ngbbBUNRtIQnkAny5VmadNI jxp1zsFVgKfoN3IJsyWnHfYjswqegCN6Sw1ma0eepcaS8tlXEiRDzD7wdjk8DM5Z6irq 8dNw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j2si4648109ejo.29.2021.09.26.00.47.56; Sun, 26 Sep 2021 00:48:33 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231236AbhIZHn6 (ORCPT + 99 others); Sun, 26 Sep 2021 03:43:58 -0400 Received: from out30-131.freemail.mail.aliyun.com ([115.124.30.131]:40217 "EHLO out30-131.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230340AbhIZHn6 (ORCPT ); Sun, 26 Sep 2021 03:43:58 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04395;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0Upb0.bA_1632642138; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0Upb0.bA_1632642138) by smtp.aliyun-inc.com(127.0.0.1); Sun, 26 Sep 2021 15:42:19 +0800 From: Yang Li To: davem@davemloft.net Cc: kuba@kernel.org, lars.povlsen@microchip.com, Steen.Hegelund@microchip.com, UNGLinuxDriver@microchip.com, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Yang Li Subject: [PATCH] net: sparx5: fix resource_size.cocci warnings Date: Sun, 26 Sep 2021 15:42:12 +0800 Message-Id: <1632642132-79551-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: linux-kernel@vger.kernel.org Use resource_size function on resource object instead of explicit computation. Clean up coccicheck warning: ./drivers/net/ethernet/microchip/sparx5/sparx5_main.c:237:19-22: ERROR: Missing resource_size with iores [ idx ] Reported-by: Abaci Robot Signed-off-by: Yang Li --- drivers/net/ethernet/microchip/sparx5/sparx5_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c index cbece6e..c6eb0b7 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c @@ -234,8 +234,7 @@ static int sparx5_create_targets(struct sparx5 *sparx5) } iomem[idx] = devm_ioremap(sparx5->dev, iores[idx]->start, - iores[idx]->end - iores[idx]->start - + 1); + resource_size(iores[idx])); if (!iomem[idx]) { dev_err(sparx5->dev, "Unable to get switch registers: %s\n", iores[idx]->name); -- 1.8.3.1