From patchwork Sun Jan 4 14:20:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 42727 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1DBA920A5F for ; Sun, 4 Jan 2015 14:20:57 +0000 (UTC) Received: by mail-wg0-f71.google.com with SMTP id k14sf3903115wgh.6 for ; Sun, 04 Jan 2015 06:20:56 -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: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=dNCzk+wTsQzYF6pDIwQx5UiRiLYHPAZQhMf610pgJSA=; b=MIEh+YHL1VCsc916ccKZ6Cw4izT7VUgR6nUEQle12Vx5nYwlTHDnV6cYp/nVNz8e6y 1vNM+v2IHpZgRyPapByjrNMOEp2EJ/7qhR/Uev4K8zbnR0xx4jB2E+pz0/km/lApmvO8 T84l5M4yVMWpKjR9FvwrqDyja/otvIjlpondx0EPeVWvlyMPDF1j0e2ohQIWHpQDF9k6 F3dE23qPSF+NKORbw5NnzNN0bg96s8tqRIBpDvhwFwPlboTSYfXy9BBDx+X+/ikccKmk N/WfyI5RX5GlJ0vM1GA3NjfzEbekSr4BKiDmUhxWwF5bAl6gCXCt1/a8ceQpfd+T+Pj6 hzNA== X-Gm-Message-State: ALoCoQn1ozuGrMonXvUpo973RA0W5AdYMeKPgcmL2BhtmjMDCbaBQ0mdmz0QqrkIk4FLRE7W9TUK X-Received: by 10.180.7.226 with SMTP id m2mr866814wia.5.1420381256308; Sun, 04 Jan 2015 06:20:56 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.3.202 with SMTP id e10ls2326132lae.86.gmail; Sun, 04 Jan 2015 06:20:56 -0800 (PST) X-Received: by 10.152.5.67 with SMTP id q3mr86764069laq.73.1420381256083; Sun, 04 Jan 2015 06:20:56 -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 kl8si58517598lac.120.2015.01.04.06.20.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 04 Jan 2015 06:20:55 -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 mail-lb0-f178.google.com with SMTP id f15so18437530lbj.23 for ; Sun, 04 Jan 2015 06:20:55 -0800 (PST) X-Received: by 10.112.159.136 with SMTP id xc8mr16303296lbb.98.1420381255430; Sun, 04 Jan 2015 06:20:55 -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.9.200 with SMTP id c8csp654613lbb; Sun, 4 Jan 2015 06:20:54 -0800 (PST) X-Received: by 10.229.70.133 with SMTP id d5mr137921436qcj.2.1420381254007; Sun, 04 Jan 2015 06:20:54 -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 m10si57717283qas.94.2015.01.04.06.20.52 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 04 Jan 2015 06:20:53 -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 1Y7m2z-00084l-UD; Sun, 04 Jan 2015 14:20:49 +0000 Received: from mail-ob0-f172.google.com ([209.85.214.172]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y7m2t-00084g-PX for lng-odp@lists.linaro.org; Sun, 04 Jan 2015 14:20:43 +0000 Received: by mail-ob0-f172.google.com with SMTP id va8so57844504obc.3 for ; Sun, 04 Jan 2015 06:20:38 -0800 (PST) X-Received: by 10.60.45.167 with SMTP id o7mr51341633oem.70.1420381238450; Sun, 04 Jan 2015 06:20:38 -0800 (PST) Received: from localhost.localdomain (cpe-24-28-70-239.austin.res.rr.com. [24.28.70.239]) by mx.google.com with ESMTPSA id me7sm3942081oeb.8.2015.01.04.06.20.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 04 Jan 2015 06:20:37 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Sun, 4 Jan 2015 08:20:29 -0600 Message-Id: <1420381229-17377-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.0 X-Topics: patch Subject: [lng-odp] [PATCH] linux-generic: bugfix: correct seglen calculation 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: bill.fischofer@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 seglen computation did not account for seg_offset (problem and fix identified by Geoffrey Blake). Signed-off-by: Bill Fischofer --- platform/linux-generic/include/odp_buffer_inlines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/linux-generic/include/odp_buffer_inlines.h b/platform/linux-generic/include/odp_buffer_inlines.h index f880445..ade2878 100644 --- a/platform/linux-generic/include/odp_buffer_inlines.h +++ b/platform/linux-generic/include/odp_buffer_inlines.h @@ -136,7 +136,7 @@ static inline void *buffer_map(odp_buffer_hdr_t *buf, if (seglen != NULL) { uint32_t buf_left = limit - offset; - *seglen = buf_left < buf->segsize ? + *seglen = seg_offset + buf_left <= buf->segsize ? buf_left : buf->segsize - seg_offset; }