From patchwork Wed Mar 25 15:43:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 46324 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4ECE621584 for ; Wed, 25 Mar 2015 15:44:02 +0000 (UTC) Received: by lams18 with SMTP id s18sf5816089lam.2 for ; Wed, 25 Mar 2015 08:44:01 -0700 (PDT) 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=muJQVKJJ145z8Ch0tIztFsmA1+LoRhrPqT/1UQgCzJo=; b=O7CEnxwzyM8iuykkI2PpaJoNHaCCBGVXJ93v106Ac+J90q4ipoW8IIiagTqUDQ7o4N G0Kcg1pQCInZ2wL3veF7BMYMUfhpFcIwLIG81N0GCc/JWe4xSvILJZ3C77k6pj98fyNU Zi08XuedTUb1UJ+xg+LgpFdgoA8YBcSO6IPSrz415avtJ9zxfp4H+TaKxo0eCaqN9izR PzWblhr+4sliyzJ9Fa8lmaDQDexSRaTxsCIUQX5w9XxYGsacwjuiMkbkFtH0CrWBU5Av JRqwZVjxFSCxJjMSmy98ErYfRRASxHKzgatI4bRfSktanTGxbc/XA188m0laAN6SsrO0 ed2Q== X-Gm-Message-State: ALoCoQlKjFTStEcLxjsNkVAwH0P7RmrdZsNnl2TdRciGmYQc67dp9SJMqQxF8cfQN2+oSmr41DeN X-Received: by 10.194.53.225 with SMTP id e1mr2239689wjp.4.1427298241112; Wed, 25 Mar 2015 08:44:01 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.179.131 with SMTP id dg3ls118450lac.74.gmail; Wed, 25 Mar 2015 08:44:00 -0700 (PDT) X-Received: by 10.112.205.103 with SMTP id lf7mr8860174lbc.37.1427298240675; Wed, 25 Mar 2015 08:44:00 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id rr6si2317745lbb.7.2015.03.25.08.44.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Mar 2015 08:44:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by labto5 with SMTP id to5so23378556lab.0 for ; Wed, 25 Mar 2015 08:44:00 -0700 (PDT) X-Received: by 10.112.162.167 with SMTP id yb7mr8909137lbb.76.1427298240526; Wed, 25 Mar 2015 08:44:00 -0700 (PDT) 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.57.201 with SMTP id k9csp43682lbq; Wed, 25 Mar 2015 08:43:59 -0700 (PDT) X-Received: by 10.52.101.200 with SMTP id fi8mr10063791vdb.18.1427298239002; Wed, 25 Mar 2015 08:43:59 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id xd12si3578259vdc.93.2015.03.25.08.43.56 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 25 Mar 2015 08:43:58 -0700 (PDT) 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 1YanTG-0003XS-Dl; Wed, 25 Mar 2015 15:43:54 +0000 Received: from mail-wi0-f181.google.com ([209.85.212.181]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YanTB-0003XN-7G for lng-odp@lists.linaro.org; Wed, 25 Mar 2015 15:43:49 +0000 Received: by wibgn9 with SMTP id gn9so45098995wib.1 for ; Wed, 25 Mar 2015 08:43:43 -0700 (PDT) X-Received: by 10.180.73.146 with SMTP id l18mr24573505wiv.89.1427298223795; Wed, 25 Mar 2015 08:43:43 -0700 (PDT) Received: from localhost.localdomain ([90.152.119.35]) by mx.google.com with ESMTPSA id u16sm4264480wjr.5.2015.03.25.08.43.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Mar 2015 08:43:42 -0700 (PDT) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Wed, 25 Mar 2015 15:43:20 +0000 Message-Id: <1427298200-23710-1-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH] api: packet_flags: allow implementations to return an error code 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: zoltan.kiss@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.53 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 This is only for debugging purposes. It could be useful for an application developer if the platform implementation doesn't emit any error messages about its problems. Signed-off-by: Zoltan Kiss --- include/odp/api/packet_flags.h | 3 ++- platform/linux-generic/odp_packet_flags.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/odp/api/packet_flags.h b/include/odp/api/packet_flags.h index b1e179e..77239d2 100644 --- a/include/odp/api/packet_flags.h +++ b/include/odp/api/packet_flags.h @@ -32,7 +32,8 @@ extern "C" { * Checks all error flags at once. * * @param pkt Packet handle - * @retval 1 packet has errors + * @retval !0 packet has errors (implementation is allowed to return error + * codes for debugging purposes) * @retval 0 packet has no errors */ int odp_packet_has_error(odp_packet_t pkt); diff --git a/platform/linux-generic/odp_packet_flags.c b/platform/linux-generic/odp_packet_flags.c index ab3d12f..bcd44fb 100644 --- a/platform/linux-generic/odp_packet_flags.c +++ b/platform/linux-generic/odp_packet_flags.c @@ -10,7 +10,7 @@ int odp_packet_has_error(odp_packet_t pkt) { - return (odp_packet_hdr(pkt)->error_flags.all != 0); + return odp_packet_hdr(pkt)->error_flags.all; } /* Get Input Flags */