From patchwork Mon Dec 1 14:08:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 41780 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A731E20672 for ; Mon, 1 Dec 2014 14:10:00 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id l15sf6776403wiw.0 for ; Mon, 01 Dec 2014 06:10:00 -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=PnpeFfQbFS1WCuJwfqbcnSo64Ps5Xvv6RkfHOWlmZZ0=; b=MCKOMb4MMk1xL/373ssprymNuKll7fpBjwfeMtrOy0yHYSH7V4EFCD8LghbmTEu6YK o5SHmNYawC59iBRDl1/4j5mlu5j66yH72Zagh+HzoD8Id0UY1Jogdb9ymk8c7myg1Dt4 W3x7pmPvjI3ngxQK0dZymmA3dhTj4F3O64w+5pXu9jS4Eq4RPQD6/aoU4sn3cmRxX1Hv A0EYaY3OvoRN+1EXemglyFCjd9vNR3tbDtBG4lNTyPu1/Peg43Nx7iXU4K4VXZCz6rKX TEguyeIrD4m3m2t6dOzSLovb+VgovIbKocRvr5wt3/+nmuVgE0sm/X14GhVNvsVyrFqR PNbw== X-Gm-Message-State: ALoCoQmJPRETOpf1bNliP/rXUMHQB72Z37imp/vsnJrAElVwkojdgByMv3zhqODG8CRhLxjt34CT X-Received: by 10.112.168.228 with SMTP id zz4mr14853851lbb.7.1417442999934; Mon, 01 Dec 2014 06:09:59 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.205.10 with SMTP id lc10ls1164300lac.22.gmail; Mon, 01 Dec 2014 06:09:59 -0800 (PST) X-Received: by 10.152.88.69 with SMTP id be5mr57530953lab.36.1417442999127; Mon, 01 Dec 2014 06:09:59 -0800 (PST) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id to1si6983256lbb.133.2014.12.01.06.09.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Dec 2014 06:09:59 -0800 (PST) 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 mail-la0-f53.google.com with SMTP id gm9so8605826lab.40 for ; Mon, 01 Dec 2014 06:09:59 -0800 (PST) X-Received: by 10.112.189.10 with SMTP id ge10mr56243475lbc.23.1417442999001; Mon, 01 Dec 2014 06:09:59 -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.184.201 with SMTP id ew9csp293309lbc; Mon, 1 Dec 2014 06:09:56 -0800 (PST) X-Received: by 10.224.122.15 with SMTP id j15mr76309251qar.68.1417442995877; Mon, 01 Dec 2014 06:09:55 -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 l5si6973529qch.15.2014.12.01.06.09.54 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 01 Dec 2014 06:09:55 -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 1XvRfl-0000yO-R8; Mon, 01 Dec 2014 14:09:53 +0000 Received: from mail-lb0-f178.google.com ([209.85.217.178]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XvRfA-0000uE-Qc for lng-odp@lists.linaro.org; Mon, 01 Dec 2014 14:09:16 +0000 Received: by mail-lb0-f178.google.com with SMTP id f15so9510766lbj.37 for ; Mon, 01 Dec 2014 06:09:11 -0800 (PST) X-Received: by 10.152.7.193 with SMTP id l1mr56705811laa.57.1417442951314; Mon, 01 Dec 2014 06:09:11 -0800 (PST) Received: from localhost.localdomain ([188.92.105.210]) by mx.google.com with ESMTPSA id or5sm4739750lbb.42.2014.12.01.06.09.10 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Dec 2014 06:09:10 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Mon, 1 Dec 2014 17:08:47 +0300 Message-Id: <1417442928-20680-10-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 In-Reply-To: <1417442928-20680-1-git-send-email-maxim.uvarov@linaro.org> References: <1417442928-20680-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv3 09/10] linux-generic: correct socket get for mtu functions 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: maxim.uvarov@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 Socket can be 0 and it's accounted in previews patch. Correct that function too. Signed-off-by: Maxim Uvarov --- platform/linux-generic/odp_packet_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 5c0a44c..0f2dc33 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -561,7 +561,7 @@ int odp_pktio_set_mtu(odp_pktio_t id, int mtu) return -1; } - if (entry->s.pkt_sock_mmap.sockfd) + if (entry->s.pkt_sock_mmap.sockfd > -1) sockfd = entry->s.pkt_sock_mmap.sockfd; else sockfd = entry->s.pkt_sock.sockfd; @@ -591,7 +591,7 @@ int odp_pktio_mtu(odp_pktio_t id) return -1; } - if (entry->s.pkt_sock_mmap.sockfd) + if (entry->s.pkt_sock_mmap.sockfd > -1) sockfd = entry->s.pkt_sock_mmap.sockfd; else sockfd = entry->s.pkt_sock.sockfd;