From patchwork Tue Dec 23 11:29:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 42562 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AA2872188F for ; Tue, 23 Dec 2014 11:29:49 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id u10sf3921847lbd.2 for ; Tue, 23 Dec 2014 03:29:48 -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=bPe2WTVm4paRfjiwy8RThd3Wm1kc/qPU1/OV/JCndME=; b=UVlFXBAf/yuDaPyxU8sXzyUt75fzMyhQA/Nsng6kI2UmZbpb8ZN5YU++IVhnm5Q8Jx Hr6gArkWpoUCnAznsGS18/F/2f6Hd/QAoJKx2/FCml8VExalOOA6oyD/HVvNQAVGdsHr IrGA1lWB49nEeDAWrFpVe8YLxXAb1AYyttfkZlTkxyDQEO5cA1Eh2C+dcdtOOmb3kuXb GbMbj/iiww+758mIxueTnDYoBJ6bYaa6FRep8yeljY0OMbD7ONE8ARbJ0kXhuUSvzeA/ BgYm6KnwVBYp0rIi1zh9clwUnfZAeD+FXcukumiODUyEhrF5zlkWKjI8Yks0U94SyCXE 62yw== X-Gm-Message-State: ALoCoQlWKxbr2el5g37WpxNItEnrSmUZHaLORgACwAGAvDdSIK5FUq8bh7i276Hw/thltbZgQpTV X-Received: by 10.112.147.195 with SMTP id tm3mr33910lbb.18.1419334188524; Tue, 23 Dec 2014 03:29:48 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.225 with SMTP id i1ls346520lae.19.gmail; Tue, 23 Dec 2014 03:29:48 -0800 (PST) X-Received: by 10.112.53.66 with SMTP id z2mr12544372lbo.65.1419334188312; Tue, 23 Dec 2014 03:29:48 -0800 (PST) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id ds5si13965154lbc.138.2014.12.23.03.29.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Dec 2014 03:29:48 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by mail-la0-f50.google.com with SMTP id pn19so5448042lab.9 for ; Tue, 23 Dec 2014 03:29:48 -0800 (PST) X-Received: by 10.112.84.225 with SMTP id c1mr5586971lbz.22.1419334188187; Tue, 23 Dec 2014 03:29:48 -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.142.69 with SMTP id ru5csp1298064lbb; Tue, 23 Dec 2014 03:29:47 -0800 (PST) X-Received: by 10.224.3.137 with SMTP id 9mr45397603qan.64.1419334186467; Tue, 23 Dec 2014 03:29:46 -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 94si22988316qga.22.2014.12.23.03.29.44 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 23 Dec 2014 03:29:46 -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 1Y3Neo-0001lq-LN; Tue, 23 Dec 2014 11:29:42 +0000 Received: from mail-qg0-f54.google.com ([209.85.192.54]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y3Nee-0001lG-Rr for lng-odp@lists.linaro.org; Tue, 23 Dec 2014 11:29:32 +0000 Received: by mail-qg0-f54.google.com with SMTP id l89so4507005qgf.27 for ; Tue, 23 Dec 2014 03:29:27 -0800 (PST) X-Received: by 10.224.55.197 with SMTP id v5mr44301252qag.59.1419334167689; Tue, 23 Dec 2014 03:29:27 -0800 (PST) Received: from localhost.localdomain (ec2-23-23-178-99.compute-1.amazonaws.com. [23.23.178.99]) by mx.google.com with ESMTPSA id i76sm18673042qgd.4.2014.12.23.03.29.25 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Dec 2014 03:29:26 -0800 (PST) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Tue, 23 Dec 2014 13:29:06 +0200 Message-Id: <1419334146-28747-2-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.2.1 In-Reply-To: <1419334146-28747-1-git-send-email-petri.savolainen@linaro.org> References: <1419334146-28747-1-git-send-email-petri.savolainen@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v2 2/2] api: buffer: Change buffer size from size_t to uint32_t 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.215.50 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 Use uint32_t for buffer size to be align with packet API lenghts and offsets. Signed-off-by: Petri Savolainen Reviewed-by: Bill Fischofer --- platform/linux-generic/include/api/odp_buffer.h | 2 +- platform/linux-generic/include/odp_buffer_internal.h | 2 +- platform/linux-generic/odp_buffer.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/linux-generic/include/api/odp_buffer.h b/platform/linux-generic/include/api/odp_buffer.h index 3c23035..0670464 100644 --- a/platform/linux-generic/include/api/odp_buffer.h +++ b/platform/linux-generic/include/api/odp_buffer.h @@ -44,7 +44,7 @@ void *odp_buffer_addr(odp_buffer_t buf); * * @return Buffer maximum data size */ -size_t odp_buffer_size(odp_buffer_t buf); +uint32_t odp_buffer_size(odp_buffer_t buf); /** * Buffer type diff --git a/platform/linux-generic/include/odp_buffer_internal.h b/platform/linux-generic/include/odp_buffer_internal.h index 60f06c9..a315f00 100644 --- a/platform/linux-generic/include/odp_buffer_internal.h +++ b/platform/linux-generic/include/odp_buffer_internal.h @@ -118,7 +118,7 @@ typedef struct odp_buffer_hdr_t { }; } flags; int type; /* buffer type */ - size_t size; /* max data size */ + uint32_t size; /* max data size */ odp_atomic_u32_t ref_count; /* reference count */ odp_buffer_pool_t pool_hdl; /* buffer pool handle */ union { diff --git a/platform/linux-generic/odp_buffer.c b/platform/linux-generic/odp_buffer.c index dd37ab3..57ba408 100644 --- a/platform/linux-generic/odp_buffer.c +++ b/platform/linux-generic/odp_buffer.c @@ -22,7 +22,7 @@ void *odp_buffer_addr(odp_buffer_t buf) } -size_t odp_buffer_size(odp_buffer_t buf) +uint32_t odp_buffer_size(odp_buffer_t buf) { odp_buffer_hdr_t *hdr = odp_buf_to_hdr(buf); @@ -63,7 +63,7 @@ int odp_buffer_snprint(char *str, uint32_t n, odp_buffer_t buf) len += snprintf(&str[len], n-len, " addr %p\n", hdr->addr); len += snprintf(&str[len], n-len, - " size %zu\n", hdr->size); + " size %u\n", hdr->size); len += snprintf(&str[len], n-len, " ref_count %i\n", odp_atomic_load_u32(&hdr->ref_count));