From nobody Mon Feb 9 18:17:48 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605480133; cv=none; d=zohomail.com; s=zohoarc; b=I/LrvrH/x8+1fKfTaqn/xphoDQGjtxNay+nQLcL0CdaeqiABS0S4bEaYRQLcGrmlmZY0xaHtcfxJFFHD2eCUcqwCnY/z8fJ99M9JqAoWQNs668FmvMpLUye6J8T25N4JrvVqa50XjU3no98R+HEqHfsgPv5xY7Yyo8x6b33sOr8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605480133; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jNBQehzeHZf620Wy5iH4Q5itvrw949b87YQTXO/Cb1Q=; b=S+Ytx8ReoF+j1j9B2xIwb1g34RYmSPBy2MRCT2Ld7PxvOBpUlMPlyq73q2JOk7UeG+qUUwjbtt57d9RjRY+B5x3YlPNH38IwajNJDI5VCKW4ZLapbo7uOhIDPDOMfiViPdB4I8mgSs/1M65mINxRX1Xn2DlkfZ0BpvYHLZOvyqQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16054801338081004.4204537422404; Sun, 15 Nov 2020 14:42:13 -0800 (PST) Received: from localhost ([::1]:59070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1keQiq-0005Tx-HQ for importer@patchew.org; Sun, 15 Nov 2020 17:42:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1keQVA-00011t-FE for qemu-devel@nongnu.org; Sun, 15 Nov 2020 17:28:04 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:32578) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1keQV8-0001b4-E2 for qemu-devel@nongnu.org; Sun, 15 Nov 2020 17:28:04 -0500 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-265-1aTfaOptMGiQCmTNfMb91Q-1; Sun, 15 Nov 2020 17:27:57 -0500 Received: by mail-wm1-f72.google.com with SMTP id g3so7739433wmh.9 for ; Sun, 15 Nov 2020 14:27:57 -0800 (PST) Received: from redhat.com (bzq-79-176-118-93.red.bezeqint.net. [79.176.118.93]) by smtp.gmail.com with ESMTPSA id q5sm16382583wrf.41.2020.11.15.14.27.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Nov 2020 14:27:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605479281; 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=jNBQehzeHZf620Wy5iH4Q5itvrw949b87YQTXO/Cb1Q=; b=YMwZLuXUxWbpvfuK1s4EF20+j8xQ1smv9G8H3nvmJ9gZAWS4ZCGFJVIKh+cUadVp+qnvSD y9f5pnkJVXTsbyqyfiHSHL6W6MzAnIFkCVQBTfzlLMv+SpLFroWmRCORCLYlO2FkQn5/Kq iiMBDm2XOsiU6gTtOngt7qf6IioQ0f8= X-MC-Unique: 1aTfaOptMGiQCmTNfMb91Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=jNBQehzeHZf620Wy5iH4Q5itvrw949b87YQTXO/Cb1Q=; b=Bujb3wPSgGjTrQAvQGgABOTjnOXy6TQn29MYO4yu5WORRfaHPsJSHpaJpNaKqRu65Z 7AYSslLQ4HaxmRWdDaZHXoZ690aOuDgO75nYt7mEVLtKEBMnK1pGpep2kWIXLQPlZA4A 5G769zzSIz09Usmu3QEdyB1zCqVU3BPcyEsKRsjeOFNy/A9z9Undq6M9CPb9jmYBdQPg g+PB7BrDhy/ZBjbKPXT6HmqdvHq0s9ept664YXHTg/eS6aAOx0Dwq8qZGsteoX7GZKpe XG11oEaFwZX3ME2E4NJ5suGD0U+qL8BBnh/QrZyhTowOijDALCvBh45fTEfywfc+eHWp qWqQ== X-Gm-Message-State: AOAM531P+oWODztdvYRC+dtoQ4ulUoVIoc1RZfOYLbAcImCfHcheMV2+ ucQJVGrK5/jO/B/AxoEXa6trC+5wU23fNd3T3fDJ/GCyhS1Ml+9cTsNS0lsdm20vamWnfh18Xv7 CYWZCQjH71/gWFQV6+n2Bi0yB559w135ojOz/lMup5msiKDyuPg0Vb/PEvlG0 X-Received: by 2002:a5d:4e46:: with SMTP id r6mr15863237wrt.218.1605479276185; Sun, 15 Nov 2020 14:27:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJwpsgZiqiK1laYk3oa6PqbMLPx9gxEVcNdVQ/RxWq7EoSXmFX2yo1ZT5ZmwSC8nlvqK2CUDkA== X-Received: by 2002:a5d:4e46:: with SMTP id r6mr15863215wrt.218.1605479275970; Sun, 15 Nov 2020 14:27:55 -0800 (PST) Date: Sun, 15 Nov 2020 17:27:53 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 16/17] contrib/libvhost-user: Fix bad printf format specifiers Message-ID: <20201115220740.488850-17-mst@redhat.com> References: <20201115220740.488850-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20201115220740.488850-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/15 16:39:49 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Raphael Norwitz , AlexChen , Stefan Hajnoczi , Euler Robot , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: AlexChen We should use printf format specifier "%u" instead of "%d" for argument of type "unsigned int". Reported-by: Euler Robot Signed-off-by: Alex Chen Message-Id: <5FA28106.6000901@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- contrib/libvhost-user/libvhost-user.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/= libvhost-user.c index bfec8a881a..5c73ffdd6b 100644 --- a/contrib/libvhost-user/libvhost-user.c +++ b/contrib/libvhost-user/libvhost-user.c @@ -701,7 +701,7 @@ vu_add_mem_reg(VuDev *dev, VhostUserMsg *vmsg) { return false; } =20 - DPRINT("Adding region: %d\n", dev->nregions); + DPRINT("Adding region: %u\n", dev->nregions); DPRINT(" guest_phys_addr: 0x%016"PRIx64"\n", msg_region->guest_phys_addr); DPRINT(" memory_size: 0x%016"PRIx64"\n", @@ -848,7 +848,7 @@ vu_set_mem_table_exec_postcopy(VuDev *dev, VhostUserMsg= *vmsg) VhostUserMemory m =3D vmsg->payload.memory, *memory =3D &m; dev->nregions =3D memory->nregions; =20 - DPRINT("Nregions: %d\n", memory->nregions); + DPRINT("Nregions: %u\n", memory->nregions); for (i =3D 0; i < dev->nregions; i++) { void *mmap_addr; VhostUserMemoryRegion *msg_region =3D &memory->regions[i]; @@ -938,7 +938,7 @@ vu_set_mem_table_exec(VuDev *dev, VhostUserMsg *vmsg) return vu_set_mem_table_exec_postcopy(dev, vmsg); } =20 - DPRINT("Nregions: %d\n", memory->nregions); + DPRINT("Nregions: %u\n", memory->nregions); for (i =3D 0; i < dev->nregions; i++) { void *mmap_addr; VhostUserMemoryRegion *msg_region =3D &memory->regions[i]; @@ -1049,8 +1049,8 @@ vu_set_vring_num_exec(VuDev *dev, VhostUserMsg *vmsg) unsigned int index =3D vmsg->payload.state.index; unsigned int num =3D vmsg->payload.state.num; =20 - DPRINT("State.index: %d\n", index); - DPRINT("State.num: %d\n", num); + DPRINT("State.index: %u\n", index); + DPRINT("State.num: %u\n", num); dev->vq[index].vring.num =3D num; =20 return false; @@ -1105,8 +1105,8 @@ vu_set_vring_base_exec(VuDev *dev, VhostUserMsg *vmsg) unsigned int index =3D vmsg->payload.state.index; unsigned int num =3D vmsg->payload.state.num; =20 - DPRINT("State.index: %d\n", index); - DPRINT("State.num: %d\n", num); + DPRINT("State.index: %u\n", index); + DPRINT("State.num: %u\n", num); dev->vq[index].shadow_avail_idx =3D dev->vq[index].last_avail_idx =3D = num; =20 return false; @@ -1117,7 +1117,7 @@ vu_get_vring_base_exec(VuDev *dev, VhostUserMsg *vmsg) { unsigned int index =3D vmsg->payload.state.index; =20 - DPRINT("State.index: %d\n", index); + DPRINT("State.index: %u\n", index); vmsg->payload.state.num =3D dev->vq[index].last_avail_idx; vmsg->size =3D sizeof(vmsg->payload.state); =20 @@ -1478,8 +1478,8 @@ vu_set_vring_enable_exec(VuDev *dev, VhostUserMsg *vm= sg) unsigned int index =3D vmsg->payload.state.index; unsigned int enable =3D vmsg->payload.state.num; =20 - DPRINT("State.index: %d\n", index); - DPRINT("State.enable: %d\n", enable); + DPRINT("State.index: %u\n", index); + DPRINT("State.enable: %u\n", enable); =20 if (index >=3D dev->max_queues) { vu_panic(dev, "Invalid vring_enable index: %u", index); @@ -1728,7 +1728,7 @@ vu_handle_vring_kick(VuDev *dev, VhostUserMsg *vmsg) return false; } =20 - DPRINT("Got kick message: handler:%p idx:%d\n", + DPRINT("Got kick message: handler:%p idx:%u\n", dev->vq[index].handler, index); =20 if (!dev->vq[index].started) { @@ -1772,7 +1772,7 @@ vu_process_message(VuDev *dev, VhostUserMsg *vmsg) DPRINT("Request: %s (%d)\n", vu_request_to_string(vmsg->request), vmsg->request); DPRINT("Flags: 0x%x\n", vmsg->flags); - DPRINT("Size: %d\n", vmsg->size); + DPRINT("Size: %u\n", vmsg->size); =20 if (vmsg->fd_num) { int i; --=20 MST