Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1877838rdb; Mon, 9 Oct 2023 06:03:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFg1Sze5sTPjoxxYRcdmNnKFMhcgq3uUXlxwyEZhjc9rcLsF6mUwz0GFq6z81mNV+CK3umE X-Received: by 2002:a05:6a20:734a:b0:15d:641b:57b6 with SMTP id v10-20020a056a20734a00b0015d641b57b6mr15290631pzc.5.1696856590767; Mon, 09 Oct 2023 06:03:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696856590; cv=none; d=google.com; s=arc-20160816; b=zknVIpVTCjqRpfoB2agV1uviAO0WMdCg1zdwCzH1PlEOcG3krOih3lda5J3y7+vT56 AegI0M+12sUBdM5n1bKo8dX/kDGy54vQD92m1GjzC4/6RM5dndqqr5zUqNDt8Z8sC2VM gFjpODHjjySMj8ktN1Ch2q/YPP8KxMY2iK29sUH48fVlxh6H1wn0RK0ErYEQuysQJVGW Bi7CjRfLtEJWH8pBgadxB9ROHiZqnKE9jtCZ3K149q2MvgIe+ad/LRmn6r1Z428ppfAt AW6b+iw4Xcy25VNdhR0D1ArowfsEefYLkd8KHTlIUCJA8L1q/RpoOOCoDDjO3TJWIsBt y/PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=EwpVnrmSx861JVksI7Zb0upCp3LT7vnk8jsCfHBhWt4=; fh=N77ISLmOZhPFzfp2VQK2HcJUql62D893mdpdnyW63wE=; b=UyuQtAkjEvUKE57pg2pKNql7LQX5ccca4Ryu951GQrwzjQ+xTlPsG+GWa+QKJeO25Z ez5eDox3tyziKP6KTqa2lFTPDFjyoSQTwCV7r0j9hFlnPIYCkrtqASAB1z1XH2VdojPR ZZdcMIFCSJ29CD0cVxZuPmNByqFnI0ELQ1ve2h201SLJOffz30QNYdq98ZpZKfLHtdFX J74yv9qBjJK6ZRa1m7pyFwkjHypfoc8KwgJ+F4WJjAgowWkC01F9bILVc5JkP/eu75KN PDE1pa5LcqHMPIVwPvBHjo4UXhwJ9yUyq6U5pkbksgRbP59O8aUGmlkRo374RujmpvY0 FPkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=ojfJ6BQ0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id fh29-20020a056a00391d00b00690c1e51cdfsi6872022pfb.188.2023.10.09.06.03.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 06:03:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=ojfJ6BQ0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 6A381801F9BD; Mon, 9 Oct 2023 06:03:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376620AbjJINCw (ORCPT + 99 others); Mon, 9 Oct 2023 09:02:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376530AbjJINCv (ORCPT ); Mon, 9 Oct 2023 09:02:51 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9FAF9C for ; Mon, 9 Oct 2023 06:02:49 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-32163c3ece5so366000f8f.1 for ; Mon, 09 Oct 2023 06:02:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1696856568; x=1697461368; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=EwpVnrmSx861JVksI7Zb0upCp3LT7vnk8jsCfHBhWt4=; b=ojfJ6BQ0tOawPPhDLGPSi21WV243ejCFKviRoJnIZPU1R/X8qtv6MnJ5GhYUOk1Rbz K3CQyT7K0Hy2HSLR4958kruHLekpETgvjPKQ/9DX2Dnum1+cxuyZaCYTYcCW/qaKVeor Zn/caMpFBcZVS7dBeqtxHmSnIKUtO5j2/sOKv1aq6WFjhFjFb1tuKN/KX5T/9OxElhi9 UJhaLe71RS9EKEMTmSyvVaHCUjwYFXuYKcr2hgTB4Tm1q4YhxJBc8junun5GLZqsUSFQ 4qDCB0rGY5TOEB1S3QeyIKy1EH27Z91O97+mjEc+cSXL0qitpeouuqODV3MhPkHquzCq aJHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696856568; x=1697461368; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=EwpVnrmSx861JVksI7Zb0upCp3LT7vnk8jsCfHBhWt4=; b=pYMy5okiPwsVt7Oytwe/XgTMwaWUsuooKSIeYfDITZPadyJdSqBGQU9D/xNu1RqaRg IHj2RlwYLTKwtQ/qEpb7XUtj0QUCPvvP2NHNeFGlRx3TUMRgrQpuK4xvyZNSUAXOLIIa /TICN76mR7j+Y2dU8Ch5AReCI2TC6ovlUYocng8gsZvBOTRhsJvAXshKhWcSkycPj2cP GaXMhHP4GE+z7qFB8MU8Kgr3R/0D47rso2zCKLRymhr3ehgetu0v0hWEbjqY/9uKuBwL KRlQ4tkBp7noZK6IDtmUxw7tqsHbTytH0BKvy2rtUE8EOpaDXhNOgd8cp4CIRfmXkQn4 YDOA== X-Gm-Message-State: AOJu0YzqVDW+j0E3NPZfB4zkLyzekm03ET5xF9wWkNE3pB/ZOEdtemxk dqKMX4g9TE1XxmAqmWUIIbrkgw== X-Received: by 2002:a5d:58c2:0:b0:324:87d3:873d with SMTP id o2-20020a5d58c2000000b0032487d3873dmr12967469wrf.3.1696856566689; Mon, 09 Oct 2023 06:02:46 -0700 (PDT) Received: from ?IPV6:2a01:e0a:999:a3a0:b2f5:bf53:6bd1:414e? ([2a01:e0a:999:a3a0:b2f5:bf53:6bd1:414e]) by smtp.gmail.com with ESMTPSA id v15-20020a5d4b0f000000b00325aca09ad1sm9678417wrq.24.2023.10.09.06.02.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Oct 2023 06:02:46 -0700 (PDT) Message-ID: <114052a2-6e2f-46cb-acb0-8d85c3b584bb@rivosinc.com> Date: Mon, 9 Oct 2023 15:02:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/8] riscv: remove unused functions in traps_misaligned.c Content-Language: en-US To: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: Atish Patra , Andrew Jones , Evan Green , =?UTF-8?Q?Bj=C3=B6rn_Topel?= , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Ron Minnich , Daniel Maslowski , Conor Dooley References: <20231004151405.521596-1-cleger@rivosinc.com> <20231004151405.521596-2-cleger@rivosinc.com> <877co2gwkb.fsf@all.your.base.are.belong.to.us> From: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= In-Reply-To: <877co2gwkb.fsf@all.your.base.are.belong.to.us> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 09 Oct 2023 06:03:06 -0700 (PDT) X-Spam-Level: ** On 04/10/2023 18:51, Björn Töpel wrote: > Clément Léger writes: > >> Replace macros by the only two function calls that are done from this >> file, store_u8() and load_u8(). >> >> Signed-off-by: Clément Léger >> --- >> arch/riscv/kernel/traps_misaligned.c | 46 +++++----------------------- >> 1 file changed, 7 insertions(+), 39 deletions(-) >> >> diff --git a/arch/riscv/kernel/traps_misaligned.c b/arch/riscv/kernel/traps_misaligned.c >> index 378f5b151443..e7bfb33089c1 100644 >> --- a/arch/riscv/kernel/traps_misaligned.c >> +++ b/arch/riscv/kernel/traps_misaligned.c >> @@ -151,51 +151,19 @@ >> #define PRECISION_S 0 >> #define PRECISION_D 1 >> >> -#define DECLARE_UNPRIVILEGED_LOAD_FUNCTION(type, insn) \ >> -static inline type load_##type(const type *addr) \ >> -{ \ >> - type val; \ >> - asm (#insn " %0, %1" \ >> - : "=&r" (val) : "m" (*addr)); \ >> - return val; \ >> -} >> +static inline u8 load_u8(const u8 *addr) > > Really a nit, and applies to the whole file: "static inline" in a .c > file is just useless. Oh yes clearly, I should have fixed that while factorizing, I simply kept them from the previous code. > >> +{ >> + u8 val; >> >> -#define DECLARE_UNPRIVILEGED_STORE_FUNCTION(type, insn) \ >> -static inline void store_##type(type *addr, type val) \ >> -{ \ >> - asm volatile (#insn " %0, %1\n" \ >> - : : "r" (val), "m" (*addr)); \ >> -} >> + asm volatile("lbu %0, %1" : "=&r" (val) : "m" (*addr)); > > Why do you need early clobber here? Ditto, copy pasted from existing code but I don't think there is a need for early clobber here. Clément > > > Björn