From patchwork Fri Nov 29 21:34:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alexander Bulekov X-Patchwork-Id: 1202624 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bu.edu Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=bushare.onmicrosoft.com header.i=@bushare.onmicrosoft.com header.b="4dsRb8+1"; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 47PnvT5mLKz9sPJ for ; Sat, 30 Nov 2019 08:39:01 +1100 (AEDT) Received: from localhost ([::1]:35391 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ianyd-0003zU-JC for incoming@patchwork.ozlabs.org; Fri, 29 Nov 2019 16:38:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48058) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ianuY-0008WS-Tc for qemu-devel@nongnu.org; Fri, 29 Nov 2019 16:34:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ianuX-0002kz-0o for qemu-devel@nongnu.org; Fri, 29 Nov 2019 16:34:46 -0500 Received: from mail-eopbgr740102.outbound.protection.outlook.com ([40.107.74.102]:45028 helo=NAM01-BN3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ianuW-0002ik-LM for qemu-devel@nongnu.org; Fri, 29 Nov 2019 16:34:44 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dL7mJe4gHKkm3wvRN1UD8TCneJEt/FnQdgXMGDBcGl5c/1fmCGRGBomc/kn+2iJZ23tR40OjTPlCuQvrFA7lc5ettboIPu9Gam6xvx2nPTqS2R0bY1v1fA0Dj5t8rDUFnZN6VSVarm06feUTu08Hd2yBmK+yl3ForFn6vf1h8Ga/HKMNMUf0frEf3GuRXaipbRnk/qb2V9tk00L1ZczucahoLHBSWcGPKj/e4y5kk8kzn7F/BX407mEnMHhvPpzf3yF1ZOu3jaXdk9CBYVp73qeFppLkIfmTs/FMiB1g24LXGRywZVOeRMg9wt2xx0N3BGKz41FrSVzLnHPdfP0l5A== 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=dg6bsFmb0bzDC/DwCpZEdhtgXcsPjmuqoaoCCJEJlIA=; b=nbsUhoeZDHUc3k4TreIdMhIzTFM5+QAUYqx60DU8faNZgY/q5OZ3bjVG96gIuJvN0l8DtkA4nhsZrFtLYS4I4f1/K7aX/aKL8U7LIpJPgP03upFRaFHBtVCg4Fol1njsKVhfyAOmyphp/VppJRAii1bWdhNRlnUuH0AL3VXrOJok2wWys+9TAb8L2EvMYmymPwSiiC9glyflZxvBvtck6vz9ukiNxXlruIg0wlzzelyG51EpYndpWlfLSbtgVusjdDOgN4hW30GGdh/16SBC/NeGsuoHQMFWhzqj5/WfhiBLlNubtz4QL0mIa1t3Vg9/x8+1YpMXlI/KtqTWS7uDJw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=bu.edu; dmarc=pass action=none header.from=bu.edu; dkim=pass header.d=bu.edu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bushare.onmicrosoft.com; s=selector2-bushare-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dg6bsFmb0bzDC/DwCpZEdhtgXcsPjmuqoaoCCJEJlIA=; b=4dsRb8+1v63wlNgforNv0h2FcigNVZfKxasjNwJsF8irQH9FL1RqOzsvTZ4JkoQxo+ubbj6vh6FN9XGYVpf71RB1BYoDYbYhHRerVvxRj4D3cyy2LqPKawT9zCCQHGM9kxdp5BjqDSqH6Lrmn89gD1F+afUucvlZXWSQp/webKU= Received: from DM6PR03MB4795.namprd03.prod.outlook.com (20.179.107.22) by DM6PR03MB5050.namprd03.prod.outlook.com (10.141.161.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2495.18; Fri, 29 Nov 2019 21:34:39 +0000 Received: from DM6PR03MB4795.namprd03.prod.outlook.com ([fe80::2557:454e:205e:4d74]) by DM6PR03MB4795.namprd03.prod.outlook.com ([fe80::2557:454e:205e:4d74%2]) with mapi id 15.20.2495.014; Fri, 29 Nov 2019 21:34:39 +0000 From: "Oleinik, Alexander" To: "qemu-devel@nongnu.org" Subject: [PATCH v6 02/21] libqos: Rename i2c_send and i2c_recv Thread-Topic: [PATCH v6 02/21] libqos: Rename i2c_send and i2c_recv Thread-Index: AQHVpvzND7seQozyDE+SYEK2ZvMb1Q== Date: Fri, 29 Nov 2019 21:34:38 +0000 Message-ID: <20191129213424.6290-3-alxndr@bu.edu> References: <20191129213424.6290-1-alxndr@bu.edu> In-Reply-To: <20191129213424.6290-1-alxndr@bu.edu> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.23.0 x-originating-ip: [128.197.127.33] x-clientproxiedby: BL0PR1501CA0025.namprd15.prod.outlook.com (2603:10b6:207:17::38) To DM6PR03MB4795.namprd03.prod.outlook.com (2603:10b6:5:18c::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=alxndr@bu.edu; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b086212e-4223-4dcb-04ce-08d77513ef5d x-ms-traffictypediagnostic: DM6PR03MB5050: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3173; x-forefront-prvs: 0236114672 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(366004)(346002)(39860400002)(136003)(396003)(199004)(189003)(54906003)(81156014)(81166006)(66066001)(6436002)(3846002)(8936002)(66946007)(6116002)(1076003)(66446008)(64756008)(66476007)(256004)(66556008)(316002)(786003)(8676002)(6512007)(102836004)(6486002)(478600001)(71190400001)(71200400001)(2351001)(86362001)(6506007)(14454004)(2501003)(75432002)(386003)(5640700003)(2906002)(6916009)(7736002)(2616005)(25786009)(26005)(52116002)(88552002)(99286004)(5660300002)(76176011)(186003)(446003)(11346002)(305945005)(50226002)(36756003)(4326008); DIR:OUT; SFP:1102; SCL:1; SRVR:DM6PR03MB5050; H:DM6PR03MB4795.namprd03.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: bu.edu does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VChovuKWiqeAxXdtQTulC7jufynKm4ylUQaGv+VUfdC6816sIBCDgA91XH9wmcRkcEa5tLuVJWM9OjykploCas7+/kf1gLlFa99BN2d+zln7N/it1eNKVmCSEd+axRrLtUmpmsn3aYH/kXPYq5zHtg+HeAmrehn9WTPv4uRFy/pJ6ms42JXJ9z1fBPbf16G7vOu+nFhCkJSAtV2pzJgFZIYpuFG9Kx6s/KsgLCeLrXkA/x0NI9dOaUNZzqB6rAq0GvKrs5HHSMA/SsuvrgnoSFyG99vAgfxvyfBwd+V/Yagb0ZNm1fVEwW2LVNZb983R8OriG/jBoE2ykfgKpjQGRZxhwIN/mOo7WLvf/MU4pSKqZNNkVQYWMxU0mh+y5Z6VEHyC8cX4u6zPQHt12n0+K4eol+qMt9TVFSzSwxI1oGZBYBGzyVgq+3tQ/WfFGfDw MIME-Version: 1.0 X-OriginatorOrg: bu.edu X-MS-Exchange-CrossTenant-Network-Message-Id: b086212e-4223-4dcb-04ce-08d77513ef5d X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Nov 2019 21:34:38.5118 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d57d32cc-c121-488f-b07b-dfe705680c71 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: DUD0uuBrsSco6mQEH11/NJgjzCDg5b21G/RNGdBtqkVG5PRJPkZ1OgOMwlVHadri X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB5050 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.74.102 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: Laurent Vivier , Thomas Huth , "Oleinik, Alexander" , "bsd@redhat.com" , "stefanha@redhat.com" , "pbonzini@redhat.com" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The names i2c_send and i2c_recv collide with functions defined in hw/i2c/core.c. This causes an error when linking against libqos and softmmu simultaneously (for example when using qtest inproc). Rename the libqos functions to avoid this. Signed-off-by: Alexander Bulekov Acked-by: Thomas Huth Reviewed-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé --- tests/libqos/i2c.c | 10 +++++----- tests/libqos/i2c.h | 4 ++-- tests/pca9552-test.c | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/libqos/i2c.c b/tests/libqos/i2c.c index 156114e745..38f800dbab 100644 --- a/tests/libqos/i2c.c +++ b/tests/libqos/i2c.c @@ -10,12 +10,12 @@ #include "libqos/i2c.h" #include "libqtest.h" -void i2c_send(QI2CDevice *i2cdev, const uint8_t *buf, uint16_t len) +void qi2c_send(QI2CDevice *i2cdev, const uint8_t *buf, uint16_t len) { i2cdev->bus->send(i2cdev->bus, i2cdev->addr, buf, len); } -void i2c_recv(QI2CDevice *i2cdev, uint8_t *buf, uint16_t len) +void qi2c_recv(QI2CDevice *i2cdev, uint8_t *buf, uint16_t len) { i2cdev->bus->recv(i2cdev->bus, i2cdev->addr, buf, len); } @@ -23,8 +23,8 @@ void i2c_recv(QI2CDevice *i2cdev, uint8_t *buf, uint16_t len) void i2c_read_block(QI2CDevice *i2cdev, uint8_t reg, uint8_t *buf, uint16_t len) { - i2c_send(i2cdev, ®, 1); - i2c_recv(i2cdev, buf, len); + qi2c_send(i2cdev, ®, 1); + qi2c_recv(i2cdev, buf, len); } void i2c_write_block(QI2CDevice *i2cdev, uint8_t reg, @@ -33,7 +33,7 @@ void i2c_write_block(QI2CDevice *i2cdev, uint8_t reg, uint8_t *cmd = g_malloc(len + 1); cmd[0] = reg; memcpy(&cmd[1], buf, len); - i2c_send(i2cdev, cmd, len + 1); + qi2c_send(i2cdev, cmd, len + 1); g_free(cmd); } diff --git a/tests/libqos/i2c.h b/tests/libqos/i2c.h index 945b65b34c..c65f087834 100644 --- a/tests/libqos/i2c.h +++ b/tests/libqos/i2c.h @@ -47,8 +47,8 @@ struct QI2CDevice { void *i2c_device_create(void *i2c_bus, QGuestAllocator *alloc, void *addr); void add_qi2c_address(QOSGraphEdgeOptions *opts, QI2CAddress *addr); -void i2c_send(QI2CDevice *dev, const uint8_t *buf, uint16_t len); -void i2c_recv(QI2CDevice *dev, uint8_t *buf, uint16_t len); +void qi2c_send(QI2CDevice *dev, const uint8_t *buf, uint16_t len); +void qi2c_recv(QI2CDevice *dev, uint8_t *buf, uint16_t len); void i2c_read_block(QI2CDevice *dev, uint8_t reg, uint8_t *buf, uint16_t len); diff --git a/tests/pca9552-test.c b/tests/pca9552-test.c index 4b800d3c3e..d80ed93cd3 100644 --- a/tests/pca9552-test.c +++ b/tests/pca9552-test.c @@ -32,22 +32,22 @@ static void receive_autoinc(void *obj, void *data, QGuestAllocator *alloc) pca9552_init(i2cdev); - i2c_send(i2cdev, ®, 1); + qi2c_send(i2cdev, ®, 1); /* PCA9552_LS0 */ - i2c_recv(i2cdev, &resp, 1); + qi2c_recv(i2cdev, &resp, 1); g_assert_cmphex(resp, ==, 0x54); /* PCA9552_LS1 */ - i2c_recv(i2cdev, &resp, 1); + qi2c_recv(i2cdev, &resp, 1); g_assert_cmphex(resp, ==, 0x55); /* PCA9552_LS2 */ - i2c_recv(i2cdev, &resp, 1); + qi2c_recv(i2cdev, &resp, 1); g_assert_cmphex(resp, ==, 0x55); /* PCA9552_LS3 */ - i2c_recv(i2cdev, &resp, 1); + qi2c_recv(i2cdev, &resp, 1); g_assert_cmphex(resp, ==, 0x54); }