Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2257684pxp; Fri, 18 Mar 2022 06:52:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKnvvDSczNylEXHiOsjQvRuextHW1PWjO/4PHBxOwMuguq16PX01LgtFAm/bJqGUxP8aj6 X-Received: by 2002:a17:90a:990c:b0:1bc:3c9f:2abe with SMTP id b12-20020a17090a990c00b001bc3c9f2abemr11430957pjp.220.1647611575032; Fri, 18 Mar 2022 06:52:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647611575; cv=none; d=google.com; s=arc-20160816; b=pHJtMvrMjFwOeIRjxjH6DFGDpLsQrBigq6E3JHtzhi0mIKr0rGIJihagRU/LJs6CSn r65h3pus5GM3HJKijhDIrrRfLX858tAIH+IQseAkVdcCnLnXLql7nfmsTKJjfPRyTDBR KPiFcyL10b3Gjwr2tlrsSRPCOGcZvE5sRB0+K6NbsJeiC8qJKOpx3ovPxT47xHPqjR18 KAAljumLEufSnOS9xInsnzvXyF2zirFCX1W2pdkdaj7B+5XhKHYiEqIkJhG/mUqyz2oz G43Xjtn4PnFStXWL3GxBQojN5sGPOlgFRYUbGBX9cWWFsfbcwwQpYVgtCwD68BF1anSY P6KA== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=XH4g9MSru8iDCETafOBz2XxITKxCQtEBn2JBdRv0Evg=; b=Fn4eUGcfY7hkfD04IdLqyxJWNBn63a2M/7PLV+kABuCeXOxWL9CU7q70jpFR9LDGq4 +JibKTXwB4JafmkFUii+18eXY8UyS1RRInsC21MczAlnezaDFLoMnC15yLbTrP/AgXAO glrWoQYF5ujGegegOo31Poo58IqgCflydtV5a80k3QiqAurv9bqcvQY+92bSeT1eQcs/ cZlkm81Ya9F/jsKmjn4obOb3tO7MohSc65Yn/6bE6y58erpdSHVV7O/HybbFS1n2QDYn a1kCnsCZ74eFMeuTIe8j0AkJeKecDZlN9xUqRuq91h3hk1Tif21Kwg/hYVtzKnfV0HKt aERw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n5-20020a17090a73c500b001c699f1f13asi3756119pjk.77.2022.03.18.06.52.40; Fri, 18 Mar 2022 06:52:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232246AbiCRDml (ORCPT + 99 others); Thu, 17 Mar 2022 23:42:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232238AbiCRDmi (ORCPT ); Thu, 17 Mar 2022 23:42:38 -0400 Received: from relay5.hostedemail.com (relay5.hostedemail.com [64.99.140.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D38C2878BA for ; Thu, 17 Mar 2022 20:41:19 -0700 (PDT) Received: from omf05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id DB49224938; Fri, 18 Mar 2022 03:41:17 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf05.hostedemail.com (Postfix) with ESMTPA id EB7FB20015; Fri, 18 Mar 2022 03:41:09 +0000 (UTC) Message-ID: <4b017a7c75d6422b3e68df1d0aef49adc31ae991.camel@perches.com> Subject: Re: [PATCH v6 1/6] RISC-V: Correctly print supported extensions From: Joe Perches To: Atish Patra , linux-kernel@vger.kernel.org Cc: Tsukasa OI , Anup Patel , Heiko Stuebner , Albert Ou , Atish Patra , Damien Le Moal , devicetree@vger.kernel.org, Jisheng Zhang , Krzysztof Kozlowski , linux-riscv@lists.infradead.org, Palmer Dabbelt , Paul Walmsley , Rob Herring Date: Thu, 17 Mar 2022 20:41:08 -0700 In-Reply-To: <20220314203845.832648-2-atishp@rivosinc.com> References: <20220314203845.832648-1-atishp@rivosinc.com> <20220314203845.832648-2-atishp@rivosinc.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.4-1ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspamout05 X-Rspamd-Queue-Id: EB7FB20015 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Stat-Signature: 9uui7t67w9hsd4frdre6zgmamcg8n3ho X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX19pvWiJwU890RydAIIWBwsRim9FvyFTerA= X-HE-Tag: 1647574869-14430 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 On Mon, 2022-03-14 at 13:38 -0700, Atish Patra wrote: > From: Tsukasa OI > > This commit replaces BITS_PER_LONG with number of alphabet letters. [] > diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c [] > @@ -133,13 +135,13 @@ void __init riscv_fill_hwcap(void) > } > > memset(print_str, 0, sizeof(print_str)); > - for (i = 0, j = 0; i < BITS_PER_LONG; i++) > + for (i = 0, j = 0; i < NUM_ALPHA_EXTS; i++) > if (riscv_isa[0] & BIT_MASK(i)) > print_str[j++] = (char)('a' + i); probably better to add braces for the for loops too > pr_info("riscv: ISA extensions %s\n", print_str); > > memset(print_str, 0, sizeof(print_str)); > - for (i = 0, j = 0; i < BITS_PER_LONG; i++) > + for (i = 0, j = 0; i < NUM_ALPHA_EXTS; i++) > if (elf_hwcap & BIT_MASK(i)) > print_str[j++] = (char)('a' + i); > pr_info("riscv: ELF capabilities %s\n", print_str); and here.