Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp4954674pxb; Wed, 20 Apr 2022 13:57:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFwTYQLgIAxO53ygrASiO3bg6nJbkzuH+BEWDg4nonS2xoTmVIgf7KBY4vLQmGyRDjPo5K X-Received: by 2002:a17:90a:a090:b0:1cb:a443:f19c with SMTP id r16-20020a17090aa09000b001cba443f19cmr6588146pjp.135.1650488275166; Wed, 20 Apr 2022 13:57:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650488275; cv=none; d=google.com; s=arc-20160816; b=P8kfm9YTsMcs7TIgUZgU01D1w1yUJO5qpmLiZMEzzkBLRYalAC6oUoDoFhbmk+4RIR mxdBzzzsqZjxe2BzuIKDu20MR9YsEtN5eFbe1MfDFFmrsOg+eWzPrrIPGl4nuYl5wSRS Fv9U1+FJriDNJKiOtRp9L7V5A85lHSLm12iUHvBZtacSLx0mIwZxZyTf6kZGibqSqfXE 9yNJs96SClKnku2KHAhgePsG4TL2EjNdDr7ryX1nvwiYG1IjEog4vXylt1eOauN9hrqv g+ObRk38AcS2f880uvKP5XA63Gi/HZ9krGt3sZDNVc2S/xm4mceestQvjAD7MkVlJfMd 0Vag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:cc:content-transfer-encoding :mime-version:message-id:date:subject:dkim-signature; bh=njBQHRt2JNELpmysy2Ho9Dr1cUDqEsm6PMq8c5+PjEU=; b=Z27VhWAceulJwLTzA2iP3Imu9bGyjzTzy1tr3w+ITzawZD/gnzETRr25yPq12ngZoM iIrkccp1KL8BRcDqwLiovHYqyPk0BrIIKkSXBtgjsFpso9HSVTpyL5AiUR+j2RJcl/dR yT1LyQMiXNVjGgtSWknPoFlIF3BZogYBDWD/9PV9lU0zOxSHiitak/KfKa0CyTSfdR26 gwOMfnb+q8Qsgn2TvmBUvYeP7V3b9SgeNtCK3YGnN2JT7Q513zbnevixAjrzpEf8w9nr nYz/Y6aoULf0WfegHieXk7J5b8M3IhwYcFFyU+lEa73sCIBY4RHppjqZBlHBOIeA8OWP 6VWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=MDbXI5kW; 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 mh9-20020a17090b4ac900b001cbbbaa19c2si6790817pjb.97.2022.04.20.13.57.39; Wed, 20 Apr 2022 13:57:55 -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; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=MDbXI5kW; 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 S1351677AbiDSUUJ (ORCPT + 99 others); Tue, 19 Apr 2022 16:20:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235759AbiDSUUH (ORCPT ); Tue, 19 Apr 2022 16:20:07 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE9D741306 for ; Tue, 19 Apr 2022 13:17:23 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id j17so9403352pfi.9 for ; Tue, 19 Apr 2022 13:17:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=subject:date:message-id:mime-version:content-transfer-encoding:cc :from:to; bh=njBQHRt2JNELpmysy2Ho9Dr1cUDqEsm6PMq8c5+PjEU=; b=MDbXI5kWR2BDcqIfRaKmzVcQ5N5PNVSbwrb9I6aeAV6SspjEAEbqSRRAy6JK4bvEDv ygi3Zld5WhIBRpY/+GGzDJTxUNHvzc0OMQ71XmQQtjDXJYIDsqL9yPCkHANDoIMivXPa DSVQ5WGTSxzyoT3HX2EMFdw9q87xTi/TCJUk6EpXgX+KWRWBr34WTXWmwL9AtuspLX5C XefYbEP4mPGAlyxp7DaZQWhnU6MCt7JgpmxQrBxwkp2iBq1PAuMCDga0CXe5jVtXWVEO IIzN+p7j50ZMWAVXVKmhGrmXOBnKHEPzc7OPwwNttVWcRIpRYgPpn1qNsxMkL+YDz8Un tQnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:date:message-id:mime-version :content-transfer-encoding:cc:from:to; bh=njBQHRt2JNELpmysy2Ho9Dr1cUDqEsm6PMq8c5+PjEU=; b=SxdMxOWZua0fj5oe7CAv6FUutpD0NY4CDAqw1vHZAwkdXGwTzgVqHlZ9DdImYWUAoC GGNnBkEAfu6txjE80wPVCYJ1crMRSHjFxxtpEqyfa9OXVwdse2nOjscUiqjOw6IqAuqj lbz3zaKVG11tXM7btE3x93S+FU/hd/UzaobyxnaAFJVDAE6I0MVIzzfiD26X5Ywxf7JB fH7n/4bEzzngAygfg1e12LuvCYfWiIK21rpAUtJtvBfH9yizLe6qf1h6/6frIKp5GsLQ AJw/sEqMYUgs1dx2zPP3ZmkGQt33hXXePhberIx9UzFYkGyIY3fD0becFZ3ygZBPnvly fweg== X-Gm-Message-State: AOAM530SF4tpeLnNkqRmt//tZRcel3DUYOr8tahVcvNa+6ks7DY3uKX7 tfEnehoMVAYV5eGo8xoCfWDfLyBOGJmufg== X-Received: by 2002:a05:6a00:4211:b0:506:5061:3e38 with SMTP id cd17-20020a056a00421100b0050650613e38mr19354994pfb.74.1650399443400; Tue, 19 Apr 2022 13:17:23 -0700 (PDT) Received: from localhost ([12.3.194.138]) by smtp.gmail.com with ESMTPSA id 204-20020a6302d5000000b00385f29b02b2sm17176543pgc.50.2022.04.19.13.17.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Apr 2022 13:17:23 -0700 (PDT) Subject: [PATCH v1] RISC-V: Add braces around an empty if statement bodies Date: Tue, 19 Apr 2022 12:48:46 -0700 Message-Id: <20220419194846.18318-1-palmer@rivosinc.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: Paul Walmsley , Palmer Dabbelt , aou@eecs.berkeley.edu, alexandre.ghiti@canonical.com, jszhang@kernel.org, wangkefeng.wang@huawei.com, mick@ics.forth.gr, vitaly.wool@konsulko.com, rppt@kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , kernel test robot From: Palmer Dabbelt To: panqinglin2020@iscas.ac.cn X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 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 From: Palmer Dabbelt This triggers -Wempty-body, which will cause the next statement (eventually create_pmd_mapping) to be dropped. Both of these were introduced by the same commit. This is safe for the reporting config (which is 32-bit), but IIUC could result in breakages for 64-bit configs without 4/5 level paging like the XIP configs. Reported-by: kernel test robot Fixes: 677b9eb8810e ("riscv: mm: Prepare pt_ops helper functions for sv57") Signed-off-by: Palmer Dabbelt --- Might be better to define these to functions that are empty, but that's slightly different than just fixing the commit/warning in question. --- arch/riscv/mm/init.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index 9535bea8688c..637916857c4d 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -798,13 +798,15 @@ static void __init create_fdt_early_page_table(pgd_t *pgdir, uintptr_t dtb_pa) PGDIR_SIZE, IS_ENABLED(CONFIG_64BIT) ? PAGE_TABLE : PAGE_KERNEL); - if (pgtable_l5_enabled) + if (pgtable_l5_enabled) { create_p4d_mapping(early_dtb_p4d, DTB_EARLY_BASE_VA, (uintptr_t)early_dtb_pud, P4D_SIZE, PAGE_TABLE); + } - if (pgtable_l4_enabled) + if (pgtable_l4_enabled) { create_pud_mapping(early_dtb_pud, DTB_EARLY_BASE_VA, (uintptr_t)early_dtb_pmd, PUD_SIZE, PAGE_TABLE); + } if (IS_ENABLED(CONFIG_64BIT)) { create_pmd_mapping(early_dtb_pmd, DTB_EARLY_BASE_VA, -- 2.34.1