net: phy: mscc: macsec: constify vsc8584_macsec_ops
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Wed, 26 Aug 2020 22:56:07 +0000 (00:56 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 26 Aug 2020 23:21:17 +0000 (16:21 -0700)
The only usage of vsc8584_macsec_ops is to assign its address to the
macsec_ops field in the phydev struct, which is a const pointer. Make it
const to allow the compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/mscc/mscc_macsec.c

index 1d4c012..6cf9b79 100644 (file)
@@ -958,7 +958,7 @@ static int vsc8584_macsec_del_txsa(struct macsec_context *ctx)
        return 0;
 }
 
-static struct macsec_ops vsc8584_macsec_ops = {
+static const struct macsec_ops vsc8584_macsec_ops = {
        .mdo_dev_open = vsc8584_macsec_dev_open,
        .mdo_dev_stop = vsc8584_macsec_dev_stop,
        .mdo_add_secy = vsc8584_macsec_add_secy,