Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1764063pxb; Sat, 14 Nov 2020 01:15:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwDt/n0f37W78RrO/PycYF31J0eaZk5oDrLZhyCfQBBALaFGKklBqlTUqKM/vvlJknsv9bZ X-Received: by 2002:a17:906:4748:: with SMTP id j8mr5682037ejs.22.1605345317548; Sat, 14 Nov 2020 01:15:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605345317; cv=none; d=google.com; s=arc-20160816; b=TLIXTtBwgdsKvK/WN6zKkXjPS6QjWKJdSs8iM9iZfe4BZYGCRot42KPTHFY5hLD1o1 ZhtsmFyVO3fCF/SgGrrONcySW2lx2N1tK5z3MIak7TMFc6Wfca3X9UQuaOcUJLbkR6Z3 pPfu074YbyFnVIuDLBKjgkCj5unrlShFJQQ3dmGE9GpXfXABRhta08Ibx/IFVOxgjTmO 2Yd1LdEfy3+hIB24HxyuSgMpTtkOFLMzKojeQiUjz0tS9yQxfN80FfpknDICdacuO4Ut 7dezX5iiQGaIQqJnxuxKuD1KMpu4VTok3HFGsU3pNOQxAs33u/JKBzB8kHfoYz/h9omc DbyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=HI6uQXTwp0djXBVm2SF6W9uNzBlymQB/lFcx03dLH8U=; b=KYQ1z3H46pdatnoOKHYJt7+ObB2zRqMrDhfB/Pv8hm+6b8YJeZMoUUEHTO58xAyxAL Ey/EtIawlv9KVDvzIcYKw+k27s8lp1+OwTj73R9LiBaxTu7DHhpt3fnvC9BrJzq8Hq1k KtOvXWZRuT2IEwvpBwOlzrSoow/kkQ0rCm4w2r7raspTAfXkIFolLUBE5d8SpJ0RuHbm 6tsyscMn9Wkcu1/un+PY46e54xWIgW5F/TsCeKi2dKI6K4f6J2gZiqriq0G6tcL8C2a0 mPS0jGpqmn7JauM+ImhlZfMQSMkOadr+Csg2aK5xUENt/2NHpwW2q8S3tyOvb0FP2Zci DtoQ== 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 x18si8339028ejd.193.2020.11.14.01.14.55; Sat, 14 Nov 2020 01:15:17 -0800 (PST) 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 S1726543AbgKNJMs (ORCPT + 99 others); Sat, 14 Nov 2020 04:12:48 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:7901 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726356AbgKNJMr (ORCPT ); Sat, 14 Nov 2020 04:12:47 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4CY8k81rT9z76d8; Sat, 14 Nov 2020 17:12:32 +0800 (CST) Received: from linux-lmwb.huawei.com (10.175.103.112) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.487.0; Sat, 14 Nov 2020 17:12:34 +0800 From: Zou Wei To: , CC: , Zou Wei Subject: [PATCH -next] mfd: altera-sysmgr: Use resource_size function on resource object Date: Sat, 14 Nov 2020 17:24:20 +0800 Message-ID: <1605345860-23521-1-git-send-email-zou_wei@huawei.com> X-Mailer: git-send-email 2.6.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.103.112] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ./drivers/mfd/altera-sysmgr.c:155:36-39: WARNING: Suspicious code. resource_size is maybe missing with res Generated by: scripts/coccinelle/api/resource_size.cocci Signed-off-by: Zou Wei --- drivers/mfd/altera-sysmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/altera-sysmgr.c b/drivers/mfd/altera-sysmgr.c index 41076d1..193a96c 100644 --- a/drivers/mfd/altera-sysmgr.c +++ b/drivers/mfd/altera-sysmgr.c @@ -152,7 +152,7 @@ static int sysmgr_probe(struct platform_device *pdev) if (!base) return -ENOMEM; - sysmgr_config.max_register = res->end - res->start - 3; + sysmgr_config.max_register = resource_size(res) - 3; regmap = devm_regmap_init_mmio(dev, base, &sysmgr_config); } -- 2.6.2