From patchwork Wed Jan 6 23:17:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12002477 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.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=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 94876C433E9 for ; Wed, 6 Jan 2021 23:19:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6CB9F22D6F for ; Wed, 6 Jan 2021 23:19:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727819AbhAFXS4 (ORCPT ); Wed, 6 Jan 2021 18:18:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726908AbhAFXSz (ORCPT ); Wed, 6 Jan 2021 18:18:55 -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 BF38FC06134C for ; Wed, 6 Jan 2021 15:17:53 -0800 (PST) Received: by mail-ej1-x62f.google.com with SMTP id ce23so7273523ejb.8 for ; Wed, 06 Jan 2021 15:17:53 -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=EI1wC9Xkqmpzjm/YrEjem0fZLb6nFmO7JkSvvcJ589s=; b=WIU1X/MNDdWK9IreQuDVOm9p6tii8JTaRYi+MZ9gibK73q4Ho2F7gdKVd6Lxv4+/TE YvQsrIVZYGhSA6Ft+eeQPU0GwR+mh38hOMLaArMbZ1ZRaMYNKAC1Jldgn8jj1IyLICr6 uYVczxBSkqFSRpNZj92MCFMEqsgEwfdzj6+E5tZdJ5c3aG6lOF8/e3Ap2VTlfWxF3WU2 QzvF8D5SQU4lOZuxSZS9SB41iADOinWWdHgofRXRFSkqyHq3m/utGu02f8R97h2bkJPY JRLTFADr3mKDKrzw84GimKF9gzxnQ6i8m9ZU0UuS3uHJx10pnUDCDEw2RrSfXSRAdrk/ 1z1A== 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=EI1wC9Xkqmpzjm/YrEjem0fZLb6nFmO7JkSvvcJ589s=; b=RxtJa5r1zRb1ThfeZSlrHQEFUZSnKtLW2V1AXYoZAtcSMQPO+cyoQCMvfJyr4DbGqv GxfYE2UhWgixu+muEOW9OEWh2HrZRkL/xks9kczOZ6spdSytQ9Ri//+HUXJwFUJ8NpBi 4AcNYLqly0JsWifnFJxQMTPFqugAGoYN9ZRafonmXKd1BvKEzdcsyNmJlNfQAwY3z+qB WLfkSPtMympxebC+plpoZyaCrGOELXx9d9Kd3Cddvn4d8gV3I1PF+A3lljX8DZSrOQNK Pys295+uLBCflvPF/LMjC+x00jAANAmuGSX6ZUw/8pKOVPgSzvEN5KhONNPpFwbZfvxY IOPQ== X-Gm-Message-State: AOAM533KXe5baWxvBoU8v37dGhugfWsEqzPeE6OX/P01iXIj/Pu+1cWf AarOmc6oiFRT+ZYFRuGeDtI= X-Google-Smtp-Source: ABdhPJxqChjizXmHX17T2+IE7H4WTLyBiv8cBGJ68hJbx+x1aX1ug/5eZDpwt2Jx9Iyj7FBVi/ovYQ== X-Received: by 2002:a17:906:7146:: with SMTP id z6mr4337237ejj.379.1609975072510; Wed, 06 Jan 2021 15:17:52 -0800 (PST) Received: from localhost.localdomain (5-12-227-87.residential.rdsnet.ro. [5.12.227.87]) by smtp.gmail.com with ESMTPSA id a6sm1958263edv.74.2021.01.06.15.17.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Jan 2021 15:17:52 -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 Subject: [PATCH v3 net-next 04/11] net: switchdev: delete switchdev_port_obj_add_now Date: Thu, 7 Jan 2021 01:17:21 +0200 Message-Id: <20210106231728.1363126-5-olteanv@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210106231728.1363126-1-olteanv@gmail.com> References: <20210106231728.1363126-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 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);