From patchwork Wed Dec 28 08:47:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?6auY5bOw?= X-Patchwork-Id: 709189 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 3tpRG866gZz9t10 for ; Wed, 28 Dec 2016 19:48:16 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751293AbcL1IsK (ORCPT ); Wed, 28 Dec 2016 03:48:10 -0500 Received: from smtpbg342.qq.com ([14.17.44.37]:36935 "EHLO smtpbg342.qq.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751060AbcL1IsI (ORCPT ); Wed, 28 Dec 2016 03:48:08 -0500 X-QQ-mid: bizesmtp15t1482914871tscin3qm Received: from ikuai-dev.ikuai8.com (unknown [123.56.230.35]) by esmtp4.qq.com (ESMTP) with id ; Wed, 28 Dec 2016 16:47:43 +0800 (CST) X-QQ-SSF: 01400000002000F0FH40000A0000000 X-QQ-FEAT: 3/uZtCVzlRkDZipwOkY3WQlo5PAfq8Lml2LcXXHPmAuRdAW/iEq4jfloye5mh sgHqjlgzhPuH5Z09G5ezusaxTNOTOrHxCU7Hd5SxWTRsmHTTOZlM0JCkK5bc6xb7Z+53M3T XUxR35S/Ry17XrllkWarBcMKTkS1zrX0n5Wlxf5b7RG6K+j/Mkv1XVAUu+TvzoS6rnCrUp4 +zM6B+siHB9U1HK8PnFsxDHx6SnMETgb/MGBx7fzcjr++Gb47qJ9r5clz6fezMLJAxU4p/i mLTR2wqgnJlPGk X-QQ-GoodBg: 2 From: fgao@ikuai8.com To: davem@davemloft.net, maheshb@google.com, edumazet@google.com, netdev@vger.kernel.org, gfree.wind@gmail.com Cc: Gao Feng Subject: [PATCH net-next RESEND 1/1] driver: ipvlan: Remove unnecessary ipvlan NULL check in ipvlan_count_rx Date: Wed, 28 Dec 2016 16:47:42 +0800 Message-Id: <1482914862-2793-1-git-send-email-fgao@ikuai8.com> X-Mailer: git-send-email 1.9.1 X-QQ-SENDSIZE: 520 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Gao Feng There are three functions which would invoke the ipvlan_count_rx. They are ipvlan_process_multicast, ipvlan_rcv_frame, and ipvlan_nf_input. The former two functions already use the ipvlan directly before ipvlan_count_rx, and ipvlan_nf_input gets the ipvlan from ipvl_addr->master, it is not possible to be NULL too. So the ipvlan pointer check is unnecessary in ipvlan_count_rx. Signed-off-by: Gao Feng --- It is sent again because the last email is sent during net-next closed drivers/net/ipvlan/ipvlan_core.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c index b4e9907..082f9f1 100644 --- a/drivers/net/ipvlan/ipvlan_core.c +++ b/drivers/net/ipvlan/ipvlan_core.c @@ -19,9 +19,6 @@ void ipvlan_init_secret(void) static void ipvlan_count_rx(const struct ipvl_dev *ipvlan, unsigned int len, bool success, bool mcast) { - if (!ipvlan) - return; - if (likely(success)) { struct ipvl_pcpu_stats *pcptr;