Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4062988pxb; Mon, 4 Oct 2021 16:32:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCrdVc2FWBL/bzPIVRjSaWSJUu8S0JLlh/GV62I49vapGk8GNmTG2qVpvDT7bhlm5iubz8 X-Received: by 2002:a50:9d0f:: with SMTP id v15mr21895489ede.275.1633390363083; Mon, 04 Oct 2021 16:32:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633390363; cv=none; d=google.com; s=arc-20160816; b=cKpmNhnRmj19V3HlyXh8YwN3rhcX9iCXMr33xk3icQUtZqI6P0H+r9BNKKWM3CjV7q 5aLBg1I1ZsGz+4kPVZ5JxCfnxjk9lgwe7u4Pdrdgx0a078YKstBeZWjmvdwRD0NbjLvh /VwrrdpR4YIzSes1zW4zojPaTanxKZNUdk9SYkmc0xTS+rDWbJ2dtyeX7/aZT5YLCnF2 4JvscFOrjuIqgd+hKgVxJM+tbgNoXoV4P4sFvCkF/G5vUDTQNZgHGR6aWdY6whQayDFB 8JA4AGrixG+kZAl2+Ye1eoHe0IGGu8OtMqxD1c5kmWD6e7HoP3FgVIgUGvpZJ72FT1Eq ADug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=DHNaQQHi7hNZ23P7b8lQ+OjND7rNc8bX1seiwOi+5ks=; b=MKLqdTbUAmM3byoTrkIAKWPSR5EDxO9vKM4tGKsquJOUZI6Skq/d6taqzwSIb3GS/i PzHnB5EMeS2wslrLxXU4YXbiyabx7tN3JSzzUkW4VRlheVsSw4f15HoB1nIs0eXwDQaP vj6m+Pn8ShRAh3SLO8Ati45/lHIy2pwRdtcfISoGWL1O854qExSxonheIvZIRmQncy/t G+dueZST8H1tWZQRbvDrCqQmF3J98EMl8PGoL7l4hmqhtOiB8N5ZEBEPldOChokIG0Sr ClXZXmdKnumdLvpJxhFyDLKNuKAGQQkgi6DfJ78Jm77mBuv0n7maMer+Ham1ZezrfSNR SKnA== 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 hr6si3218472ejc.711.2021.10.04.16.32.19; Mon, 04 Oct 2021 16:32:43 -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; 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 S233558AbhJDTG0 (ORCPT + 99 others); Mon, 4 Oct 2021 15:06:26 -0400 Received: from mail-wm1-f48.google.com ([209.85.128.48]:52798 "EHLO mail-wm1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238867AbhJDTGN (ORCPT ); Mon, 4 Oct 2021 15:06:13 -0400 Received: by mail-wm1-f48.google.com with SMTP id m42so3730071wms.2; Mon, 04 Oct 2021 12:04:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=DHNaQQHi7hNZ23P7b8lQ+OjND7rNc8bX1seiwOi+5ks=; b=wg1IwUJZk8/tJubB1FjnM60BihWF4ew8UXr3YsCbDr9nUHtjIiG+TkoVzMpXwxHGyW g5uBr3mW9ztFaIJPMtDjYvYkh9hc6NGyd8l0XZT/oUtyCdNjfGaMMBVQkKC4cpsHCbFA Qa38yjAmI99TscY9g82e0jqo5PZrUeQKBxk23ZC7OlQhOA/C79W2jO9XonO0cEVZeJiF JNFbB302HD4XEnodd4TN1M9xLEpvjz/jg0hFogya1vr6H5gjd+24u+BGciJ113rpyuJV YJaoWj6iSSSLsColMt8HCs88DJGhUbVBijCiLUTNEsfHSzvhf79RUyc/lYIgxfAcWE4G Lm/w== X-Gm-Message-State: AOAM530/oiDoMPOJb1qlm9zXr9TtV2x59p7/sJiUrZJwNwUOvTXoiyrG Cd66CmHZ+2BevQCXsBr7h7KDvOLYgkE= X-Received: by 2002:a05:600c:291:: with SMTP id 17mr5611853wmk.131.1633374263137; Mon, 04 Oct 2021 12:04:23 -0700 (PDT) Received: from rocinante ([95.155.85.46]) by smtp.gmail.com with ESMTPSA id x10sm14089683wmk.42.2021.10.04.12.04.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 12:04:22 -0700 (PDT) Date: Mon, 4 Oct 2021 21:04:21 +0200 From: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= To: Max Gurtovoy Cc: hch@infradead.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, linux-pci@vger.kernel.org, bhelgaas@google.com, stefanha@redhat.com, oren@nvidia.com Subject: Re: [PATCH v3 2/2] PCI/sysfs: use NUMA_NO_NODE macro Message-ID: References: <20211004133453.18881-1-mgurtovoy@nvidia.com> <20211004133453.18881-2-mgurtovoy@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211004133453.18881-2-mgurtovoy@nvidia.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Max! > Use the proper macro instead of hard-coded (-1) value. > > Suggested-by: Krzysztof Wilczyński > Reviewed-by: Krzysztof Wilczyński > Reviewed-by: Stefan Hajnoczi > Signed-off-by: Max Gurtovoy > --- > drivers/pci/pci-sysfs.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c > index 7fb5cd17cc98..f807b92afa6c 100644 > --- a/drivers/pci/pci-sysfs.c > +++ b/drivers/pci/pci-sysfs.c > @@ -81,8 +81,10 @@ static ssize_t pci_dev_show_local_cpu(struct device *dev, bool list, > const struct cpumask *mask; > > #ifdef CONFIG_NUMA > - mask = (dev_to_node(dev) == -1) ? cpu_online_mask : > - cpumask_of_node(dev_to_node(dev)); > + if (dev_to_node(dev) == NUMA_NO_NODE) > + mask = cpu_online_mask; > + else > + mask = cpumask_of_node(dev_to_node(dev)); > #else > mask = cpumask_of_pcibus(to_pci_dev(dev)->bus); > #endif > -- > 2.18.1 Thank you! Krzysztof