From patchwork Wed Jan 27 08:57:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 1432128 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DQffG6LGtz9sWD for ; Wed, 27 Jan 2021 21:16:54 +1100 (AEDT) Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4DQffG4JGKzDqtr for ; Wed, 27 Jan 2021 21:16:54 +1100 (AEDT) X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.ru (client-ip=107.174.27.60; helo=ozlabs.ru; envelope-from=aik@ozlabs.ru; receiver=) Received: from ozlabs.ru (ozlabs.ru [107.174.27.60]) by lists.ozlabs.org (Postfix) with ESMTP id 4DQfdk0ycwzDqjW for ; Wed, 27 Jan 2021 21:16:26 +1100 (AEDT) Received: from fstn1-p1.ozlabs.ibm.com (localhost [IPv6:::1]) by ozlabs.ru (Postfix) with ESMTP id 423C5AE80279; Wed, 27 Jan 2021 03:58:13 -0500 (EST) From: Alexey Kardashevskiy To: slof@lists.ozlabs.org Date: Wed, 27 Jan 2021 19:57:45 +1100 Message-Id: <20210127085752.120571-7-aik@ozlabs.ru> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210127085752.120571-1-aik@ozlabs.ru> References: <20210127085752.120571-1-aik@ozlabs.ru> Subject: [SLOF] [PATCH slof 06/13] virtio: Compile with -Wextra X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Patches for https://github.com/aik/SLOF" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" -Wextra enables a bunch of rather useful checks which this fixes. Signed-off-by: Alexey Kardashevskiy Reviewed-by: Thomas Huth --- lib/libvirtio/p9.c | 8 ++++---- lib/libvirtio/virtio.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/libvirtio/p9.c b/lib/libvirtio/p9.c index 0e595303196a..e9ba22886c06 100644 --- a/lib/libvirtio/p9.c +++ b/lib/libvirtio/p9.c @@ -142,7 +142,7 @@ void reset_buffers(void) int p9_transaction(p9_connection_t *connection) { int rc; - int tx_size = GET_SIZE; + uint32_t tx_size = GET_SIZE; uint32_t rx_size = connection->message_size; if (transact == NULL) { @@ -248,7 +248,7 @@ int p9_version(p9_connection_t *connection) int p9_attach(p9_connection_t *connection) { int rc; - int length = 19 + strlen(connection->uname) + strlen(connection->aname); + unsigned length = 19 + strlen(connection->uname) + strlen(connection->aname); if (length > connection->message_size) { return P9_MSG_TOO_LONG; @@ -372,8 +372,8 @@ int p9_walk(p9_connection_t *connection, uint32_t fid, uint32_t new_fid, s_tok = e_tok; continue; } - int tx_size = (e_tok - s_tok + 2 + GET_SIZE); - int rx_size = ((element_count + 1) * MSG_QID_SIZE + unsigned tx_size = (e_tok - s_tok + 2 + GET_SIZE); + unsigned rx_size = ((element_count + 1) * MSG_QID_SIZE + MSG_WALK_RX_HDR_SIZE); if ((tx_size > connection->message_size) || (rx_size > connection->message_size)) { diff --git a/lib/libvirtio/virtio.c b/lib/libvirtio/virtio.c index 69ac4394e104..9dfc93cb2876 100644 --- a/lib/libvirtio/virtio.c +++ b/lib/libvirtio/virtio.c @@ -436,7 +436,7 @@ struct vqs *virtio_queue_init_vq(struct virtio_device *dev, unsigned int id) void virtio_queue_term_vq(struct virtio_device *dev, struct vqs *vq, unsigned int id) { if (vq->desc_gpas) { - int i; + unsigned i; for (i = 0; i < vq->size; ++i) virtio_free_desc(vq, i, dev->features);