From patchwork Sat Jan 9 00:01:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12007789 X-Patchwork-Delegate: kuba@kernel.org 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.8 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=ham 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 558D1C433DB for ; Sat, 9 Jan 2021 00:03:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2AA9723A9D for ; Sat, 9 Jan 2021 00:03:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726352AbhAIAC7 (ORCPT ); Fri, 8 Jan 2021 19:02:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726227AbhAIAC6 (ORCPT ); Fri, 8 Jan 2021 19:02:58 -0500 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AF7FC0613CF for ; Fri, 8 Jan 2021 16:02:18 -0800 (PST) Received: by mail-ej1-x62f.google.com with SMTP id w1so16686269ejf.11 for ; Fri, 08 Jan 2021 16:02:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bLjepiV/KQcXR1wVYk7VqLA3Gpev3YDcHbC37fcUGKM=; b=eVqGETkaclpPYYo9DUNTDf6xEWgODr47VJ1gqnWjTr53wH6PAKAoKkRzOn6Qbe+WUq 3EccYIy8WhnwsMljBbNFCkAv04SQHuMP9N9KNvp1mM8vtHOFZNtv98/PFjmFEUoxUC79 q6Y+jShspZhOEdgxqqXFWFmnH1XFBP3ZaMhNKJfD1NttssnZkq6sEtuiKU/0AzKBeWFJ wAXbAs6yobJuNvrZUDNrB+7SffUo6DgTaKSS+TOm8On4l4wdMS4LEb2NL/HcgnYRi3O/ GhR5mzFVFpzXLHFb4ipnYy0JVOiXrN1I+TLxtZarfzlAWvvFw38+csjg8UGHDSceF19L tsTg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=bLjepiV/KQcXR1wVYk7VqLA3Gpev3YDcHbC37fcUGKM=; b=hYezPn86ORc0Skc9oZWuok7BUtNC9gFVVvSxXaV4mZg2i8sc9kdoWjPY9TMVADWcub 7b5W0Wen3gm+TGxtoK6C/M6hsGtEPd/lqcoluSp581qTnPDXV0uXwFPtyDDk45Tmv/bS Gi3iezxlQUWYgBcovylaiQ5rLlNiHGyFdmebTAe7w/XnPVIT5vvKkDu9tInw6TkLgQtL elq8dwsiiD79l/gjdDYTlx9tzAwSpj6o9PoVwYQ7WlqtKjayKiLFC4nnTSZHGgv6nk/A 7899iu5XFD5pD7IRwfb+/22xGbi71LPZQmp8dKTdYIRASEQLSxqZuGkH+yNUgKEUXfbT fsvg== X-Gm-Message-State: AOAM532AuyeNejkQu6qelx+92PjGa9EDr5dONvlJos8yCHwsDDMzzvBQ j3DygrCrS73Vna+sj4cdcXA= X-Google-Smtp-Source: ABdhPJwHOgpaUXl1L5TFdMlpoyjF+kzezZFO0Eh0/jX0mNyylLAXyEm4eLu4dFBqkcduUL1AjWf13Q== X-Received: by 2002:a17:906:605:: with SMTP id s5mr4293192ejb.280.1610150537156; Fri, 08 Jan 2021 16:02:17 -0800 (PST) Received: from localhost.localdomain (5-12-227-87.residential.rdsnet.ro. [5.12.227.87]) by smtp.gmail.com with ESMTPSA id dx7sm4045346ejb.120.2021.01.08.16.02.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jan 2021 16:02:16 -0800 (PST) From: Vladimir Oltean To: "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org Cc: Florian Fainelli , Andrew Lunn , Vivien Didelot , Vladimir Oltean , Kurt Kanzenbach , Hauke Mehrtens , Woojung Huh , Microchip Linux Driver Support , Sean Wang , Landen Chao , Claudiu Manoil , Alexandre Belloni , Linus Walleij , Vadym Kochan , Taras Chornyi , Jiri Pirko , Ido Schimmel , Grygorii Strashko , Ioana Ciornei , Ivan Vecera , Petr Machata Subject: [PATCH v4 net-next 04/11] net: switchdev: delete switchdev_port_obj_add_now Date: Sat, 9 Jan 2021 02:01:49 +0200 Message-Id: <20210109000156.1246735-5-olteanv@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210109000156.1246735-1-olteanv@gmail.com> References: <20210109000156.1246735-1-olteanv@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Vladimir Oltean After the removal of the transactional model inside switchdev_port_obj_add_now, it has no added value and we can just call switchdev_port_obj_notify directly, bypassing this function. Let's delete it. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Reviewed-by: Ido Schimmel Acked-by: Linus Walleij Acked-by: Jiri Pirko --- Changes in v4: None. Changes in v3: None. Changes in v2: None. net/switchdev/switchdev.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c index a575bb33ee6c..3509d362056d 100644 --- a/net/switchdev/switchdev.c +++ b/net/switchdev/switchdev.c @@ -242,23 +242,15 @@ static int switchdev_port_obj_notify(enum switchdev_notifier_type nt, return 0; } -static int switchdev_port_obj_add_now(struct net_device *dev, - const struct switchdev_obj *obj, - struct netlink_ext_ack *extack) -{ - ASSERT_RTNL(); - - return switchdev_port_obj_notify(SWITCHDEV_PORT_OBJ_ADD, - dev, obj, extack); -} - static void switchdev_port_obj_add_deferred(struct net_device *dev, const void *data) { const struct switchdev_obj *obj = data; int err; - err = switchdev_port_obj_add_now(dev, obj, NULL); + ASSERT_RTNL(); + err = switchdev_port_obj_notify(SWITCHDEV_PORT_OBJ_ADD, + dev, obj, NULL); if (err && err != -EOPNOTSUPP) netdev_err(dev, "failed (err=%d) to add object (id=%d)\n", err, obj->id); @@ -290,7 +282,8 @@ int switchdev_port_obj_add(struct net_device *dev, if (obj->flags & SWITCHDEV_F_DEFER) return switchdev_port_obj_add_defer(dev, obj); ASSERT_RTNL(); - return switchdev_port_obj_add_now(dev, obj, extack); + return switchdev_port_obj_notify(SWITCHDEV_PORT_OBJ_ADD, + dev, obj, extack); } EXPORT_SYMBOL_GPL(switchdev_port_obj_add);