Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4807874iob; Mon, 9 May 2022 02:02:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7LfyJ/dHLzD1cwcjE21V6cwaN/mp3iFRcFoaMUxJmf0ss9aP3/pLZ/TiEVWI5faD9ZYkq X-Received: by 2002:a05:6a00:15c7:b0:510:48c9:f302 with SMTP id o7-20020a056a0015c700b0051048c9f302mr15161245pfu.23.1652086931276; Mon, 09 May 2022 02:02:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652086931; cv=none; d=google.com; s=arc-20160816; b=iz5I4w+NsBtHUtHIcuBdKRezEsbfKEuOKwgly2e5ZkFPIp1xJvr42p1LOhPRIT9fIC uzGrXkS+uBxGQ+S2rJX7aL4bkHnNMtoFle1zDPiL4osoS/8HAwLK8SGm3O59On3p68ao diZDaLlRZTS20EAKXPLG2CoGzGFKEqtZb4CtKS8/noh01r1s2iudWFpgN6KjjO7QSWi6 /btzFauFYb7FGPOs/V0Q4+mvMHW77+gI1JCN/vg3d2GvpBa6sMkGykkXtxT+kHOheH47 UojlzdYx5oGoQKEJQzuGtHrbsMR5itBF1775bXlyjNEN9iSTE2KBZrvx8uq7+MDg+F+x /EDw== 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=hGDK0GV1u0+X5jP9IKqLBclTAlZmIi09ilOQD0uJkKg=; b=kTaS/xo0MEepgbWRknELVWbAVcckzpzxsm2J8ADNWzDpVUqD84GOJf87n9LgDuRLFZ FqfkXGT3UGCrJmGdQbgvj21zQzhxMwi2LfQpji2Hi+h+Cmt20QJgpWO5EFqddEyUwdcc ucqTvrUhkL7DlCWuCLospigKz5Fo+2q2j1C7A6jhcP19wrTWCZ5jfe9t3WidBs6/muVb 3561mCKGX/4RjJELYrvJk2YXvSKuxDOMxlktIgbN9gcP7ToNsGSGXegXDRYdlaL8Wy0v I3BKWGAMkzCQLmRWD1keY0tlF6CKNiY4aSdnnsmrtd08y44P6EVyCKqjaMrP8fzSGqwL Bnbw== 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: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g18-20020a056a00079200b0050bb3e9c4f7si12336826pfu.134.2022.05.09.02.02.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 02:02:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D763A1B793E; Mon, 9 May 2022 01:49:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1445421AbiEGD3R (ORCPT + 99 others); Fri, 6 May 2022 23:29:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442292AbiEGD3O (ORCPT ); Fri, 6 May 2022 23:29:14 -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 A0603B1DB for ; Fri, 6 May 2022 20:25:27 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R671e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04407;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0VCUhL69_1651893913; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0VCUhL69_1651893913) by smtp.aliyun-inc.com(127.0.0.1); Sat, 07 May 2022 11:25:24 +0800 From: Jiapeng Chong To: sj@kernel.org Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH] mm/damon/reclaim: Use resource_size function on resource object Date: Sat, 7 May 2022 11:25:12 +0800 Message-Id: <20220507032512.129598-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=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no 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 Fix the following coccicheck warnings: ./mm/damon/reclaim.c:241:30-33: WARNING: Suspicious code. resource_size is maybe missing with res. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- mm/damon/reclaim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/damon/reclaim.c b/mm/damon/reclaim.c index f37c5d4b27fa..8efbfb24f3a1 100644 --- a/mm/damon/reclaim.c +++ b/mm/damon/reclaim.c @@ -238,7 +238,7 @@ static int walk_system_ram(struct resource *res, void *arg) { struct damon_reclaim_ram_walk_arg *a = arg; - if (a->end - a->start < res->end - res->start) { + if (a->end - a->start < resource_size(res)) { a->start = res->start; a->end = res->end; } -- 2.20.1.7.g153144c