From nobody Tue Apr 23 08:24:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 ARC-Seal: i=1; a=rsa-sha256; t=1605843546; cv=none; d=zohomail.com; s=zohoarc; b=kN9CxJ4DKWR/mJT6kE8y/G+G+Qply3Rvu0jWUGZ3vmNpNqoJm6/bawYO2uHmAnCce0nAA18gF51uDF6dn1+PGUGWnKtDuxGfIL/5SiMiL2gCXHhJ2m79KsQ/WFBKaKQcTHG9cRcheZik2Osprk98HBkzsyc237GEzL7p4i+Q1ms= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605843546; h=Content-Type:Content-Transfer-Encoding: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=aLKsPZ7nT25gb1pNJZAuuKMkCWv7eNVNH5nmyTyqw7s=; b=YfMMVuBH6OGsry6zI5gR1F2W4BwDQtYzqYxwSBEXZVfbmsUyfO5Ru1mgmx7ityA/jAeg9f9ackbbwYcijKKWMTq5AfNQAL4ha0WASAZuI9lU/5MJ35siuXD5twB1iqD9llKvl1f3KNIziRg6z32lnUStEXyba0SFaIJJ3XAHcMk= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605843545921702.4944197194816; Thu, 19 Nov 2020 19:39:05 -0800 (PST) Received: from localhost ([::1]:45798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfxGK-0002v5-Gt for importer@patchew.org; Thu, 19 Nov 2020 22:39:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfxEh-0001c0-JY; Thu, 19 Nov 2020 22:37:23 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:2531) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfxEe-0006ux-Vv; Thu, 19 Nov 2020 22:37:23 -0500 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Ccj050J3gzhZrl; Fri, 20 Nov 2020 11:36:53 +0800 (CST) Received: from huawei.com (10.175.124.27) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Fri, 20 Nov 2020 11:37:02 +0800 From: Alex Chen To: , , Subject: [PATCH v2 1/2] display/vmware_vga: Fix bad printf format specifiers Date: Fri, 20 Nov 2020 03:25:16 +0000 Message-ID: <20201120032517.104486-2-alex.chen@huawei.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20201120032517.104486-1-alex.chen@huawei.com> References: <20201120032517.104486-1-alex.chen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.124.27] X-CFilter-Loop: Reflected 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=45.249.212.191; envelope-from=alex.chen@huawei.com; helo=szxga05-in.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, 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: alex.chen@huawei.com, qemu-trivial@nongnu.org, peter.maydell@linaro.org, qemu-devel@nongnu.org, zhang.zhanghailiang@huawei.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/display/vmware_vga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index bef0d7d69a..f93bbe15c2 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -534,7 +534,7 @@ static inline void vmsvga_cursor_define(struct vmsvga_s= tate_s *s, #endif break; default: - fprintf(stderr, "%s: unhandled bpp %d, using fallback cursor\n", + fprintf(stderr, "%s: unhandled bpp %u, using fallback cursor\n", __func__, c->bpp); cursor_put(qc); qc =3D cursor_builtin_left_ptr(); --=20 2.19.1 From nobody Tue Apr 23 08:24:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 ARC-Seal: i=1; a=rsa-sha256; t=1605843590; cv=none; d=zohomail.com; s=zohoarc; b=D/54M1dgrJvmoazhvraF4B6VhrH8g6TvPZiZ4uq8fTfaUfKjN7svw+io0nSajCPN2qFFLkEgCVU95pP65uZkFqvHPIi6I0B2KFL8w1d56iIgmT2SvPA895yX7MPDbDeUEZ5BlO51tCxz+EuFTRgpVep043eAprivRvHDrqy7RqI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605843590; h=Content-Type:Content-Transfer-Encoding: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=bTgAmZ8zVpaTXqu5+Tl+tzp9aVSUxaVJLeL+JmQGGHI=; b=k7jq3M2CBvDHVIfnlmsewkr0BAbeNUwE3yFqviZcVpmau+jy6rgVhib1BNuzH3thuzCnz7xrQbh6h4YHn9Z3zRDm3yZdUfdm7HqsQrBUWmCS/fTigv75+GOk3tOCcAzlKNXO9AKsmYdthC6tfNioF2PCWe2LdIN2WsCERezEhKQ= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605843590540450.54316625153194; Thu, 19 Nov 2020 19:39:50 -0800 (PST) Received: from localhost ([::1]:47428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfxH3-0003aM-JI for importer@patchew.org; Thu, 19 Nov 2020 22:39:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfxEk-0001cS-1u; Thu, 19 Nov 2020 22:37:27 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:2532) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfxEg-0006uv-Jl; Thu, 19 Nov 2020 22:37:25 -0500 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Ccj050WX1zhbg8; Fri, 20 Nov 2020 11:36:53 +0800 (CST) Received: from huawei.com (10.175.124.27) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Fri, 20 Nov 2020 11:37:03 +0800 From: Alex Chen To: , , Subject: [PATCH v2 2/2] display/vmware_vga: Replace fprintf(stderr, "*\n") with error_report() Date: Fri, 20 Nov 2020 03:25:17 +0000 Message-ID: <20201120032517.104486-3-alex.chen@huawei.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20201120032517.104486-1-alex.chen@huawei.com> References: <20201120032517.104486-1-alex.chen@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.124.27] X-CFilter-Loop: Reflected 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=45.249.212.191; envelope-from=alex.chen@huawei.com; helo=szxga05-in.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, 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: alex.chen@huawei.com, qemu-trivial@nongnu.org, peter.maydell@linaro.org, qemu-devel@nongnu.org, zhang.zhanghailiang@huawei.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Replace all fprintf(stderr...) calls in hw/display/vmware_vga.c witherror_r= eport(). Remove the "\n" from strings passed to all modified calls, since error_repo= rt() appends one. Signed-off-by: Alex Chen --- hw/display/vmware_vga.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index f93bbe15c2..a012e22e69 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -34,6 +34,7 @@ #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "qom/object.h" +#include "qemu/error-report.h" =20 #undef VERBOSE #define HW_RECT_ACCEL @@ -298,45 +299,45 @@ static inline bool vmsvga_verify_rect(DisplaySurface = *surface, int x, int y, int w, int h) { if (x < 0) { - fprintf(stderr, "%s: x was < 0 (%d)\n", name, x); + error_report("%s: x was < 0 (%d)", name, x); return false; } if (x > SVGA_MAX_WIDTH) { - fprintf(stderr, "%s: x was > %d (%d)\n", name, SVGA_MAX_WIDTH, x); + error_report("%s: x was > %d (%d)", name, SVGA_MAX_WIDTH, x); return false; } if (w < 0) { - fprintf(stderr, "%s: w was < 0 (%d)\n", name, w); + error_report("%s: w was < 0 (%d)", name, w); return false; } if (w > SVGA_MAX_WIDTH) { - fprintf(stderr, "%s: w was > %d (%d)\n", name, SVGA_MAX_WIDTH, w); + error_report("%s: w was > %d (%d)", name, SVGA_MAX_WIDTH, w); return false; } if (x + w > surface_width(surface)) { - fprintf(stderr, "%s: width was > %d (x: %d, w: %d)\n", + error_report("%s: width was > %d (x: %d, w: %d)", name, surface_width(surface), x, w); return false; } =20 if (y < 0) { - fprintf(stderr, "%s: y was < 0 (%d)\n", name, y); + error_report("%s: y was < 0 (%d)", name, y); return false; } if (y > SVGA_MAX_HEIGHT) { - fprintf(stderr, "%s: y was > %d (%d)\n", name, SVGA_MAX_HEIGHT, y); + error_report("%s: y was > %d (%d)", name, SVGA_MAX_HEIGHT, y); return false; } if (h < 0) { - fprintf(stderr, "%s: h was < 0 (%d)\n", name, h); + error_report("%s: h was < 0 (%d)", name, h); return false; } if (h > SVGA_MAX_HEIGHT) { - fprintf(stderr, "%s: h was > %d (%d)\n", name, SVGA_MAX_HEIGHT, h); + error_report("%s: h was > %d (%d)", name, SVGA_MAX_HEIGHT, h); return false; } if (y + h > surface_height(surface)) { - fprintf(stderr, "%s: update height > %d (y: %d, h: %d)\n", + error_report("%s: update height > %d (y: %d, h: %d)", name, surface_height(surface), y, h); return false; } @@ -534,7 +535,7 @@ static inline void vmsvga_cursor_define(struct vmsvga_s= tate_s *s, #endif break; default: - fprintf(stderr, "%s: unhandled bpp %u, using fallback cursor\n", + error_report("%s: unhandled bpp %u, using fallback cursor", __func__, c->bpp); cursor_put(qc); qc =3D cursor_builtin_left_ptr(); --=20 2.19.1