From patchwork Wed Feb 25 12:58:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 45050 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D0B7420502 for ; Wed, 25 Feb 2015 12:59:12 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id r20sf3291889wiv.3 for ; Wed, 25 Feb 2015 04:59:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=SdjTfujMVQR29NsFacTPxKXS8xqfo9GjMDFteurI75s=; b=S9vvwfMJwZFJ+UPlbRVDPlq0cUqmffmN4du29g/T/EEDmW6uIshpZl4SrvMk3Oi6h3 ZvFd3hLQVPDuuA87wCO0TniA3e123qhuqJ6qtHCaogOkhMnpdUq1aJHfZHhsLqgMS71Q StnHBBq/msqLlNgqvojhdzvfvy78Q2KlT2lVyiN+QqBwBUn8/AYlsw+mGCTIu8rNmOQv R60ESNYEokoOKODXzt/cwJrNKY4XllKZOIL0NUanpaBNJ+ZhKx892FOqvYC62UbeATm+ M05qR00ySs2cJN3+0OcART0ozJSbwQ6f1hLFZEqHFz07ropXG5LmoHiT5lAZP8xsaU4x zrEg== X-Gm-Message-State: ALoCoQmocTrXXq9Icd3xyWjekRyZ0IQ9zx5WypAKZb6XVZJlwhqDBsLWLbWipj9qj+UbRrmtnWXG X-Received: by 10.152.6.232 with SMTP id e8mr462549laa.2.1424869152144; Wed, 25 Feb 2015 04:59:12 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.198.231 with SMTP id jf7ls810239lac.92.gmail; Wed, 25 Feb 2015 04:59:12 -0800 (PST) X-Received: by 10.152.179.135 with SMTP id dg7mr2768665lac.58.1424869151962; Wed, 25 Feb 2015 04:59:11 -0800 (PST) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id zp6si14782485lbb.163.2015.02.25.04.59.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Feb 2015 04:59:11 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by lbdu14 with SMTP id u14so3637258lbd.1 for ; Wed, 25 Feb 2015 04:59:11 -0800 (PST) X-Received: by 10.112.167.36 with SMTP id zl4mr2818387lbb.32.1424869151548; Wed, 25 Feb 2015 04:59:11 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp2599854lbj; Wed, 25 Feb 2015 04:59:10 -0800 (PST) X-Received: by 10.140.27.229 with SMTP id 92mr6420873qgx.64.1424869150264; Wed, 25 Feb 2015 04:59:10 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id bt3si42189675qcb.47.2015.02.25.04.59.07 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 25 Feb 2015 04:59:10 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YQbYP-00086E-SW; Wed, 25 Feb 2015 12:59:05 +0000 Received: from mail-qg0-f47.google.com ([209.85.192.47]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YQbYI-00085g-EM for lng-odp@lists.linaro.org; Wed, 25 Feb 2015 12:58:58 +0000 Received: by mail-qg0-f47.google.com with SMTP id q107so2691498qgd.6 for ; Wed, 25 Feb 2015 04:58:53 -0800 (PST) X-Received: by 10.229.65.8 with SMTP id g8mr6844336qci.15.1424869133193; Wed, 25 Feb 2015 04:58:53 -0800 (PST) Received: from mcpro03.emea.nsn-net.net (ec2-23-23-178-99.compute-1.amazonaws.com. [23.23.178.99]) by mx.google.com with ESMTPSA id o10sm21934164qag.9.2015.02.25.04.58.51 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 25 Feb 2015 04:58:52 -0800 (PST) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Wed, 25 Feb 2015 14:58:27 +0200 Message-Id: <1424869109-930-2-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.3.0 In-Reply-To: <1424869109-930-1-git-send-email-petri.savolainen@linaro.org> References: <1424869109-930-1-git-send-email-petri.savolainen@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 2/4] api: packet_io: replace ssize_t with int X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: petri.savolainen@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 ssize_t is a POSIX type. API definition must be pure C (C99). Int is at least 16 bits and can hold any mac address size. Signed-off-by: Petri Savolainen --- include/odp/api/packet_io.h | 6 ++---- platform/linux-generic/odp_packet_io.c | 2 +- test/validation/odp_pktio.c | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h index 427457e..418b8e7 100644 --- a/include/odp/api/packet_io.h +++ b/include/odp/api/packet_io.h @@ -18,8 +18,6 @@ extern "C" { #endif -#include - /** @defgroup odp_packet_io ODP PACKET IO * Operations on a packet. * @{ @@ -187,12 +185,12 @@ int odp_pktio_promisc_mode(odp_pktio_t pktio); * * @param pktio ODP packet IO handle * @param[out] mac_addr Output buffer (use ODP_PKTIO_MACADDR_MAXSIZE) - * @param size Size of output buffer + * @param size Size of output buffer * * @return Number of bytes written (actual size of MAC address) * @retval <0 on failure */ -ssize_t odp_pktio_mac_addr(odp_pktio_t pktio, void *mac_addr, ssize_t size); +int odp_pktio_mac_addr(odp_pktio_t pktio, void *mac_addr, int size); /** * Setup per-port default class-of-service. diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index a405bd7..21f0c17 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -817,7 +817,7 @@ int odp_pktio_promisc_mode(odp_pktio_t id) } -ssize_t odp_pktio_mac_addr(odp_pktio_t id, void *mac_addr, ssize_t addr_size) +int odp_pktio_mac_addr(odp_pktio_t id, void *mac_addr, int addr_size) { pktio_entry_t *entry; diff --git a/test/validation/odp_pktio.c b/test/validation/odp_pktio.c index 3f9de3c..5577856 100644 --- a/test/validation/odp_pktio.c +++ b/test/validation/odp_pktio.c @@ -458,7 +458,7 @@ static void test_odp_pktio_promisc(void) static void test_odp_pktio_mac(void) { unsigned char mac_addr[ODPH_ETHADDR_LEN]; - ssize_t mac_len; + int mac_len; int ret; odp_pktio_t pktio = create_pktio(iface_name[0]);