Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1063190imj; Thu, 14 Feb 2019 00:14:15 -0800 (PST) X-Google-Smtp-Source: AHgI3IaOgXKEKvmM0yLJhxHo2b2bahTMYJxWxlHP65tUHb/M+bjuMS0kNv2NjhKbt7d+kWi8Ic69 X-Received: by 2002:a62:138f:: with SMTP id 15mr2717538pft.219.1550132054884; Thu, 14 Feb 2019 00:14:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550132054; cv=none; d=google.com; s=arc-20160816; b=mTaYzTXI3fYBEbKmwb4P6Zrt1WV1R5ZeGD9qeWxyltB3RRlRXrqCKrAlmLcmcVl8n9 Mzc5YCSTBeZOBE14Cus7O5J+Ildy5+V2d7jTQ99k/JaxCyau+Jknl0K44Es99iNmReTq Ng3pvGsGBXYeLEF+Fk5hLbZsTY3m4sfb86NCIMJ7NNyjCEMiY6+ZyL1zQn9TpqkyRev4 cqQUtFCATe3Xs45DE0c/xU09i7/OW0UIUiNk/25Rh8NRh9LqpQF6Pmr369qYfLSEd5lt PTBev5Ljv2X1Pkx5X6izKn8TzGk9jsS2JFFFqpaCvizthjFOppAQTb25R3UIxAiI38ty nbuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=hV56yyANK+jU6N3ENP7QQh9M0rHMij3nkJjoDopAWhY=; b=mGp5pGm5J7hhCrTbjH+Iq6CaK4vj1de4S/+0US7LsyrZHzd7tQChdS6dyd/j8oXdIO s6GKgKnupQJnqYJyWRgTJCeVIFFR0zcAGrjeq3b0XBGGaYeQqeGK8OcWTm8+fvMeL7sd wTD8kgE4aFsDWsTKPXrvPxomYJfTO1EECSOBkh+5qPH94dzcerC3/IIrIItEXQ3ftaTc a4KJ0l843o+MU8e2+e33gK8wveDBrHcNNdB0UWHgehAB1LcG/l3keLaxAlAavmJqfrZB 89uqO0Q5EvPkYFWOjwhVWRzc4Q9GonhAcNUhK3tlxvaMEhOSuNer61yD9DccwvdRs1Mu bsTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=h+hDaj4m; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t12si1765558plr.311.2019.02.14.00.13.58; Thu, 14 Feb 2019 00:14:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=h+hDaj4m; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394550AbfBMUSV (ORCPT + 99 others); Wed, 13 Feb 2019 15:18:21 -0500 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:8285 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726262AbfBMUSV (ORCPT ); Wed, 13 Feb 2019 15:18:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1550089101; x=1581625101; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=dA6aSe5XZKK9jbqPUE7aSPe08mUJ7TsRaBX9UTEfvg4=; b=h+hDaj4mYIFCmo4ga2UR7k/VnE8MMGA22AkZGcGXpOkH+NLPTYSeoDl2 gYFV6ED/DI0eWCQa+WWx6NtfxPyAifHfeOV1io9A+67bN/95AqmgCt1jb arRBJ2rh+Q28S/oDqtW0pNHy/19aHJr28To2stobFsvEk/AMrKCpIotDp BFaduUaJTM/o5r3XT63loDXsOe8vqJJ3/Lwrj7hnHqbsDcoyXT5sA37J6 5iUimiBpWMXPTp8W/SiJ9ip5qk3Lq5piRtbPDsttu3U1pEwjr0qAuDkuT kF5/SjDvzeYPhY0N6znRKe1hRIpPzOKVUqeyWPnHUAxc7TCmewbhn8OSf g==; X-IronPort-AV: E=Sophos;i="5.58,366,1544457600"; d="scan'208";a="101135673" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 14 Feb 2019 04:18:21 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 13 Feb 2019 11:58:54 -0800 Received: from jedi-01.sdcorp.global.sandisk.com (HELO jedi-01.int.fusionio.com) ([10.11.143.218]) by uls-op-cesaip02.wdc.com with ESMTP; 13 Feb 2019 12:18:21 -0800 From: Atish Patra To: linux-riscv@lists.infradead.org Cc: Atish Patra , Alan Kao , Albert Ou , Andreas Schwab , Anup Patel , Daniel Lezcano , Dmitriy Cherkasov , Guenter Roeck , Jason Cooper , Johan Hovold , linux-kernel@vger.kernel.org, Marc Zyngier , Palmer Dabbelt , Paul Walmsley , Thomas Gleixner Subject: [v5 PATCH 3/8] RISC-V: Remove NR_CPUs check during hartid search from DT Date: Wed, 13 Feb 2019 12:18:07 -0800 Message-Id: <1550089092-28783-4-git-send-email-atish.patra@wdc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550089092-28783-1-git-send-email-atish.patra@wdc.com> References: <1550089092-28783-1-git-send-email-atish.patra@wdc.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In non-smp configuration, hartid can be higher that NR_CPUS. riscv_of_processor_hartid should not be compared to hartid to NR_CPUS in that case. Moreover, this function checks all the DT properties of a hart node. NR_CPUS comparison seems out of place. Signed-off-by: Atish Patra Reviewed-by: Christoph Hellwig Reviewed-by: Anup Patel --- arch/riscv/kernel/cpu.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index d1d9bfd5..cf2fca12 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -34,10 +34,6 @@ int riscv_of_processor_hartid(struct device_node *node) pr_warn("Found CPU without hart ID\n"); return -ENODEV; } - if (hart >= NR_CPUS) { - pr_info("Found hart ID %d, which is above NR_CPUs. Disabling this hart\n", hart); - return -ENODEV; - } if (!of_device_is_available(node)) { pr_info("CPU with hartid=%d is not available\n", hart); -- 2.7.4