From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBACDC433EF for ; Wed, 6 Oct 2021 16:44:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C914C61130 for ; Wed, 6 Oct 2021 16:44:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239474AbhJFQpz (ORCPT ); Wed, 6 Oct 2021 12:45:55 -0400 Received: from mail-oo1-f41.google.com ([209.85.161.41]:36628 "EHLO mail-oo1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239476AbhJFQpp (ORCPT ); Wed, 6 Oct 2021 12:45:45 -0400 Received: by mail-oo1-f41.google.com with SMTP id e19-20020a4a7353000000b002b5a2c0d2b8so1029974oof.3; Wed, 06 Oct 2021 09:43:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qVDBxu87TJi7lJ0TsvF77hW6cToukGJnTBFK4bAPEHE=; b=yK4hHPrJnssJl72XgmZ9NbKgB+3h/U3+gTnqb0YNqjkHpu1j8D3hNTaK3yGbgAJq8d bAmEzwSzcMtAQDMnteCAkdbK4pXAlpPfJzrgN0w4H5vvfi5knIM/2ORXE556NGhk+kvU kYkfnZruyykjXwB9YVTz7uE3R+xiWHw5OfzFl5KLUIirNyEYvqK3xRP60q5BCXRd4lgI NqDqIZSKlnLNfVWIEfJczsXfZUumIIKmuBvHacdbVQFDXxQktOvzN0kqtTV8EWDpZNQb 1fdtPzUzz8neXqmq5jnye2bjusqMFuRDl9Dv/qTDxsophjznuq1x9ALq7MNCF2PWSme3 7txw== X-Gm-Message-State: AOAM5339ZnVjNt1rY9IHmf/ZW1KkVkqyvc2ipKgoieQzp0otrOZxPp55 RFubDWIanJ/fTxsa+j1Hbw== X-Google-Smtp-Source: ABdhPJwSo3vtevHig5e6wcfYzHn+p/9LVu6izXiBqHPOZc+ml50aXK5vctwJYkE3EswfiMHjHBf9ng== X-Received: by 2002:a4a:e597:: with SMTP id o23mr6391984oov.96.1633538632948; Wed, 06 Oct 2021 09:43:52 -0700 (PDT) Received: from xps15.herring.priv (66-90-148-213.dyn.grandenetworks.net. [66.90.148.213]) by smtp.googlemail.com with ESMTPSA id s29sm4236628otg.60.2021.10.06.09.43.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 09:43:52 -0700 (PDT) From: Rob Herring To: Russell King , James Morse , Catalin Marinas , Will Deacon , Guo Ren , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Michael Ellerman , Paul Walmsley , Palmer Dabbelt , Albert Ou , Yoshinori Sato , Rich Felker , x86@kernel.org, Greg Kroah-Hartman Cc: Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Benjamin Herrenschmidt , Paul Mackerras , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "Rafael J. Wysocki" , Frank Rowand , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, openrisc@lists.librecores.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 09/12] sh: Use of_get_cpu_hwid() Date: Wed, 6 Oct 2021 11:43:29 -0500 Message-Id: <20211006164332.1981454-10-robh@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211006164332.1981454-1-robh@kernel.org> References: <20211006164332.1981454-1-robh@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Replace open coded parsing of CPU nodes' 'reg' property with of_get_cpu_hwid(). Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org Signed-off-by: Rob Herring --- arch/sh/boards/of-generic.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/sh/boards/of-generic.c b/arch/sh/boards/of-generic.c index 921d76fc3358..f7f3e618e85b 100644 --- a/arch/sh/boards/of-generic.c +++ b/arch/sh/boards/of-generic.c @@ -62,9 +62,8 @@ static void sh_of_smp_probe(void) init_cpu_possible(cpumask_of(0)); for_each_of_cpu_node(np) { - const __be32 *cell = of_get_property(np, "reg", NULL); - u64 id = -1; - if (cell) id = of_read_number(cell, of_n_addr_cells(np)); + u64 id = of_get_cpu_hwid(np, 0); + if (id < NR_CPUS) { if (!method) of_property_read_string(np, "enable-method", &method); -- 2.30.2 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39CECC433EF for ; Wed, 6 Oct 2021 16:48:03 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D444260235 for ; Wed, 6 Oct 2021 16:48:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D444260235 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HPgPF2SGrz3dqJ for ; Thu, 7 Oct 2021 03:48:01 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=209.85.161.45; helo=mail-oo1-f45.google.com; envelope-from=robherring2@gmail.com; receiver=) Received: from mail-oo1-f45.google.com (mail-oo1-f45.google.com [209.85.161.45]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4HPgJW29VQz3053 for ; Thu, 7 Oct 2021 03:43:55 +1100 (AEDT) Received: by mail-oo1-f45.google.com with SMTP id w9-20020a4adec9000000b002b696945457so525062oou.10 for ; Wed, 06 Oct 2021 09:43:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qVDBxu87TJi7lJ0TsvF77hW6cToukGJnTBFK4bAPEHE=; b=lDMywqzDoduj0F5CrdYXWcq4Z0x2mAxy4uZ5km3xe0CaIUxPxQa4JAs/nzNwWdF/bX 0niELS8zwEazuEKNIRCuLRAvg+0/LYk7QZi6jPy8eyn/61I0P3BI3SgoqdpodkDul4gX IufnmEcpcXM1ohKoVFs6PYf4fPuGqFSIt/BGOEmdIMu58/y9EAY98JlzDI+Eu1GIz58Z oqDCCKI10LV71CZ920pNOrOVr9Wb9IlXM3vb+/s5PJ/tbK6Qz2dwk36Wpaluv7CSws5A 9cRUc4pPqz+pFzu3FXgm7QdIfHUerSmfkfr5f4kZCxoCCjDxvnG648qfWFERfZuRdc+h URsQ== X-Gm-Message-State: AOAM532nhmnl3BziJMqrFj2PKq7VAFWk5DqfNUzrdBTNL4gmJ9SWU2ix 8wuoT+c7uCbtMNygBQ96PQ== X-Google-Smtp-Source: ABdhPJwSo3vtevHig5e6wcfYzHn+p/9LVu6izXiBqHPOZc+ml50aXK5vctwJYkE3EswfiMHjHBf9ng== X-Received: by 2002:a4a:e597:: with SMTP id o23mr6391984oov.96.1633538632948; Wed, 06 Oct 2021 09:43:52 -0700 (PDT) Received: from xps15.herring.priv (66-90-148-213.dyn.grandenetworks.net. [66.90.148.213]) by smtp.googlemail.com with ESMTPSA id s29sm4236628otg.60.2021.10.06.09.43.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 09:43:52 -0700 (PDT) From: Rob Herring To: Russell King , James Morse , Catalin Marinas , Will Deacon , Guo Ren , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Michael Ellerman , Paul Walmsley , Palmer Dabbelt , Albert Ou , Yoshinori Sato , Rich Felker , x86@kernel.org, Greg Kroah-Hartman Subject: [PATCH 09/12] sh: Use of_get_cpu_hwid() Date: Wed, 6 Oct 2021 11:43:29 -0500 Message-Id: <20211006164332.1981454-10-robh@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211006164332.1981454-1-robh@kernel.org> References: <20211006164332.1981454-1-robh@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Florian Fainelli , Scott Branden , "Rafael J. Wysocki" , linux-sh@vger.kernel.org, Ray Jui , "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, openrisc@lists.librecores.org, linuxppc-dev@lists.ozlabs.org, Ingo Molnar , Paul Mackerras , Borislav Petkov , bcm-kernel-feedback-list@broadcom.com, Thomas Gleixner , Frank Rowand , linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Replace open coded parsing of CPU nodes' 'reg' property with of_get_cpu_hwid(). Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org Signed-off-by: Rob Herring --- arch/sh/boards/of-generic.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/sh/boards/of-generic.c b/arch/sh/boards/of-generic.c index 921d76fc3358..f7f3e618e85b 100644 --- a/arch/sh/boards/of-generic.c +++ b/arch/sh/boards/of-generic.c @@ -62,9 +62,8 @@ static void sh_of_smp_probe(void) init_cpu_possible(cpumask_of(0)); for_each_of_cpu_node(np) { - const __be32 *cell = of_get_property(np, "reg", NULL); - u64 id = -1; - if (cell) id = of_read_number(cell, of_n_addr_cells(np)); + u64 id = of_get_cpu_hwid(np, 0); + if (id < NR_CPUS) { if (!method) of_property_read_string(np, "enable-method", &method); -- 2.30.2 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32B17C43217 for ; Wed, 6 Oct 2021 16:49:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 05ED860FDA for ; Wed, 6 Oct 2021 16:49:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 05ED860FDA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cFFlPJzCAFIyiNlo7Ypty/G4tHq4FKcSEBWbw7vWDWQ=; b=QbMH8FbZXKFQJL qbioKUXUvXndpfpJOFXodUcpxBefmu7xbcyzDzaBi8W035Ti577tC4vMzGYM1dQH9/zLJXi1wLbBl WN2SFgL6uK5ZLHrU/NYonAim4/LzTcNiPI2sZmt43oL+J+OdbWIgfI3IWJEqoRTiNstCEQzO2MESY ZTPRo05/kjBK3vwek2dn5Xa0q3wOX/RtIq46EElzUJc9O8NUL742FmXEGiPHnaMCHlvxBlYuhIEBW tEuC/9myEHk3PqH2JNsP/OR96zI1Xavkq2KdGSbc3NEzrRZsAkTOfWYV12xmTw4pEBroOthJuBJGC ONLOln6/FWURV07R+1Fw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYA6K-00F4qr-3W; Wed, 06 Oct 2021 16:49:04 +0000 Received: from mail-oo1-f43.google.com ([209.85.161.43]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYA1K-00F2AT-Bn; Wed, 06 Oct 2021 16:43:55 +0000 Received: by mail-oo1-f43.google.com with SMTP id w6-20020a4aa446000000b002b5795cca03so1019054ool.6; Wed, 06 Oct 2021 09:43:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qVDBxu87TJi7lJ0TsvF77hW6cToukGJnTBFK4bAPEHE=; b=ErP6xKV+ALlmtyXriN1EaAi0d2nXxaNoWiTfPt61DFyIJqR+a3bmDeThgXvfUQJu5A mAkt8RnqRNypTfjm9RinH1U3Mm7rWvIgrcic3y/04JECec27nwjhKBZN/VT1puKnMa8l gX8tezSHUdQFqXNH4l0XL4HN8sNUxx2sNHNIr4EdtqsWrZi7PR6c9ohDosI1/RuHK/DF vTSQUtw6Q3tH8oG7CPzWPZCxILtp0vfNlFVTDMaRxoPuAu+BLDbcN8Q2o2bo/ki/v9nQ iEQh0+G2dE6+GRd1SN/uuLu8fxo/XNbNi3v3H5ymu5YVU1Ttk2g6KaiPclck5qv3uriD Bg9w== X-Gm-Message-State: AOAM5324y7CRl1e+ikMTQtPESLl0wlnzjrM0pm/g4xuZVwiyW/APcOda EmHXBs3v1CNRs7SAuBa1/w== X-Google-Smtp-Source: ABdhPJwSo3vtevHig5e6wcfYzHn+p/9LVu6izXiBqHPOZc+ml50aXK5vctwJYkE3EswfiMHjHBf9ng== X-Received: by 2002:a4a:e597:: with SMTP id o23mr6391984oov.96.1633538632948; Wed, 06 Oct 2021 09:43:52 -0700 (PDT) Received: from xps15.herring.priv (66-90-148-213.dyn.grandenetworks.net. [66.90.148.213]) by smtp.googlemail.com with ESMTPSA id s29sm4236628otg.60.2021.10.06.09.43.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 09:43:52 -0700 (PDT) From: Rob Herring To: Russell King , James Morse , Catalin Marinas , Will Deacon , Guo Ren , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Michael Ellerman , Paul Walmsley , Palmer Dabbelt , Albert Ou , Yoshinori Sato , Rich Felker , x86@kernel.org, Greg Kroah-Hartman Cc: Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Benjamin Herrenschmidt , Paul Mackerras , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "Rafael J. Wysocki" , Frank Rowand , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, openrisc@lists.librecores.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 09/12] sh: Use of_get_cpu_hwid() Date: Wed, 6 Oct 2021 11:43:29 -0500 Message-Id: <20211006164332.1981454-10-robh@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211006164332.1981454-1-robh@kernel.org> References: <20211006164332.1981454-1-robh@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211006_094354_435626_0AE98087 X-CRM114-Status: GOOD ( 11.54 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Replace open coded parsing of CPU nodes' 'reg' property with of_get_cpu_hwid(). Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org Signed-off-by: Rob Herring --- arch/sh/boards/of-generic.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/sh/boards/of-generic.c b/arch/sh/boards/of-generic.c index 921d76fc3358..f7f3e618e85b 100644 --- a/arch/sh/boards/of-generic.c +++ b/arch/sh/boards/of-generic.c @@ -62,9 +62,8 @@ static void sh_of_smp_probe(void) init_cpu_possible(cpumask_of(0)); for_each_of_cpu_node(np) { - const __be32 *cell = of_get_property(np, "reg", NULL); - u64 id = -1; - if (cell) id = of_read_number(cell, of_n_addr_cells(np)); + u64 id = of_get_cpu_hwid(np, 0); + if (id < NR_CPUS) { if (!method) of_property_read_string(np, "enable-method", &method); -- 2.30.2 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FBCFC433F5 for ; Wed, 6 Oct 2021 16:51:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D921B60FDA for ; Wed, 6 Oct 2021 16:51:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D921B60FDA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QB8UKZT6HPJ1eAdlJjyp/NFQARYqwA3FA6YkJajrpl0=; b=D+79dEAKQVMEbi 9BU9L/vNfjTMgizAhwo5zxXp3IR+ragRbReL3KC21OGcqzW11llE1aTzkaCvboyZY+1X19NKe8NXo 3/pZO6Du03dV0IhAQ0vBaNNtV/H7c833AKaK1dZfBLoiBsL7mE6tDNt7HqiGnZipi41CwF8uTWvxG xUognUIqeVlINS6txIkcC4p2UEpfBzGbBWNWrhxiTafSLxoyrruZTsWIbYKPDMgZnJ5OsVUCbEIaL A3YUl7Ke22USnxsLxY2s0bc7WPtnaLw2k06OURZ4bkakaouYSC86X2jjNuivvAR5pqOJBTg+pxjtB nQa54Dc3DpNmVX5VnK8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYA5n-00F4Yc-Ug; Wed, 06 Oct 2021 16:48:32 +0000 Received: from mail-oo1-f43.google.com ([209.85.161.43]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYA1K-00F2AT-Bn; Wed, 06 Oct 2021 16:43:55 +0000 Received: by mail-oo1-f43.google.com with SMTP id w6-20020a4aa446000000b002b5795cca03so1019054ool.6; Wed, 06 Oct 2021 09:43:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qVDBxu87TJi7lJ0TsvF77hW6cToukGJnTBFK4bAPEHE=; b=ErP6xKV+ALlmtyXriN1EaAi0d2nXxaNoWiTfPt61DFyIJqR+a3bmDeThgXvfUQJu5A mAkt8RnqRNypTfjm9RinH1U3Mm7rWvIgrcic3y/04JECec27nwjhKBZN/VT1puKnMa8l gX8tezSHUdQFqXNH4l0XL4HN8sNUxx2sNHNIr4EdtqsWrZi7PR6c9ohDosI1/RuHK/DF vTSQUtw6Q3tH8oG7CPzWPZCxILtp0vfNlFVTDMaRxoPuAu+BLDbcN8Q2o2bo/ki/v9nQ iEQh0+G2dE6+GRd1SN/uuLu8fxo/XNbNi3v3H5ymu5YVU1Ttk2g6KaiPclck5qv3uriD Bg9w== X-Gm-Message-State: AOAM5324y7CRl1e+ikMTQtPESLl0wlnzjrM0pm/g4xuZVwiyW/APcOda EmHXBs3v1CNRs7SAuBa1/w== X-Google-Smtp-Source: ABdhPJwSo3vtevHig5e6wcfYzHn+p/9LVu6izXiBqHPOZc+ml50aXK5vctwJYkE3EswfiMHjHBf9ng== X-Received: by 2002:a4a:e597:: with SMTP id o23mr6391984oov.96.1633538632948; Wed, 06 Oct 2021 09:43:52 -0700 (PDT) Received: from xps15.herring.priv (66-90-148-213.dyn.grandenetworks.net. [66.90.148.213]) by smtp.googlemail.com with ESMTPSA id s29sm4236628otg.60.2021.10.06.09.43.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 09:43:52 -0700 (PDT) From: Rob Herring To: Russell King , James Morse , Catalin Marinas , Will Deacon , Guo Ren , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Michael Ellerman , Paul Walmsley , Palmer Dabbelt , Albert Ou , Yoshinori Sato , Rich Felker , x86@kernel.org, Greg Kroah-Hartman Cc: Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Benjamin Herrenschmidt , Paul Mackerras , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "Rafael J. Wysocki" , Frank Rowand , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, openrisc@lists.librecores.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 09/12] sh: Use of_get_cpu_hwid() Date: Wed, 6 Oct 2021 11:43:29 -0500 Message-Id: <20211006164332.1981454-10-robh@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211006164332.1981454-1-robh@kernel.org> References: <20211006164332.1981454-1-robh@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211006_094354_435626_0AE98087 X-CRM114-Status: GOOD ( 11.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace open coded parsing of CPU nodes' 'reg' property with of_get_cpu_hwid(). Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org Signed-off-by: Rob Herring --- arch/sh/boards/of-generic.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/sh/boards/of-generic.c b/arch/sh/boards/of-generic.c index 921d76fc3358..f7f3e618e85b 100644 --- a/arch/sh/boards/of-generic.c +++ b/arch/sh/boards/of-generic.c @@ -62,9 +62,8 @@ static void sh_of_smp_probe(void) init_cpu_possible(cpumask_of(0)); for_each_of_cpu_node(np) { - const __be32 *cell = of_get_property(np, "reg", NULL); - u64 id = -1; - if (cell) id = of_read_number(cell, of_n_addr_cells(np)); + u64 id = of_get_cpu_hwid(np, 0); + if (id < NR_CPUS) { if (!method) of_property_read_string(np, "enable-method", &method); -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rob Herring Date: Wed, 6 Oct 2021 11:43:29 -0500 Subject: [OpenRISC] [PATCH 09/12] sh: Use of_get_cpu_hwid() In-Reply-To: <20211006164332.1981454-1-robh@kernel.org> References: <20211006164332.1981454-1-robh@kernel.org> Message-ID: <20211006164332.1981454-10-robh@kernel.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: openrisc@lists.librecores.org Replace open coded parsing of CPU nodes' 'reg' property with of_get_cpu_hwid(). Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh at vger.kernel.org Signed-off-by: Rob Herring --- arch/sh/boards/of-generic.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/sh/boards/of-generic.c b/arch/sh/boards/of-generic.c index 921d76fc3358..f7f3e618e85b 100644 --- a/arch/sh/boards/of-generic.c +++ b/arch/sh/boards/of-generic.c @@ -62,9 +62,8 @@ static void sh_of_smp_probe(void) init_cpu_possible(cpumask_of(0)); for_each_of_cpu_node(np) { - const __be32 *cell = of_get_property(np, "reg", NULL); - u64 id = -1; - if (cell) id = of_read_number(cell, of_n_addr_cells(np)); + u64 id = of_get_cpu_hwid(np, 0); + if (id < NR_CPUS) { if (!method) of_property_read_string(np, "enable-method", &method); -- 2.30.2