From patchwork Mon Jul 22 16:07:42 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: 813731 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1941304wro; Mon, 22 Jul 2024 09:09:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXuTReTxuHMtjLkZoSHeSBlGvkofjcHqbXrU8IWwPLlu1Y1yydn21/WjrRJtCRf3iRHs/T5Ojs6EmoKkgKL3pMU X-Google-Smtp-Source: AGHT+IHAyCMiNs9GBA/yB1S1rPQ4kmYLK8zE43ix/lZMCXUuk3onV7Zsvus1kEf7NSb8z6mbw5lx X-Received: by 2002:a05:620a:4092:b0:79c:130:452b with SMTP id af79cd13be357-7a1a65f01d9mr1020288985a.47.1721664557071; Mon, 22 Jul 2024 09:09:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721664557; cv=none; d=google.com; s=arc-20160816; b=U+jnmf9kLAGaxxJthg6Odmlm41Tb550bnn/OvSoVd50XxircCrwVHzY7/rNtgki6mU oun1EG1M7umFppDRvdgIlox9govPBS++9ySzKTfvxt/MIipauye/OORqWkgrKYLYm7t8 dPnSgEEjaPrezVdxr/agcHlAZlvp2DTp8bv+xZWxf97ONrkJkpIqIpWjgsn40m/m/KQg 1X7X45GtU1iEICAtbha5Lrv69HMZSxBdU340vZh06P0My0omMkxPQaoYSiPR70lowtQM xHEZeRbuxBAN33syXOSohSBzh/M+BiDsDAkPIEn33vjI0qEk5MYKBRFaIclSO1ukldoo pYmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=g5IVJQKs0mRewT92ekkS2OE3V+7eufImd7ZnhLfAtiw=; fh=pA26/TpFHAj3dhwie1wJOLhR+LuI9XikNoV1W9RAiFw=; b=gIjRgIwwls7pmbT+LZYFMpCToC/3UFexlcOeQYs/ubhZtnL5EKig15CBQBlOwQP0Qj 5ukIIk0w7febWxD8VnCwoRAWZNOoYfvgeIgcwM1mB4WIi76q+DArN3mB13DPwBrrQO2n WWyw1kkZSDsBK3jVpU9kGGcyaLEMNm9VteSRUTJY7MUOS6daMsa8hONdlStQpYAyn55a 5GS3riaA4DluTfutHeGMol0HMkZAOQOIWgPvEofLprpxN1OhhfpRNWkLXEMzkCzsBvPk K53qi+Q4M/zJL1LLjDvsannw0uRIPMvS9rdg4e2mxmwSXsMFLP/uJXreJTkHxuCL23Sw ZtjA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QTXgPtLC; 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-44f9ccf8fe8si79613911cf.151.2024.07.22.09.09.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jul 2024 09:09:17 -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=QTXgPtLC; 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 1sVvaU-0007UU-4r; Mon, 22 Jul 2024 12:08:35 -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 1sVvaP-0007F6-Tv for qemu-devel@nongnu.org; Mon, 22 Jul 2024 12:08:30 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sVvaL-0007nl-Hy for qemu-devel@nongnu.org; Mon, 22 Jul 2024 12:08:29 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4266fcb311cso33735985e9.1 for ; Mon, 22 Jul 2024 09:08:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721664502; x=1722269302; 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=g5IVJQKs0mRewT92ekkS2OE3V+7eufImd7ZnhLfAtiw=; b=QTXgPtLCanqqaoj8ztYfRyGNp7OdOHfMN/jCgmGlh8F5WfxrzZHMdxhcyqRj9/qGRC PV4P0mxJV6denC5cTxQxOmEGyfYfTs59+D5eYtZVIgGzBvd9ebC++m5E8Im8/CLeM7Uz Khc1zZpKpAgXW66naP07dKbcywx2tW8f4VR0YAaKxuXBSQSZC0kCeAMgZ1pK4S1q/O95 wn5yH8xxoKbjg30FSRVZUcylZIxwgYLzLw+IGLS4WnUOZZDm7eoLdXU4NDLbSupV9mHf oz7Q36Bx8lwOJjmxOYa15PrGJzasUkbZQG0v5IjW6INr7+RCg96XxC38BQSJ7VWpNmE9 yD/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721664502; x=1722269302; 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=g5IVJQKs0mRewT92ekkS2OE3V+7eufImd7ZnhLfAtiw=; b=cuTkbo/TfEtYrxoLgdMkHxJsNg7m+b3go3SvGJxJ8lWXV/5hdI5e/MtVyvkiuczSS/ S6uCPXp4lUKCwx9est7u6PaeOVTrK+RmnYzVYPcoeJmoo/3xIXpmzX3BOXleMg7noBzA 7+n9jNybsG9ecPloiDZc1cx0DnsevtZX1yL72AdhVXQsRhE9Fifkuaz6R1R5kpThSs7t X5T3GmxcTnfwYtPAIXzOxETUD0jBMVDokbZ/oyYt+wpnAFUYUiRR8sBMyx0PFEPeOw2t oRIYWpCiqv516XIlO5y2QNEBAy6Hgjgj8vpOvjIjOVLRG+2j48kBVV72osKa7fQMRpkZ Uz7Q== X-Gm-Message-State: AOJu0YyK1nmjKEl8MBJ3D9FDaoAzY4NhSX+CvNoeEKq60Z2SaLbYVeKO wXZyGbPmpo4xljW7V8mrpxkSPK6ziCbHxJ24ugk36TlZBY0HGLdYfGWedibIndXXLc+D8m/NiR9 8 X-Received: by 2002:a05:600c:1c9e:b0:423:791:f446 with SMTP id 5b1f17b1804b1-427dc51a01emr45867695e9.7.1721664491827; Mon, 22 Jul 2024 09:08:11 -0700 (PDT) Received: from localhost.localdomain (gen92-h02-176-184-20-254.dsl.sta.abo.bbox.fr. [176.184.20.254]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427d2a7257esm158849065e9.28.2024.07.22.09.08.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 22 Jul 2024 09:08:11 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Paolo Bonzini , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Ph?= =?utf-8?q?ilippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 4/7] util/fifo8: Rename fifo8_peek_buf() -> fifo8_peek_constbuf() Date: Mon, 22 Jul 2024 18:07:42 +0200 Message-ID: <20240722160745.67904-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240722160745.67904-1-philmd@linaro.org> References: <20240722160745.67904-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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=unavailable 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 Since fifo8_peek_buf() return a const buffer (which points directly into the FIFO backing store), rename it using the 'constbuf' suffix. This will help differentiate with methods *copying* the FIFO data. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Mark Cave-Ayland --- include/qemu/fifo8.h | 4 ++-- hw/scsi/esp.c | 2 +- util/fifo8.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/qemu/fifo8.h b/include/qemu/fifo8.h index 2692d6bfda..79450f4583 100644 --- a/include/qemu/fifo8.h +++ b/include/qemu/fifo8.h @@ -89,7 +89,7 @@ uint8_t fifo8_pop(Fifo8 *fifo); const uint8_t *fifo8_pop_buf(Fifo8 *fifo, uint32_t max, uint32_t *numptr); /** - * fifo8_peek_buf: read upto max bytes from the fifo + * fifo8_peek_constbuf: read upto max bytes from the fifo * @fifo: FIFO to read from * @max: maximum number of bytes to peek * @numptr: pointer filled with number of bytes returned (can be NULL) @@ -113,7 +113,7 @@ const uint8_t *fifo8_pop_buf(Fifo8 *fifo, uint32_t max, uint32_t *numptr); * * Returns: A pointer to peekable data. */ -const uint8_t *fifo8_peek_buf(Fifo8 *fifo, uint32_t max, uint32_t *numptr); +const uint8_t *fifo8_peek_constbuf(Fifo8 *fifo, uint32_t max, uint32_t *numptr); /** * fifo8_reset: diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 8504dd30a0..526ed91bef 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -486,7 +486,7 @@ static bool esp_cdb_ready(ESPState *s) return false; } - pbuf = fifo8_peek_buf(&s->cmdfifo, len, &n); + pbuf = fifo8_peek_constbuf(&s->cmdfifo, len, &n); if (n < len) { /* * In normal use the cmdfifo should never wrap, but include this check diff --git a/util/fifo8.c b/util/fifo8.c index 2925fe5611..21943c6032 100644 --- a/util/fifo8.c +++ b/util/fifo8.c @@ -92,7 +92,7 @@ static const uint8_t *fifo8_peekpop_buf(Fifo8 *fifo, uint32_t max, return ret; } -const uint8_t *fifo8_peek_buf(Fifo8 *fifo, uint32_t max, uint32_t *numptr) +const uint8_t *fifo8_peek_constbuf(Fifo8 *fifo, uint32_t max, uint32_t *numptr) { return fifo8_peekpop_buf(fifo, max, numptr, false); }