Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp336729rda; Sat, 21 Oct 2023 09:37:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHyHKsJ2GCPcCmvybtbEY/5xtQNoqh0QXcMOv71u3uBnLgYbWN5eVzq1BErntABgQYUAt6Z X-Received: by 2002:a17:90b:8c:b0:27d:2ed1:6b87 with SMTP id bb12-20020a17090b008c00b0027d2ed16b87mr4269139pjb.40.1697906221932; Sat, 21 Oct 2023 09:37:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697906221; cv=none; d=google.com; s=arc-20160816; b=W96Of3DzHgwDNIbHa6e1wzij6nMNLHMMINjiVaeg/JVKkvjZrJM4X32101aZN+cYc1 VoHuLLEJADflECCBA8yOfne16ZaS2uy6TfWv8c0UXnOCEd4e8wkwmOfL63w93FXTG2Qi i/8C5oLGbUrC5t/lXXHQUcK93h1vpxpypLKOj6WSoQqdKhSFqZ0DLvaX1+rDBDF7GDu6 Y2o01f+0kzuOlc7aEhW98xvwj8G1WAhMKIYJ3KA4VppPj/xVDIqnnLzpCvw5yMCRSuiH n1qlKSQUp7iegHEiUeSkN4wSVHiOLgSDKv0XCXAKgX51j1PjaZpdfPbDIGftRLDYXR3z febw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dONtNdhno8Jq1lyIvk/EnM1Qq5LAoRQ4sniN4CbtTPE=; fh=NKFL920pUMQopkg1dKfCPq22lKBlLOlyPGUlM3IaF/I=; b=hk1V3+SeASAH9cQrarp3N/JKG7yV+K/0xRZSqJ2kAChh3xYDBnne3xXB72dFnsqVe+ xt+AhTKCxJ8GiaaHp5adJk+r6fcJswnUwPd+jDTajL65a8ggfJOkPGl1eRaHzTf3vo4Y 1iBJ3TtM66hyQq1oQKHosm72pvGt2s8kClJyTphNMc6RU7qQnCwtpKH2HVt0Gk0NfnSi VgOwX1/3gTfmGvoOi7ErfLuNU2D7vCp3LOFMW1nSqfMOApkyTyJkCwAPztH3/EU0ViCv Xh1yjQn9/XXnwPekptimiSb7aWABO7XZPLXWsTnlitZtwNphevQ2tYKHjWJgpCI7Paty TXVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GD3fLXMd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id om8-20020a17090b3a8800b002792c288cc3si3938081pjb.169.2023.10.21.09.37.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 09:37:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GD3fLXMd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2E961807C84F; Sat, 21 Oct 2023 09:36:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231732AbjJUQgI (ORCPT + 99 others); Sat, 21 Oct 2023 12:36:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231745AbjJUQfh (ORCPT ); Sat, 21 Oct 2023 12:35:37 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27603112; Sat, 21 Oct 2023 09:35:32 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1FEBCC433C7; Sat, 21 Oct 2023 16:35:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1697906131; bh=IRSw7P9VmuHhUOMwdDBR2XmA3tdHqhvGWiakm/9oZ9I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GD3fLXMdp5ENzoMaZS+fNNSFjexby3//ktNJIxMQagbYFEmNH3sSMrJXmCP2wsitu NrGJogc+Bu5bu3tSoeN4KQxU/sz4js+A7eNkYq+lMJyEIUkmN5C4FddLlrBRpCvFct FbETBGPoIvSAMvZX/nqXEko6qB+5TuJlxbNyZfLs= Date: Sat, 21 Oct 2023 18:35:29 +0200 From: Greg Kroah-Hartman To: Anup Patel Cc: Paolo Bonzini , Atish Patra , Palmer Dabbelt , Paul Walmsley , Jiri Slaby , Conor Dooley , Andrew Jones , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-serial@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 6/9] RISC-V: Add stubs for sbi_console_putchar/getchar() Message-ID: <2023102113-harsh-trout-be8f@gregkh> References: <20231020072140.900967-1-apatel@ventanamicro.com> <20231020072140.900967-7-apatel@ventanamicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231020072140.900967-7-apatel@ventanamicro.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 21 Oct 2023 09:36:13 -0700 (PDT) On Fri, Oct 20, 2023 at 12:51:37PM +0530, Anup Patel wrote: > The functions sbi_console_putchar() and sbi_console_getchar() are > not defined when CONFIG_RISCV_SBI_V01 is disabled so let us add > stub of these functions to avoid "#ifdef" on user side. > > Signed-off-by: Anup Patel > Reviewed-by: Andrew Jones > --- > arch/riscv/include/asm/sbi.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h > index 12dfda6bb924..cbcefa344417 100644 > --- a/arch/riscv/include/asm/sbi.h > +++ b/arch/riscv/include/asm/sbi.h > @@ -271,8 +271,13 @@ struct sbiret sbi_ecall(int ext, int fid, unsigned long arg0, > unsigned long arg3, unsigned long arg4, > unsigned long arg5); > > +#ifdef CONFIG_RISCV_SBI_V01 > void sbi_console_putchar(int ch); > int sbi_console_getchar(void); > +#else > +static inline void sbi_console_putchar(int ch) { } > +static inline int sbi_console_getchar(void) { return -1; } Why not return a real error, "-1" isn't that :) thanks, greg k-h