From patchwork Thu Oct 12 02:48:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rongwei Wang X-Patchwork-Id: 151666 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp945473vqb; Wed, 11 Oct 2023 19:49:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFyegjig6utyd1jCeMTKc5oc+rC5YwvU2eQ4GJSNXy1yw6WLpu2V64jyilgbIYNr+0RbR+g X-Received: by 2002:a17:90b:3b50:b0:27d:1593:2b0b with SMTP id ot16-20020a17090b3b5000b0027d15932b0bmr1951173pjb.0.1697078970500; Wed, 11 Oct 2023 19:49:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697078970; cv=none; d=google.com; s=arc-20160816; b=YUAtiTSBmAJEqWdjc2RxHLkEJaxCrT5D+fYZAF93oGncYe4rfeqQA+T6EhDEFrWKzr vwPGZ218luZQANM3/OHTisRkXlrAKjjRUGn3N1cW9ob98KnjXVqfnwrpqV6fqyYe3bZV EM1s8azzr7h/WO3MCP24GO4ZNMP2F+2WosNnr0xYwnR5wzzqG1hlbas7wAfuqZ3T6KRj fAMVM0BUXxFjEWICClErXgevRP41lUHjpGtO7wQM2eJNdmp3TuOKUy213FjdBfSOBMai yH0BX5WVFYivwssER3WU/ZujXUX4HQbwseLJkwSwQKqiPDRGzqZvG4J5aDzYrcWTmG7u 0O+w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=VR7wPq0C0mPYrOmbzB0ZF5iIStSetPqgvjgy4RyVjjM=; fh=ZYoHe1wlSxRVpYSXw5DcseDzNzuurc0wqkDMPTWnoPk=; b=r68MsR5kb0ua3w65CWbiIXoAlsjVqhsoLwb+7iAc1YKv68SqWzo3SpWPAOXX+i7AKR ccceODh+tsr+n2rkNO7WAoW0TAfLcmjj6E43ikqjO3vFp0wtya3tcGkxb0dXczMayhjP WpUGulCn/Yt6LuVuFbut551CJtS3ulv5wbZBNWggxbLV5Qm4OfiP3nSQojH0AsBICoCE 3FVSOTuJJidvipIDwHzlEZzCpP0ikOSwfHIb9QBoeWjpeWiTlXpIy/+jH0wErVUZLiFI iGLqmXEo0UJpEJUIJ3FKKTloeBMPvxIpFtOtZAt5i5Rx3VGXASaTcwdkfOGr5+S+BAyj e5yw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id o18-20020a170902779200b001c61226fe40si988057pll.392.2023.10.11.19.49.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 19:49:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B85B48206D6D; Wed, 11 Oct 2023 19:49:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235314AbjJLCtW (ORCPT + 18 others); Wed, 11 Oct 2023 22:49:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235276AbjJLCsy (ORCPT ); Wed, 11 Oct 2023 22:48:54 -0400 Received: from out30-124.freemail.mail.aliyun.com (out30-124.freemail.mail.aliyun.com [115.124.30.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96508A9 for ; Wed, 11 Oct 2023 19:48:52 -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=ay29a033018045192;MF=rongwei.wang@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0VtykMgL_1697078929; Received: from localhost.localdomain(mailfrom:rongwei.wang@linux.alibaba.com fp:SMTPD_---0VtykMgL_1697078929) by smtp.aliyun-inc.com; Thu, 12 Oct 2023 10:48:49 +0800 From: Rongwei Wang To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, willy@infradead.org, catalin.marinas@arm.com, dave.hansen@linux.intel.com, tj@kernel.org, mingo@redhat.com Subject: [PATCH RFC 2/5] mm: percpu: fix variable type of cpu Date: Thu, 12 Oct 2023 10:48:39 +0800 Message-Id: <20231012024842.99703-3-rongwei.wang@linux.alibaba.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20231012024842.99703-1-rongwei.wang@linux.alibaba.com> References: <20231012024842.99703-1-rongwei.wang@linux.alibaba.com> MIME-Version: 1.0 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 11 Oct 2023 19:49:29 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779516278601836678 X-GMAIL-MSGID: 1779516278601836678 Almost all places declare 'cpu' as 'unsigned int' type, but early_cpu_to_nod() not. So correct it in this patch. Signed-off-by: Rongwei Wang --- drivers/base/arch_numa.c | 2 +- include/linux/percpu.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/base/arch_numa.c b/drivers/base/arch_numa.c index eaa31e567d1e..db0bb8b8fd67 100644 --- a/drivers/base/arch_numa.c +++ b/drivers/base/arch_numa.c @@ -144,7 +144,7 @@ void __init early_map_cpu_to_node(unsigned int cpu, int nid) unsigned long __per_cpu_offset[NR_CPUS] __read_mostly; EXPORT_SYMBOL(__per_cpu_offset); -static int __init early_cpu_to_node(int cpu) +static int __init early_cpu_to_node(unsigned int cpu) { return cpu_to_node_map[cpu]; } diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 68fac2e7cbe6..4aee8400af54 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h @@ -100,7 +100,7 @@ extern const char * const pcpu_fc_names[PCPU_FC_NR]; extern enum pcpu_fc pcpu_chosen_fc; -typedef int (pcpu_fc_cpu_to_node_fn_t)(int cpu); +typedef int (pcpu_fc_cpu_to_node_fn_t)(unsigned int cpu); typedef int (pcpu_fc_cpu_distance_fn_t)(unsigned int from, unsigned int to); extern struct pcpu_alloc_info * __init pcpu_alloc_alloc_info(int nr_groups,