From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.17307.1677658416942293312 for ; Wed, 01 Mar 2023 00:13:37 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ge3G1qAB; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677658415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Tgw3Z/nCIbVz1ybOpz/3VflWQ/XuqaWWvWTL7zGgzkU=; b=ge3G1qABmdOD6dtT/lA/l1DLO4LYEDBc41wcHmbh7Vn+h6hgSmi9bdF5QsifMJoPdyyB5H blkk9oQMRvGhaDpsOUfjCLg/VTzkXzovTGh9eCNDHGwJJccEXl60MufEY/Vb0L/mDpjt5g WlPiMOujiqyCTP2evWmecMFcsLCg7Co= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-481-fRB01Jl2OEuSF5C-Rf7pmw-1; Wed, 01 Mar 2023 03:13:34 -0500 X-MC-Unique: fRB01Jl2OEuSF5C-Rf7pmw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E25503C0CD55; Wed, 1 Mar 2023 08:13:33 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AD8B42166B26; Wed, 1 Mar 2023 08:13:33 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 3F5011800908; Wed, 1 Mar 2023 09:13:32 +0100 (CET) Date: Wed, 1 Mar 2023 09:13:32 +0100 From: "Gerd Hoffmann" To: devel@edk2.groups.io, andrei.warkentin@intel.com Cc: Daniel Schaefer , Sunil V L Subject: Re: [edk2-devel] [edk2 2/2] MdePkg: add BaseSerialPortLibRiscVSbi Message-ID: <20230301081332.lzb5v7enjfillnfb@sirius.home.kraxel.org> References: <20230301074358.26356-1-andrei.warkentin@intel.com> <20230301074358.26356-3-andrei.warkentin@intel.com> MIME-Version: 1.0 In-Reply-To: <20230301074358.26356-3-andrei.warkentin@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, > + while ((Index < NumberOfBytes) && SerialPortPoll ()) { > + Buffer[Index++] = (UINT8)mLastGetChar; > + mLastGetChar = -1; > + } Why do you use a global variable to pass the character? SerialPortPoll could just return it directly ... take care, Gerd