From patchwork Fri Oct 27 20:19:51 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: 10030667 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 45D8F6034B for ; Fri, 27 Oct 2017 21:08:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 251AA28E2F for ; Fri, 27 Oct 2017 21:08:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08D4528FD3; Fri, 27 Oct 2017 21:08:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3FA028E2F for ; Fri, 27 Oct 2017 21:08:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750815AbdJ0VIm (ORCPT ); Fri, 27 Oct 2017 17:08:42 -0400 Received: from gateway23.websitewelcome.com ([192.185.50.119]:35314 "EHLO gateway23.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750781AbdJ0VIl (ORCPT ); Fri, 27 Oct 2017 17:08:41 -0400 X-Greylist: delayed 1502 seconds by postgrey-1.27 at vger.kernel.org; Fri, 27 Oct 2017 17:08:41 EDT Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 9E7FB11B2E for ; Fri, 27 Oct 2017 15:19:52 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id 8B6eeaD3ORtUX8B6eenBDB; Fri, 27 Oct 2017 15:19:52 -0500 Received: from [189.145.38.148] (port=35082 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.87) (envelope-from ) id 1e8B6e-003WT9-7p; Fri, 27 Oct 2017 15:19:52 -0500 Date: Fri, 27 Oct 2017 15:19:51 -0500 From: "Gustavo A. R. Silva" To: Alan Tull , Moritz Fischer Cc: linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] fpga: fpga-bridge: remove unnecessary null check in of_fpga_bridge_get Message-ID: <20171027201951.GA27077@embeddedor.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) 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.145.38.148 X-Source-L: No X-Exim-ID: 1e8B6e-003WT9-7p X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [189.145.38.148]:35082 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 3 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-fpga-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Notice that bridge = to_fpga_bridge(dev); expands to: bridge = container_of(dev, struct fpga_bridge, dev); and container_of is never null, so this null check is unnecessary. Addresses-Coverity-ID: 1397912 Reported-by: Alan Tull Signed-off-by: Gustavo A. R. Silva Reviewed-by: Moritz Fischer Signed-off-by: Alan Tull --- drivers/fpga/fpga-bridge.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c index 9651aa5..409d1ac 100644 --- a/drivers/fpga/fpga-bridge.c +++ b/drivers/fpga/fpga-bridge.c @@ -94,8 +94,6 @@ struct fpga_bridge *of_fpga_bridge_get(struct device_node *np, goto err_dev; bridge = to_fpga_bridge(dev); - if (!bridge) - goto err_dev; bridge->info = info;