From patchwork Tue Mar 16 23:50:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 12144325 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=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 6F7E8C433E9 for ; Tue, 16 Mar 2021 23:52:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 317B364F8F for ; Tue, 16 Mar 2021 23:52:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229784AbhCPXvb (ORCPT ); Tue, 16 Mar 2021 19:51:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:45582 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbhCPXvQ (ORCPT ); Tue, 16 Mar 2021 19:51:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5074764F90; Tue, 16 Mar 2021 23:51:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615938676; bh=3OeIsMijVJX6ZKrSFRa3+DVx8aleWeltamhbdgf2vW8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ATwzAIQJhj60dOixnXuGdAS23tVP5Z3BSeh1HQwcEe9qgZOxLPWOmmIsTLD1jgBzp 8SkmbEsSy3sW3+aqwft9FYId73n5B7aSmMcWn7gs/7wziqqjIEFVDNdV6MxOK0KA0h RtovyL4D1oihlQCnmyWQb8wdKJ4nNVxX/94KSDYwS9orIOxSDPi3GCAkWAyWZ7wAtZ me+8incHsvlHIHOc6sfwD5m01Osvjd5a8OmVjDDP37vQFcX3S1ehySh/q/v0WfWnuF qwumh0vLlNr3O7/AnqFEKBknaAMppoIDCBsnu6u5da1Q0VSzVObh6fCjy5cF/WogK3 /fbeOyjp2Utqw== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Jiri Pirko , Roi Dayan , Saeed Mahameed Subject: [net-next 01/15] net: Change dev parameter to const in netif_device_present() Date: Tue, 16 Mar 2021 16:50:58 -0700 Message-Id: <20210316235112.72626-2-saeed@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210316235112.72626-1-saeed@kernel.org> References: <20210316235112.72626-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Roi Dayan Not all ndos check the present bit before calling the ndo and the driver may want to check it. Sometimes the dev parameter passed as const so we pass it to netif_device_present() as const. Since netif_device_present() doesn't modify dev parameter anyway, declare it as const. Signed-off-by: Roi Dayan Signed-off-by: Saeed Mahameed --- include/linux/netdevice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index b379d08a12ed..97254c089eb2 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -4175,7 +4175,7 @@ static inline bool netif_oper_up(const struct net_device *dev) * * Check if device has not been removed from system. */ -static inline bool netif_device_present(struct net_device *dev) +static inline bool netif_device_present(const struct net_device *dev) { return test_bit(__LINK_STATE_PRESENT, &dev->state); }