From patchwork Fri Aug 20 02:37:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lv Ruyi X-Patchwork-Id: 500927 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98CA2C432BE for ; Fri, 20 Aug 2021 02:37:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 77C68610A5 for ; Fri, 20 Aug 2021 02:37:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237677AbhHTCiO (ORCPT ); Thu, 19 Aug 2021 22:38:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234797AbhHTCiN (ORCPT ); Thu, 19 Aug 2021 22:38:13 -0400 Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5047C061575; Thu, 19 Aug 2021 19:37:35 -0700 (PDT) Received: by mail-qv1-xf36.google.com with SMTP id bl13so4797595qvb.5; Thu, 19 Aug 2021 19:37:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wWMQ9DoOno+c3OyqFMSEWNvDVLmVwUI+Xz33Hz9sthU=; b=halUh/5EkZaX/YBXMqTWvGtnH7NSWBlqI1rpxq0sMoxRkLhGjK4xQxOzJjbK4I6uRa AJuNfyHWivm2mbLD0aKTnrqHLyzUJUL0/S/Vm9bmdd6TzPubOFNfvLulxuywrwBoZS3G kUdDG3b7e9buH/sxmzB9m+KzZVpA1ZiUYMKSfBOSbqR5bSFcBwulODmFOEibRPzeWCJn 9qRhSpbcAT3Uy6yecQEgNmH0+gc7nBCpi0629uKGVUrILvS1aOUPt4S5KeaB4b1NN3pm xd55CJba6wx/ZMu8Q9olzto3Te27JaE6tHfihuD9gJbZdMNXWTNfqHUmnr6cvCrh9aoV MTZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wWMQ9DoOno+c3OyqFMSEWNvDVLmVwUI+Xz33Hz9sthU=; b=D5h3/z1uoquL16MvABiF7vi3+Jo3ApUX6ShRfnamxp1smcH2KGP3o25e6GnlSNcpvz gSTvhJiOYvkPBmWTpK/bAD5Hqn3bZmCaRhl3d9nyE0QOBQraP41gTiFnWV98wqPB2Kb0 MJj+qaQ9P5zIWHSrnV6z9uJMOGK4+tmhE7AB73atkVBcDODpHoioTyFG48tUVtx17hx0 fJB56NfOZn36JJ1TZf/Wduo72Mr4dyMBWmTq11BiO5eE6mYJ5F+mpWrVTSdqVb+hQSFZ jW5mbPIwWdLbzjfeQwW2ICUQ+BU9YhksLzKVWcTY7Z4Y0NwJNSK135V5rTnaEl78sX+H tBbw== X-Gm-Message-State: AOAM53017SmN8hQ8gcTbnKua6wsmkWCt993Eo+Gfdrt61u1vBv7kKVHK q2T+T+uSbWKt9UnPIej1aoc= X-Google-Smtp-Source: ABdhPJxpWI66ECfv2tS7crK+5x37kpF5iynRBZkNqa/BPKoimx9JnWtPYDhB7OPwgoTw6vV6FNaiuA== X-Received: by 2002:a0c:ff48:: with SMTP id y8mr17901761qvt.29.1629427055094; Thu, 19 Aug 2021 19:37:35 -0700 (PDT) Received: from localhost.localdomain ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id c1sm2114382qtj.36.2021.08.19.19.37.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Aug 2021 19:37:34 -0700 (PDT) From: jing yangyang X-Google-Original-From: jing yangyang To: Jesse Brandeburg Cc: Tony Nguyen , "David S . Miller" , Jakub Kicinski , Tariq Toukan , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, jing yangyang , Zeal Robot Subject: [PATCH linux-next] net: ethernet: fix returnvar.cocci warnings Date: Thu, 19 Aug 2021 19:37:13 -0700 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Remove unneeded variables when "0" can be returned. Generated by: scripts/coccinelle/misc/returnvar.cocci Reported-by: Zeal Robot Signed-off-by: jing yangyang --- drivers/net/ethernet/intel/iavf/iavf_adminq.c | 4 +--- drivers/net/ethernet/mellanox/mlx4/port.c | 8 ++------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/intel/iavf/iavf_adminq.c b/drivers/net/ethernet/intel/iavf/iavf_adminq.c index 9fa3fa9..cd4e6a2 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_adminq.c +++ b/drivers/net/ethernet/intel/iavf/iavf_adminq.c @@ -551,15 +551,13 @@ enum iavf_status iavf_init_adminq(struct iavf_hw *hw) **/ enum iavf_status iavf_shutdown_adminq(struct iavf_hw *hw) { - enum iavf_status ret_code = 0; - if (iavf_check_asq_alive(hw)) iavf_aq_queue_shutdown(hw, true); iavf_shutdown_asq(hw); iavf_shutdown_arq(hw); - return ret_code; + return 0; } /** diff --git a/drivers/net/ethernet/mellanox/mlx4/port.c b/drivers/net/ethernet/mellanox/mlx4/port.c index 256a06b..754c253 100644 --- a/drivers/net/ethernet/mellanox/mlx4/port.c +++ b/drivers/net/ethernet/mellanox/mlx4/port.c @@ -1820,9 +1820,7 @@ int mlx4_SET_MCAST_FLTR_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_cmd_mailbox *outbox, struct mlx4_cmd_info *cmd) { - int err = 0; - - return err; + return 0; } int mlx4_SET_MCAST_FLTR(struct mlx4_dev *dev, u8 port, @@ -1840,9 +1838,7 @@ int mlx4_SET_VLAN_FLTR_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_cmd_mailbox *outbox, struct mlx4_cmd_info *cmd) { - int err = 0; - - return err; + return 0; } int mlx4_DUMP_ETH_STATS_wrapper(struct mlx4_dev *dev, int slave,