Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3523025pxj; Mon, 7 Jun 2021 12:56:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEQsOFBzxIMQCkoC2HcWSB0v5TOjRkz0f7vCCQ7tFaakFl0ToJlReOQWXeJqGpaNT7i/UG X-Received: by 2002:a05:6402:845:: with SMTP id b5mr21451198edz.266.1623095780317; Mon, 07 Jun 2021 12:56:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623095780; cv=none; d=google.com; s=arc-20160816; b=sqUzom0oCC8VoehNUQA/fZpRoZAtkolPegwWZSsvF7Chk+a62fv+3LZTb/NpLepqzr IIz9lfZOgTTeNzd8ihOlxW2ruzecSTrg/BtA02rRAHXJAhT55pEbOv7cynCiW8pAd4ap P4SZ9CrjrIhZ6DnlcJAYBOtp6+vMPWweaiE9CWxDor1suFX0d7kbve9mCzhT1IQIW0ak Ak9n2eeUig3eyuzJBT0jFQcGxpbsYRwvm36er/Ht0Mr/hL4nLEEIb4m6pO1Ihk8yCpMy 4f9zENjfgE5JGngKX0UR99H2oUMRkNUPgOM0UI/zULWbezfjrnLcxijmvCMcq+0hg7cp xhSg== 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 :dkim-signature; bh=q50miELZBDJItXtYwAibMviHcNFzP32Zr9gGDf9CmwQ=; b=kxOq+S0pxRalvsOrmjRsPEQYCTUOxoo2MWBLFDbQSHKSY7rqgTT1ipX+f9p5AUPc0I w3oNL5npsyYu1WLD/Us8DyDhSzDPNqSG5WgUx1jrRQ4DO1uw7BxF5Oek21I4jjJgg6yv 0/4t6pFk4K3Gg7hgrRnkaulV9SWfrdWrLfGod0yaKZIbhGS1H4+W/Ld3ZOQ+rcR54hVy itogpKIm1nEDfysQdNmpbPU9TComQxDQspQquY+ufA2c88dLowaMAherP7OB+QohqHd1 cRVl4xXwDZhcz7lSK1f+25PdFeea4eqTYZYOdMK+0MP3VRmYFpL+dJZFXC3+/HPo3NDd Vn1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="aZpGZ7e/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ec4si13907702ejb.244.2021.06.07.12.55.56; Mon, 07 Jun 2021 12:56:20 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="aZpGZ7e/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231263AbhFGT4p (ORCPT + 99 others); Mon, 7 Jun 2021 15:56:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:21096 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230351AbhFGT4n (ORCPT ); Mon, 7 Jun 2021 15:56:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623095691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=q50miELZBDJItXtYwAibMviHcNFzP32Zr9gGDf9CmwQ=; b=aZpGZ7e/a3AxZuFyM7a66VO4yLa12LLYTw28Y5PySONxLTmWQUv6NBpOd4faMOgN5KF1N8 Hlim0dOj0bnz8RM4IDCBwz3M9WOepYi0xBDrVARtJR6tx93i7Mwh9ok9g/g/C+7X+369+n fC/EcP+0Qv64FjPiaF0vcx2TlIpsZxw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-460-KFMsgfAJMCuHwnRYnG1I3w-1; Mon, 07 Jun 2021 15:54:50 -0400 X-MC-Unique: KFMsgfAJMCuHwnRYnG1I3w-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8EF3F107ACCD; Mon, 7 Jun 2021 19:54:47 +0000 (UTC) Received: from t480s.redhat.com (ovpn-112-9.ams2.redhat.com [10.36.112.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 393041002D71; Mon, 7 Jun 2021 19:54:43 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: David Hildenbrand , Andrew Morton , Vitaly Kuznetsov , "Michael S. Tsirkin" , Jason Wang , Marek Kedzierski , Hui Zhu , Pankaj Gupta , Wei Yang , Oscar Salvador , Michal Hocko , Dan Williams , Anshuman Khandual , Dave Hansen , Vlastimil Babka , Mike Rapoport , "Rafael J. Wysocki" , Len Brown , Pavel Tatashin , virtualization@lists.linux-foundation.org, linux-mm@kvack.org, linux-acpi@vger.kernel.org Subject: [PATCH v1 01/12] mm/memory_hotplug: use "unsigned long" for PFN in zone_for_pfn_range() Date: Mon, 7 Jun 2021 21:54:19 +0200 Message-Id: <20210607195430.48228-2-david@redhat.com> In-Reply-To: <20210607195430.48228-1-david@redhat.com> References: <20210607195430.48228-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Checkpatch complained on a follow-up patch that we are using "unsigned" here, which defaults to "unsigned int" and checkpatch is correct. Use "unsigned long" instead, just as we do in other places when handling PFNs. This can bite us once we have physical addresses in the range of multiple TB. Fixes: e5e689302633 ("mm, memory_hotplug: display allowed zones in the preferred ordering") Signed-off-by: David Hildenbrand --- include/linux/memory_hotplug.h | 4 ++-- mm/memory_hotplug.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 28f32fd00fe9..57a8aa463ccb 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h @@ -366,8 +366,8 @@ extern void sparse_remove_section(struct mem_section *ms, unsigned long map_offset, struct vmem_altmap *altmap); extern struct page *sparse_decode_mem_map(unsigned long coded_mem_map, unsigned long pnum); -extern struct zone *zone_for_pfn_range(int online_type, int nid, unsigned start_pfn, - unsigned long nr_pages); +extern struct zone *zone_for_pfn_range(int online_type, int nid, + unsigned long start_pfn, unsigned long nr_pages); extern int arch_create_linear_mapping(int nid, u64 start, u64 size, struct mhp_params *params); void arch_remove_linear_mapping(u64 start, u64 size); diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 70620d0dd923..4969614d2140 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -834,8 +834,8 @@ static inline struct zone *default_zone_for_pfn(int nid, unsigned long start_pfn return movable_node_enabled ? movable_zone : kernel_zone; } -struct zone *zone_for_pfn_range(int online_type, int nid, unsigned start_pfn, - unsigned long nr_pages) +struct zone *zone_for_pfn_range(int online_type, int nid, + unsigned long start_pfn, unsigned long nr_pages) { if (online_type == MMOP_ONLINE_KERNEL) return default_kernel_zone_for_pfn(nid, start_pfn, nr_pages); -- 2.31.1