Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6396984iog; Thu, 23 Jun 2022 18:51:52 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u45P9hG06/IQWieXRwfiahRZCnMWdOEgfha4vQnQJqfvXSgUml+1MG8cPt7391ogpneg+K X-Received: by 2002:a17:90a:aa10:b0:1ec:b5a7:9e23 with SMTP id k16-20020a17090aaa1000b001ecb5a79e23mr1023893pjq.191.1656035512668; Thu, 23 Jun 2022 18:51:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656035512; cv=none; d=google.com; s=arc-20160816; b=qqkCa338q9UuwkUBEGwDRqJxBTsZI7Kjvx3gfAAL3DUq6468KYdHlLs+uwsFrGbDpr /QvPpfrHE79e5e+3UtzHn7uYnk26D06Cz7YbjPVLOEsi3VwqovjkuqLX46FHL1kuOd6M g61C3bhXNCE7NvsPexWNCfIm+pF53e68DlPsX+tQshH1Iz2NOlV3kHCWwf9Pc/5jdWPc acqaebAb3namEss7akwYh7HEpMDgUCfLhPcf131Brq9jkD+eP4BEQVr5cCbf4PPQMYPb HftBrKoIQb6ReGO7yVsFbTTstlhJpSgIQOstipIS4zSo5AItIc0TBJJHv76lCQFk4wfs 1KjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=hx1umJZxjMIYOfhrqz1oUNimzD5po0GBg23KYAuQ91E=; b=HLdZ830bMT/ezcgbdliK+FwG7dkJM9LHJQGPHciznbqiMTj2EbvdOpFG2vdtsZf7gX O561SwjMd/fY2iLjl1b9vFnbUgCTaivvN6tRSMNHt88/GjiMsgU0r5cS62l7Xd7m6n58 ovJzkZ8ECsYgneVB2HHdGSHEtAvGrlGqfP4EUiN5WCb+07X1j0E7ib356iO9j9vfLckV w+DkYV0rl93XQ4nkwrhl8G6/7xIjk2MNhiDQwqsDdOlndFigXLgtM102vZe5lR5ZZWii bybZ85XePydJhMTzzibkvzbUOwy2E577LxZ1S6W1oP8txSoOPilK0N4r+rBqqtV51hCp Da9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o5-20020a170903300500b001674c1a3475si1154470pla.126.2022.06.23.18.51.41; Thu, 23 Jun 2022 18:51:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231230AbiFXBdZ (ORCPT + 99 others); Thu, 23 Jun 2022 21:33:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231217AbiFXBdX (ORCPT ); Thu, 23 Jun 2022 21:33:23 -0400 Received: from out30-57.freemail.mail.aliyun.com (out30-57.freemail.mail.aliyun.com [115.124.30.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFFC117E1D; Thu, 23 Jun 2022 18:33:19 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0VHEl8m6_1656034321; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0VHEl8m6_1656034321) by smtp.aliyun-inc.com; Fri, 24 Jun 2022 09:33:17 +0800 From: Jiapeng Chong To: paul@crapouillou.net Cc: airlied@linux.ie, daniel@ffwll.ch, linux-mips@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jiapeng Chong Subject: [PATCH] drm/ingenic: Use resource_size function on resource object Date: Fri, 24 Jun 2022 09:31:59 +0800 Message-Id: <20220624013159.88646-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This was found by coccicheck: ./drivers/gpu/drm/ingenic/ingenic-drm-drv.c:1149:35-38: WARNING: Suspicious code. resource_size is maybe missing with res. Signed-off-by: Jiapeng Chong --- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c index 2c559885347a..5514b163999f 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c @@ -1146,7 +1146,7 @@ static int ingenic_drm_bind(struct device *dev, bool has_components) } regmap_config = ingenic_drm_regmap_config; - regmap_config.max_register = res->end - res->start; + regmap_config.max_register = resource_size(res); priv->map = devm_regmap_init_mmio(dev, base, ®map_config); if (IS_ERR(priv->map)) { -- 2.20.1.7.g153144c