From patchwork Fri Jul 15 11:43:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 72096 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp569783qga; Fri, 15 Jul 2016 04:44:04 -0700 (PDT) X-Received: by 10.55.109.198 with SMTP id i189mr24922288qkc.140.1468583044818; Fri, 15 Jul 2016 04:44:04 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id h19si4983188qke.295.2016.07.15.04.44.04; Fri, 15 Jul 2016 04:44:04 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 42099686DF; Fri, 15 Jul 2016 11:44:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id DA568686D6; Fri, 15 Jul 2016 11:44:00 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id B2F1E686D8; Fri, 15 Jul 2016 11:43:59 +0000 (UTC) Received: from mail-qk0-f171.google.com (mail-qk0-f171.google.com [209.85.220.171]) by lists.linaro.org (Postfix) with ESMTPS id F2B1968688 for ; Fri, 15 Jul 2016 11:43:58 +0000 (UTC) Received: by mail-qk0-f171.google.com with SMTP id o67so98580338qke.1 for ; Fri, 15 Jul 2016 04:43:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=KYQbyQXLmcRizIxyUMGjhNqk+8tchlw/YRKLdh6i3VE=; b=ZnMG0e7VYqegdZWmrRO21jYeb5HrVRuNpx5+PxlG9LPBItYV8uYvDguEFvNogSOIuE F/SN9AVV06c7ZPweR/KMhRCb9sy9QMdEBlYNA14Cu/GBWETY6DDGQTc2rnwaccQcU+Rw 8TsN6X3RPk2Xe0+POzHAJ4303D2l6cZb9UgRGX1Psgv+phzVOkdoA8kxpFqRHhafU5HR aedxaMFUJ+A2R/jnHTDXaToYJl4aPKTnaHVrlt7jx4iLRFrd2V8LmKTNY8dzZ95NH6gH 41Nb+o3WS0iEaNt+M1tlcvHb7iI9fAR2+IvL7P75pWpwE0UY3d82TTEFzIDM0PCb3Iup zgMg== X-Gm-Message-State: ALyK8tJfT88QChv5T9ueW0bfsNLMHYoUygx+r/Y18gnNNPsNEbOCiaZMQUOKCKCPF6xiCNvQLQ4= X-Received: by 10.55.22.30 with SMTP id g30mr23341412qkh.29.1468583038546; Fri, 15 Jul 2016 04:43:58 -0700 (PDT) Received: from localhost (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by smtp.gmail.com with ESMTPSA id v19sm3458354qkl.22.2016.07.15.04.43.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jul 2016 04:43:57 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Fri, 15 Jul 2016 07:43:55 -0400 Message-Id: <1468583035-20118-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.7.4 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH] helper: cuckootable: fix func with no return X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" fix non-void function with the possibility of no return statement Signed-off-by: Mike Holmes --- helper/cuckootable.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/helper/cuckootable.c b/helper/cuckootable.c index 91a73b4..1327a40 100644 --- a/helper/cuckootable.c +++ b/helper/cuckootable.c @@ -171,10 +171,12 @@ odph_cuckoo_table_lookup(const char *name) tbl = (odph_cuckoo_table_impl *)odp_shm_addr(odp_shm_lookup(name)); if ( - tbl != NULL && + !(tbl != NULL && tbl->magicword == ODPH_CUCKOO_TABLE_MAGIC_WORD && - strcmp(tbl->name, name) == 0) - return (odph_table_t)tbl; + strcmp(tbl->name, name) == 0)) + tbl = NULL; + + return (odph_table_t)tbl; } odph_table_t @@ -355,6 +357,8 @@ odph_cuckoo_table_destroy(odph_table_t tbl) /* free impl */ odp_shm_free(odp_shm_lookup(impl->name)); + + return 0; } static uint32_t hash(const odph_cuckoo_table_impl *h, const void *key)