From patchwork Wed Sep 11 12:14:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 827407 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp764616wrc; Wed, 11 Sep 2024 05:21:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWSNOybg/ADDziNxcufhwredvb7YhLKvdkh3IGUNs4t/gKiK3/lx5dwprXQMjNpouVivqx7cA==@linaro.org X-Google-Smtp-Source: AGHT+IEelxfPUu+BkLav5/3IdPmUXus4+b4lqobXBRo9iHPgTk2fsJPGLHVECUS4OGJOGS6Bj2yH X-Received: by 2002:ac8:5ac2:0:b0:458:3ec1:63eb with SMTP id d75a77b69052e-4583ec168f7mr94533711cf.33.1726057318709; Wed, 11 Sep 2024 05:21:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726057318; cv=none; d=google.com; s=arc-20240605; b=EWafeVIBlJ5tgILWFe/H2Rf0Z/++vbpGk/CpYUBnzfBXKsut3cMHUUE+XB1XQUXeN0 p/ym8H5UIgzePxe2zMUlvBcO+GYCEnUPporoJvIBQnLdj1j7pHRAxyPOeig8S8NPgBJK UWtG1myCYUs1mBbIYwpGe9NkIfXkA2T13SoG5qCq2OCPqqLTcQZ7dQs0GYyhKR7qPasH NNwaTF5h3gCeioXggvTbWQZwqyR+iYCubMnvcjseT2KWw6mb1d4IUcLipH6ez3VWtzn7 Xd5dgKU9V3ish0+qscehaN391f2TU9/JyrYHvAOFWkoAqNFC2tcGB1T8HXoU94hBxJuB WJ+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NTCRQ2hPR5eh42ZfIm8LY44Myf8vzzYhRLsWqDIkSHk=; fh=9VOEO3+E7zKfVde7estkH45fC+ZbPmbJjaq+/CCwrEo=; b=iHfDjYrHTw/8uDY5iuakrdAiPCmLqXDbmZwZuQ31eiZ+YPOsyjb70P12oJWJgBdqKE jV8qS+ZU6oTyUl/C8vwPKx+wzHJ08fYLJm4vyeT1ZkwOQ3lIgwsnfFFN1NmbEHqxLCVJ DVWxH1OMaQOoTN8N5TBfWCE/VLsafbB0htba+/ePzDNyOoecjrq/izIsCkLXbbpbHNLN KqKfspm45aPj0lHFni2K+fveQGWiGGijP7p/jxZyyIPlq86HOGtTHp6eFULmzIBrbhfh Gpglgeru9/2J9JJQeoAjJdxCwEBSkkqbuj3c8unpjsrQrS6KgD0UBhE+4Q+69fxRdHG3 JNFQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aOr+GR1S; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-45834ee3ba8si70638041cf.375.2024.09.11.05.21.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Sep 2024 05:21:58 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aOr+GR1S; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1soMJl-0001Dm-SQ; Wed, 11 Sep 2024 08:19:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1soMJ6-0006Hw-9x for qemu-devel@nongnu.org; Wed, 11 Sep 2024 08:18:57 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1soMJ4-0007eY-Is for qemu-devel@nongnu.org; Wed, 11 Sep 2024 08:18:48 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-42cba0dc922so24682345e9.3 for ; Wed, 11 Sep 2024 05:18:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726057124; x=1726661924; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NTCRQ2hPR5eh42ZfIm8LY44Myf8vzzYhRLsWqDIkSHk=; b=aOr+GR1Sy+ekLHA8ms/06moYskJzvD5hOdFTWN7GiTAy+2SJQel1Xk3hs53fZ+aBhV WE9Z4rOp4aLJq6p8FUowWbrPs3mKY5HKtiSS6rbnqqKFSN6YhFYD/sQX/pYPTEqAWj87 EiO/BgU2tibf41OuTJK9jfgnUb1w98S2Eu9tfUm/eM4MI77CG0Cd8+ZCUIvzz+W5Z4gP aNX21LcKfy/b2mOJMlIccaX4xWw7669pyULX4Wt4N/JooImFujBDMjnSpnXwOTA8G7pF QjmpBZmlV0INP8O0vTqQ6yrAUsx6BbGrsKD7jJyJMnfeKQkb9GwhizR6G/qQi1m0HYCn frCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726057124; x=1726661924; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NTCRQ2hPR5eh42ZfIm8LY44Myf8vzzYhRLsWqDIkSHk=; b=ZpnqmZpB3PharxALYGYLlNTuSpiTI8x7jaCslAXNmX/mGmTmXCWjNkhjrDk4497VDY iG0H6YgEHxtKNTOykfFPv63ZIRseo2qlZvJM8If+r/+URCdmniIfj/LjuoZvyuNJ+OcQ UZU8blF6hVEJgyvk5NXGwmdKdVNWtVnsIcShJftnoRvA2JosI7oyfsrZDesNmh24LET0 R7TGVPC3yK3erN82iF4EQWprCMOL3hG7Ds0oeFzg3JfvooNvjHbAuDVwtRLVcDZ6dAZv MMvOYp05nkGXVODZn/5/f6/6FjWvPADuOhYjZwl1QtO81e/1d3pffTPJhcBYAK4lYUES qPFw== X-Gm-Message-State: AOJu0YxTkpMwtzyxbzPt+fWpJjjfLmlPTJ1409iUXLOpoDUKcNbAILEx FUJfDIqkePTg3silyq8kCi6SvuX0+tA6d0RBh88/xfhZ7iiJGEZOV4vi1VTQK/4kjkGvKKsnGEu J X-Received: by 2002:adf:f489:0:b0:374:baf1:41bb with SMTP id ffacd0b85a97d-37892685979mr7400650f8f.3.1726057124310; Wed, 11 Sep 2024 05:18:44 -0700 (PDT) Received: from m1x-phil.lan ([176.187.196.107]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42caeb815f4sm142568945e9.30.2024.09.11.05.18.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Sep 2024 05:18:43 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Octavian Purdila , Alistair Francis , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= Subject: [PULL 36/56] fifo8: rename fifo8_pop_buf() to fifo8_peekpop_buf() Date: Wed, 11 Sep 2024 14:14:01 +0200 Message-ID: <20240911121422.52585-37-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240911121422.52585-1-philmd@linaro.org> References: <20240911121422.52585-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Mark Cave-Ayland The fifo8_pop_buf() function will soon also be used for peek operations, so rename the function accordingly. Create a new fifo8_pop_buf() wrapper function that can be used by existing callers. Signed-off-by: Mark Cave-Ayland Reviewed-by: Octavian Purdila Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-ID: <20240828122258.928947-6-mark.cave-ayland@ilande.co.uk> Signed-off-by: Philippe Mathieu-Daudé --- util/fifo8.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/util/fifo8.c b/util/fifo8.c index efe0117b1f..5453cbc1b0 100644 --- a/util/fifo8.c +++ b/util/fifo8.c @@ -105,7 +105,8 @@ const uint8_t *fifo8_pop_bufptr(Fifo8 *fifo, uint32_t max, uint32_t *numptr) return fifo8_peekpop_bufptr(fifo, max, 0, numptr, true); } -uint32_t fifo8_pop_buf(Fifo8 *fifo, uint8_t *dest, uint32_t destlen) +static uint32_t fifo8_peekpop_buf(Fifo8 *fifo, uint8_t *dest, uint32_t destlen, + bool do_pop) { const uint8_t *buf; uint32_t n1, n2 = 0; @@ -134,6 +135,11 @@ uint32_t fifo8_pop_buf(Fifo8 *fifo, uint8_t *dest, uint32_t destlen) return n1 + n2; } +uint32_t fifo8_pop_buf(Fifo8 *fifo, uint8_t *dest, uint32_t destlen) +{ + return fifo8_peekpop_buf(fifo, dest, destlen, true); +} + void fifo8_drop(Fifo8 *fifo, uint32_t len) { len -= fifo8_pop_buf(fifo, NULL, len);