]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: freescale: ucc_geth: make ugeth_mac_ops be static const
authorPei Xiao <xiaopei01@kylinos.cn>
Mon, 17 Feb 2025 01:29:30 +0000 (09:29 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 19 Feb 2025 02:08:18 +0000 (18:08 -0800)
sparse warning:
    sparse: symbol 'ugeth_mac_ops' was not declared. Should it be
static.

Add static to fix sparse warnings and add const. phylink_create() will
accept a const struct.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/202502141128.9HfxcdIE-lkp@intel.com
Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/ucc_geth.c

index 88510f822759607b34d99e03225a2621fe3039d4..affd5a6c44e7b32b4565cd1b0f37a67fff8ec693 100644 (file)
@@ -3408,7 +3408,7 @@ static int ucc_geth_parse_clock(struct device_node *np, const char *which,
        return 0;
 }
 
-struct phylink_mac_ops ugeth_mac_ops = {
+static const struct phylink_mac_ops ugeth_mac_ops = {
        .mac_link_up = ugeth_mac_link_up,
        .mac_link_down = ugeth_mac_link_down,
        .mac_config = ugeth_mac_config,