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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C188AC433F5 for ; Fri, 18 Mar 2022 03:41:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232244AbiCRDmm (ORCPT ); Thu, 17 Mar 2022 23:42:42 -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-Stat-Signature: 9uui7t67w9hsd4frdre6zgmamcg8n3ho X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX19pvWiJwU890RydAIIWBwsRim9FvyFTerA= X-HE-Tag: 1647574869-14430 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.