From patchwork Tue Jun 13 16:37:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 775331 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wnFmj3BzKz9s8P for ; Wed, 14 Jun 2017 02:37:41 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752756AbdFMQhY (ORCPT ); Tue, 13 Jun 2017 12:37:24 -0400 Received: from gateway22.websitewelcome.com ([192.185.46.152]:36825 "EHLO gateway22.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751802AbdFMQhW (ORCPT ); Tue, 13 Jun 2017 12:37:22 -0400 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway22.websitewelcome.com (Postfix) with ESMTP id C86742579D for ; Tue, 13 Jun 2017 11:37:19 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id KoridCNWGrCyUKoridc1V0; Tue, 13 Jun 2017 11:40:26 -0500 Received: from [189.152.189.231] (port=52366 helo=embeddedgus) by gator4166.hostgator.com with esmtpa (Exim 4.87) (envelope-from ) id 1dKooh-003lKi-HZ; Tue, 13 Jun 2017 11:37:19 -0500 Date: Tue, 13 Jun 2017 11:37:18 -0500 From: "Gustavo A. R. Silva" To: Samuel Ortiz , "David S. Miller" Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , Guenter Roeck Subject: [PATCH] nfc: nci: remove unnecessary null check Message-ID: <20170613163718.GA5375@embeddedgus> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <28317503-e721-2564-a9ff-82182aa0644a@roeck-us.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.152.189.231 X-Exim-ID: 1dKooh-003lKi-HZ X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedgus) [189.152.189.231]:52366 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 4 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Remove unnecessary NULL check for pointer conn_info. conn_info is set in list_for_each_entry() using container_of(), which is never NULL. Addresses-Coverity-ID: 1362349 Cc: Guenter Roeck Signed-off-by: Gustavo A. R. Silva Reviewed-by: Guenter Roeck --- net/nfc/nci/core.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index 61fff42..c15cb88 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c @@ -73,11 +73,10 @@ int nci_get_conn_info_by_dest_type_params(struct nci_dev *ndev, u8 dest_type, if (conn_info->dest_type == dest_type) { if (!params) return conn_info->conn_id; - if (conn_info) { - if (params->id == conn_info->dest_params->id && - params->protocol == conn_info->dest_params->protocol) - return conn_info->conn_id; - } + + if (params->id == conn_info->dest_params->id && + params->protocol == conn_info->dest_params->protocol) + return conn_info->conn_id; } }