From patchwork Fri May 8 11:00:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 11536327 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8204F14C0 for ; Fri, 8 May 2020 11:09:59 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 580F8208CA for ; Fri, 8 May 2020 11:09:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="LDQnwvUg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 580F8208CA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:36926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jX0tC-00015l-Dq for patchwork-qemu-devel@patchwork.kernel.org; Fri, 08 May 2020 07:09:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jX0s8-0007WB-Dm; Fri, 08 May 2020 07:08:52 -0400 Received: from mail-co1nam11on2082.outbound.protection.outlook.com ([40.107.220.82]:4353 helo=NAM11-CO1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jX0s6-0001zT-Jy; Fri, 08 May 2020 07:08:51 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kcplALkykxEREBPw26mbZU0+hz8Ld1swtkWz8V61I8ywXzfRn6S6Fr8L0poEKYz+CdBXaGb6/sNwEoAac78I2AYwy2D4Dma63d0BQH+IfOtn1spcTBK7AUd8wSPra8ADcg8mw9XRqhToHQsIe87dNQv7Ch0y/Vv4c/gTmzhHw6e/JOYBvxItbpax6nORoRSComtM1GQ3b18e7anHoqcFn0iGwlHZ/LLdTwr0lLA4LGHB/VLAmNkvTM6G93d/jfKdToOyNEVjbAoUHEi5CpaaD5vy1PWL1j7YNXS344pJrq1qaVeiLHGBIv4fDmYvpTg8to29/Lc//P24hwknVRym4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LESl2Nsq7hhBO4d5G5mzmlhkpSFmoMlRKweyrxfXzMg=; b=MGK914rYkgLidVoGZf4zGHwg2uovg5PxTemhMQ+Em/aS54hUlCbwjWpe0azMU1OR0MUxpIeJrK3UWvXzqqQqZ/2yOEZFICLI/cjMAZPCkZyX+61b3OoGvvuxV9P98Y5H9nrmNuOmWBgDpbQrr0gEP9dAbP4NRlh+Y92oIvt9knI2vqsmnZOUHDvU64zhLQX3WAZ98QuMzETgl1L3hT1nyfdc8VWwlz4/bj3Wfml+h/zjNeR6cAQsqzsS+8UIJnaez8Kez21jHkoijxLF5R28Fr6GcbdmGlPNuSSfr6eokU7FHP0Gn05R7rgEjPmP/CaKx/gb4EXzUS/Xm4gPZIwblQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=wdc.com smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LESl2Nsq7hhBO4d5G5mzmlhkpSFmoMlRKweyrxfXzMg=; b=LDQnwvUgow4HTpzrBC81SHyC08ZZmnq30F5EspFlS2I+WAOAyaNQ5fwSduaJYx0PsBiPeQANbZawN3RlL0twFohq9I/MO+Zsg1biUYpmLkt7eTP6JmGUfnzlEjxd4LX4Nl2HuGYQMy/vdZVgwnqUM6mjLjPlxd/ZDBajUFqX1Lg= Received: from DM6PR03CA0026.namprd03.prod.outlook.com (2603:10b6:5:40::39) by BN7PR02MB3939.namprd02.prod.outlook.com (2603:10b6:406:f5::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.29; Fri, 8 May 2020 11:08:47 +0000 Received: from CY1NAM02FT007.eop-nam02.prod.protection.outlook.com (2603:10b6:5:40:cafe::25) by DM6PR03CA0026.outlook.office365.com (2603:10b6:5:40::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28 via Frontend Transport; Fri, 8 May 2020 11:08:46 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; wdc.com; dkim=none (message not signed) header.d=none;wdc.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT007.mail.protection.outlook.com (10.152.75.5) with Microsoft SMTP Server id 15.20.2979.29 via Frontend Transport; Fri, 8 May 2020 11:08:46 +0000 Received: from [149.199.38.66] (port=35666 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jX0rr-0002Te-8H; Fri, 08 May 2020 04:08:35 -0700 Received: from [127.0.0.1] (helo=xsj-smtp-dlp1.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jX0s2-0005ZU-1f; Fri, 08 May 2020 04:08:46 -0700 Received: from xsj-pvapsmtp01 (mailhub.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 048B8iSX017502; Fri, 8 May 2020 04:08:45 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jX0s0-0005YN-Ni; Fri, 08 May 2020 04:08:44 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id A94CA13C03F7; Fri, 8 May 2020 16:30:52 +0530 (IST) From: Sai Pavan Boddu To: "Edgar E. Iglesias" , Alistair Francis , Peter Maydell , Jason Wang , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Tong Ho , Ramon Fried Subject: [PATCH v3 01/11] net: cadence_gem: Fix debug statements Date: Fri, 8 May 2020 16:30:35 +0530 Message-Id: <1588935645-20351-2-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588935645-20351-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1588935645-20351-1-git-send-email-sai.pavan.boddu@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapsmtpgw01; PTR:unknown-60-83.xilinx.com; CAT:NONE; SFTY:; SFS:(136003)(346002)(376002)(396003)(39860400002)(46966005)(33430700001)(4326008)(426003)(70206006)(42186006)(336012)(47076004)(5660300002)(6666004)(356005)(82310400002)(82740400003)(2616005)(316002)(70586007)(33440700001)(8936002)(2906002)(8676002)(81166007)(110136005)(186003)(478600001)(26005)(6266002)(36756003); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8e9440cb-ca0b-4717-ca60-08d7f3402d83 X-MS-TrafficTypeDiagnostic: BN7PR02MB3939: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:127; X-Forefront-PRVS: 039735BC4E X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NcakD7k2l9uCdfdVq5xXl1VyIEKrVJP8ANoywHqn1Xc2aP0kKtOxKe4SrauSURYt05bIvNUDhS90cGT78oT6uDH3KuAWiYpNk/NA6jzY4MBhnW13rtgVYPu/faxflnxXKe/DqANbAj4MeOv1pgKn1CY0kUYtHLQbzp5PbZa4UGGuVqK2DOG6V77N0BiDzzMj0fcoTRbznY4lvnncpIH5MarvbKWJeVVio+yIb4fTXz5bflTCDBLSLoiIztQLrtg7M0E9M/qxfewKTtiQ+0ODcGipkZXIC5qDBX6W85ejjgoUR0ekmjVj6sUKji8equukPNYxMEy+slyPBzcavnSjwELmli6KMZS2lLGpGAH2sg8r12U4fTNWh8zIrb33hG5INuunV20y3HaTwy9/swZ8MSYvGHKwXUml95Blzw6xBHXNssIaZlj2WGzRVpsoY6e4/jB2IEBBAxzZ7+BoiCBC0HlUyJJ2cwjm2LEAlTVBhP5dM3qbKdczAPAMPArXuYpT3MsTGcje96zSv3U2pcT2dzIn1NZ6PjBtgkUbk4UXRjF7JGO8Aom3BRJKVZl31T3YdFKbLPgt8ha1/51VTLIuxQ== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2020 11:08:46.3142 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8e9440cb-ca0b-4717-ca60-08d7f3402d83 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR02MB3939 Received-SPF: pass client-ip=40.107.220.82; envelope-from=saipava@xilinx.com; helo=NAM11-CO1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/08 07:08:48 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: qemu-arm@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Enabling debug breaks the build, Fix them and make debug statements always compilable. Fix few statements to use sized integer casting. Signed-off-by: Sai Pavan Boddu Reviewed-by: Edgar E. Iglesias --- hw/net/cadence_gem.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 22a0b1b..5476c62 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -35,14 +35,13 @@ #include "sysemu/dma.h" #include "net/checksum.h" -#ifdef CADENCE_GEM_ERR_DEBUG -#define DB_PRINT(...) do { \ - fprintf(stderr, ": %s: ", __func__); \ - fprintf(stderr, ## __VA_ARGS__); \ - } while (0) -#else - #define DB_PRINT(...) -#endif +#define CADENCE_GEM_ERR_DEBUG 0 +#define DB_PRINT(...) do {\ + if (CADENCE_GEM_ERR_DEBUG) { \ + qemu_log(": %s: ", __func__); \ + qemu_log(__VA_ARGS__); \ + } \ +} while (0) #define GEM_NWCTRL (0x00000000/4) /* Network Control reg */ #define GEM_NWCFG (0x00000004/4) /* Network Config reg */ @@ -979,7 +978,7 @@ static ssize_t gem_receive(NetClientState *nc, const uint8_t *buf, size_t size) size += 4; } - DB_PRINT("config bufsize: %d packet size: %ld\n", rxbufsize, size); + DB_PRINT("config bufsize: %u packet size: %zd\n", rxbufsize, size); /* Find which queue we are targeting */ q = get_queue_from_screen(s, rxbuf_ptr, rxbufsize); @@ -992,9 +991,9 @@ static ssize_t gem_receive(NetClientState *nc, const uint8_t *buf, size_t size) return -1; } - DB_PRINT("copy %u bytes to 0x%" PRIx64 "\n", - MIN(bytes_to_copy, rxbufsize), - rx_desc_get_buffer(s, s->rx_desc[q])); + DB_PRINT("copy %" PRIu32 " bytes to 0x%" PRIx64 "\n", + MIN(bytes_to_copy, rxbufsize), + rx_desc_get_buffer(s, s->rx_desc[q])); /* Copy packet data to emulated DMA buffer */ address_space_write(&s->dma_as, rx_desc_get_buffer(s, s->rx_desc[q]) + @@ -1160,8 +1159,8 @@ static void gem_transmit(CadenceGEMState *s) */ if ((tx_desc_get_buffer(s, desc) == 0) || (tx_desc_get_length(desc) == 0)) { - DB_PRINT("Invalid TX descriptor @ 0x%x\n", - (unsigned)packet_desc_addr); + DB_PRINT("Invalid TX descriptor @ 0x%" HWADDR_PRIx "\n", + packet_desc_addr); break; }