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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 77763C61D97 for ; Tue, 21 Nov 2023 22:36:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZgRWojcsSk8OcNmn/96keAQY0hkKa/ctLKl8QR2ke1Q=; b=MMMa+a1Z85N0pP m8pCOqsVS/QGR+kjvlZ0W2xQ2X/kcGhs37AQJGEUlwaQT/F7TgUEFYZwk+J6OFL+uebPuwhAYdptT l6qdrH4VEWzAIPkXJCxYvpvb88merKvRh2IbeG+0eL/y2KgcLSm/HduA/PaNMpODbECWi9xhy4CrA yO1PgJoAq/OVOlZfkJ81QWJP05Cogtc5lX6wG23NyjPWfyLNjuIGC9IQ2RN8w1XeNQ6nBWU8ayCmG OyCZNEXzqIDBENxZ0hk8+gAcrbZVu5EjXUxu2gTGH56anvZZGRsAoovi9capjWwfL6qB65BBpbYlV I5W0C8PCMdItsToB34Pw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r5ZM6-000Bqg-2B; Tue, 21 Nov 2023 22:36:30 +0000 Received: from mail-io1-xd34.google.com ([2607:f8b0:4864:20::d34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r5ZM4-000BqM-1l for linux-riscv@lists.infradead.org; Tue, 21 Nov 2023 22:36:29 +0000 Received: by mail-io1-xd34.google.com with SMTP id ca18e2360f4ac-7b34ddcc625so6685939f.1 for ; Tue, 21 Nov 2023 14:36:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1700606187; x=1701210987; darn=lists.infradead.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=Czx5VSw2pBO1b75rdOa8rP1Tn4/X67nT2FHShLEAAdk=; b=ifB6XRbYJE66ck6S5RiSTRpWlQSyg9PhMezKmZGrnDqmuxoE9FdtHdkwxHvH4HmfYR H68WvDU/mIHF0sstbRhvho49rimkKcW5B6kdZttvuZJGs/3Alq/tg04H9drLEXav0+Cq Hsj+0/4D2WRHxKVJhvSLV7NCiEaloMSS6hE68zFYD18ALQLRG6uhNj+4RREKw3RKQrgb 0kfXcMCU5eiCfQ0tY3Mi8HiHsH54rJ9LBIYzNi5BCdX13OWWf+5NUaIqI66di5bi4vtu bapslxHj7z9RPBwkmxpXXTkwz3yvY4w1P+NcfoRfgr7Z3SsJOCgAVn3ViLP1PkBObTS5 8SvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700606187; x=1701210987; 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=Czx5VSw2pBO1b75rdOa8rP1Tn4/X67nT2FHShLEAAdk=; b=bAsdO3tfs8HMEZuM3I5sekZ8FfjaQDpZ4Qf9t6zqPM3d2SpKhYwGEMLxWhJ/tm1StH WKJ1hUyRwWLzNmNxiwsVz2RKdNUT22ZRxltTQruodav0o7cYYi/56Ki3+5bJswxk+DGn Jj92vKgKN1W3Xz7J8HdVLqHOK2px05oub71vkz4OpDKJ0dB2btmvGitPQTIfwH3JKJ0j qTMrS1vHqZ8hSbCbHmLekGVvYYR0EgwsvnwsbhfqZWxMTwLbBJOBpTXYSOsuEOjv0uPB HsR/uo6Uit3lUKQDga2grKdXjFeOR8cMUbwFm2/Qzxex+mBfgQDAqwv5o4eR9TCDST6k jlLQ== X-Gm-Message-State: AOJu0YxhBl1kvWUyKkMRn1w8u9imR9rNOxON+7saY3inP3OydZ0G5vnR 2IUBSkbKl9yvagJhSOJTkmohexKw73hbM+qoIJQ= X-Google-Smtp-Source: AGHT+IGfRVAH/8cvT9hmm4Ha5Eu0JN6NTmiZ2ExPb4m6TDcyvIXswopr0JkqwntNsAW38gNPKGfKow== X-Received: by 2002:a92:cac2:0:b0:357:f72d:ad06 with SMTP id m2-20020a92cac2000000b00357f72dad06mr285038ilq.2.1700606186826; Tue, 21 Nov 2023 14:36:26 -0800 (PST) Received: from ?IPV6:2605:a601:adae:4500:3d43:c8e2:1496:e620? ([2605:a601:adae:4500:3d43:c8e2:1496:e620]) by smtp.gmail.com with ESMTPSA id 8-20020a056e020ca800b0034aa175c9c3sm3434455ilg.87.2023.11.21.14.36.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Nov 2023 14:36:26 -0800 (PST) Message-ID: <70ff59ea-378c-4d53-899a-eafffcad22fd@sifive.com> Date: Tue, 21 Nov 2023 16:36:25 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 1/5] RISC-V: Add stubs for sbi_console_putchar/getchar() Content-Language: en-US To: Anup Patel Cc: Conor Dooley , Andrew Jones , linux-riscv@lists.infradead.org, linux-serial@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , Paul Walmsley , Greg Kroah-Hartman , Jiri Slaby References: <20231118033859.726692-1-apatel@ventanamicro.com> <20231118033859.726692-2-apatel@ventanamicro.com> From: Samuel Holland In-Reply-To: <20231118033859.726692-2-apatel@ventanamicro.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231121_143628_591466_C014176E X-CRM114-Status: GOOD ( 14.59 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Hi Anup, On 2023-11-17 9:38 PM, 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 0892f4421bc4..66f3933c14f6 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 -ENOENT; } "The SBI call returns the byte on success, or -1 for failure." So -ENOENT is not really an appropriate value to return here. Regards, Samuel > +#endif > long sbi_get_mvendorid(void); > long sbi_get_marchid(void); > long sbi_get_mimpid(void); _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="MxQRVrfX" Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B7A71BC for ; Tue, 21 Nov 2023 14:36:27 -0800 (PST) Received: by mail-io1-xd29.google.com with SMTP id ca18e2360f4ac-7b34ddcc625so6685839f.1 for ; Tue, 21 Nov 2023 14:36:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1700606187; x=1701210987; 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=Czx5VSw2pBO1b75rdOa8rP1Tn4/X67nT2FHShLEAAdk=; b=MxQRVrfXf+3CP4m6yY2Y7mnm4FqdZ2BmFBtogv0eO2jO1m6opXMLXjUB1gtR7B83Xh GxG4U1navJnKcYtRY7ibdLVOJL2EIMHBjfUg/ZJfWxBwQD0SsiwN9McknoQLzKzM1PM2 ZL8bScI2opde5gJrrbrmcQxE6EoFPts3ynFY1NU8G/GSMgmmKnriUExVF8S/2j6dcjPo nDnNH3ZjgV099hsvVaBgxdkFXS3Y7fs+OoTQGsb+YSPqqlJcBjJOSyn0Sh10AF9bmxUp ewBijHANYMvBhvJg4dCYGezrvoA+I3OiwO6qEPaTjRCG0GKFts2YVievFf//8/pHfwkf qIOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700606187; x=1701210987; 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=Czx5VSw2pBO1b75rdOa8rP1Tn4/X67nT2FHShLEAAdk=; b=Y74Hx2SAs3DXPy/ek/O6B/joBsRwhHdbcAAtvTzQl1b+Zq4+jdtpgblMOA71eVBFZC 5Y2FYOhUDlwnnAN3YiTOKPUzaa8tWFeXKaytR1Im3QgQo7QLKW3r+/w6Zwru7vursp1k FIsuLmPll4VdZyZKO9P/1hgV6jT277WOLJizdi7eCfzrgPWTidVqTmm79nNip7H045fW BwASyEh8lbTuhn9V5auTZ5sEm+kudEfHHweNwJS1uqyXdhB+yJlvXvrwh8/q5bl72JFC dCWgn590KH2J/PZLb/8V6Gs8xGrGmBXqWp0HLSiGh/Ho1b0gynsOTFNXNIoXKbOHArNi cLeg== X-Gm-Message-State: AOJu0YzcSQVJ5+E3NFz9ZQWZPd7H7SAmZu72rfPccit3+hxm4Uw1ld4A nTPEo3XiR6z23vGibNk/R7mumw== X-Google-Smtp-Source: AGHT+IGfRVAH/8cvT9hmm4Ha5Eu0JN6NTmiZ2ExPb4m6TDcyvIXswopr0JkqwntNsAW38gNPKGfKow== X-Received: by 2002:a92:cac2:0:b0:357:f72d:ad06 with SMTP id m2-20020a92cac2000000b00357f72dad06mr285038ilq.2.1700606186826; Tue, 21 Nov 2023 14:36:26 -0800 (PST) Received: from ?IPV6:2605:a601:adae:4500:3d43:c8e2:1496:e620? ([2605:a601:adae:4500:3d43:c8e2:1496:e620]) by smtp.gmail.com with ESMTPSA id 8-20020a056e020ca800b0034aa175c9c3sm3434455ilg.87.2023.11.21.14.36.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Nov 2023 14:36:26 -0800 (PST) Message-ID: <70ff59ea-378c-4d53-899a-eafffcad22fd@sifive.com> Date: Tue, 21 Nov 2023 16:36:25 -0600 Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 1/5] RISC-V: Add stubs for sbi_console_putchar/getchar() Content-Language: en-US To: Anup Patel Cc: Conor Dooley , Andrew Jones , linux-riscv@lists.infradead.org, linux-serial@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , Paul Walmsley , Greg Kroah-Hartman , Jiri Slaby References: <20231118033859.726692-1-apatel@ventanamicro.com> <20231118033859.726692-2-apatel@ventanamicro.com> From: Samuel Holland In-Reply-To: <20231118033859.726692-2-apatel@ventanamicro.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Anup, On 2023-11-17 9:38 PM, 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 0892f4421bc4..66f3933c14f6 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 -ENOENT; } "The SBI call returns the byte on success, or -1 for failure." So -ENOENT is not really an appropriate value to return here. Regards, Samuel > +#endif > long sbi_get_mvendorid(void); > long sbi_get_marchid(void); > long sbi_get_mimpid(void); 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 50424C61D97 for ; Tue, 21 Nov 2023 23:36:55 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=google header.b=L/2XfFWb; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4SZgks6Vc7z3ckQ for ; Wed, 22 Nov 2023 10:36:53 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=google header.b=L/2XfFWb; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sifive.com (client-ip=2607:f8b0:4864:20::12b; helo=mail-il1-x12b.google.com; envelope-from=samuel.holland@sifive.com; receiver=lists.ozlabs.org) Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4SZfPH2nhPz3c18 for ; Wed, 22 Nov 2023 09:36:33 +1100 (AEDT) Received: by mail-il1-x12b.google.com with SMTP id e9e14a558f8ab-359d796abd6so764705ab.0 for ; Tue, 21 Nov 2023 14:36:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1700606187; x=1701210987; darn=lists.ozlabs.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=Czx5VSw2pBO1b75rdOa8rP1Tn4/X67nT2FHShLEAAdk=; b=L/2XfFWb5DbBTi1fxD7CMic3v19CCudXW0pYCQVCylZCxwgbmorcrewARD+My0KQPb l3DG2Kvkq6NQhGAPzm4+xpbe3P29O4dzdjgvNSC8oIDNWmDLcuCWwkMnJ8lJ0z846R0R FozH01nOm6l20Fj/JbDHsybnImUFDGLuQyz4Fe5ROcBFlp9KeNeWhG5tPMyOTGp6CGKI rMAuVPTZd/y6SLYCLDF+13j8Y3QgFRTl7Z/fEhy4oyH7YkAuNPLx3DLZtsOJQuVgREnS gPZEh92HMBT3VSZIVaaN58DGMW2YOMOIidwU7/J3NcbWkgq/JkqHpPUdVkvRTV3agBSA PeFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700606187; x=1701210987; 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=Czx5VSw2pBO1b75rdOa8rP1Tn4/X67nT2FHShLEAAdk=; b=Y+YNJzOvW/sHxHvwNPQI03/wdHPSkm5FukxVSkGkLDobrEQ7zrvAz9gtV7F+Xy7pFF Jiqe/LdytFVqcAa8jcbtU+ReA5uCjoxLl9EDVBmhBRSrsvDarzQgrdllJRlXLikOmCui I3OHg0fBoUX0wnlnR0ba72BpAHykj/2xX8IsLsbzc5DI8jsLcMHrulDuf10jkIodGhf2 P/WGuP7/rWAkl84+GHJrnlKjHCzYhENPG0jdY8/J5Rbsd4TrUaS1HcV42axD38RODRoA wjM+xK9Mih6FN1Oyy+lEpiD6ckSucuNL7XL2SnRhrKcy3h4pAfcX5vtHM5OgpWR/jyzy 8uYA== X-Gm-Message-State: AOJu0YzEya5In4WDRCF3rIg/nqLUKVsVd8+gCFzc1fZA4vXBC3HjqbeY mghu7f6GiMI6StoLiLhvYV66Bw== X-Google-Smtp-Source: AGHT+IGfRVAH/8cvT9hmm4Ha5Eu0JN6NTmiZ2ExPb4m6TDcyvIXswopr0JkqwntNsAW38gNPKGfKow== X-Received: by 2002:a92:cac2:0:b0:357:f72d:ad06 with SMTP id m2-20020a92cac2000000b00357f72dad06mr285038ilq.2.1700606186826; Tue, 21 Nov 2023 14:36:26 -0800 (PST) Received: from ?IPV6:2605:a601:adae:4500:3d43:c8e2:1496:e620? ([2605:a601:adae:4500:3d43:c8e2:1496:e620]) by smtp.gmail.com with ESMTPSA id 8-20020a056e020ca800b0034aa175c9c3sm3434455ilg.87.2023.11.21.14.36.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Nov 2023 14:36:26 -0800 (PST) Message-ID: <70ff59ea-378c-4d53-899a-eafffcad22fd@sifive.com> Date: Tue, 21 Nov 2023 16:36:25 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 1/5] RISC-V: Add stubs for sbi_console_putchar/getchar() Content-Language: en-US To: Anup Patel References: <20231118033859.726692-1-apatel@ventanamicro.com> <20231118033859.726692-2-apatel@ventanamicro.com> From: Samuel Holland In-Reply-To: <20231118033859.726692-2-apatel@ventanamicro.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Wed, 22 Nov 2023 10:36:05 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jiri Slaby , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Conor Dooley , Palmer Dabbelt , linux-serial@vger.kernel.org, Paul Walmsley , linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, Andrew Jones Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Hi Anup, On 2023-11-17 9:38 PM, 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 0892f4421bc4..66f3933c14f6 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 -ENOENT; } "The SBI call returns the byte on success, or -1 for failure." So -ENOENT is not really an appropriate value to return here. Regards, Samuel > +#endif > long sbi_get_mvendorid(void); > long sbi_get_marchid(void); > long sbi_get_mimpid(void);