]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
can: m_can: make custom bittiming fields const
authorMatthias Schiffer <matthias.schiffer@ew.tq-group.com>
Mon, 15 Nov 2021 09:18:51 +0000 (10:18 +0100)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 4 Jan 2022 08:49:29 +0000 (09:49 +0100)
BugLink: https://bugs.launchpad.net/bugs/1956302
commit ea22ba40debee29ee7257c42002409899e9311c1 upstream.

The assigned timing structs will be defined a const anyway, so we can
avoid a few casts by declaring the struct fields as const as well.

Link: https://lore.kernel.org/all/4508fa4e639164b2584c49a065d90c78a91fa568.1636967198.git.matthias.schiffer@ew.tq-group.com
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
drivers/net/can/m_can/m_can.h

index ad063b10141104016d834643aac2b720bafc1229..2c5d40997168616ca1ab85d1235560c654f2dfe7 100644 (file)
@@ -85,8 +85,8 @@ struct m_can_classdev {
        struct sk_buff *tx_skb;
        struct phy *transceiver;
 
-       struct can_bittiming_const *bit_timing;
-       struct can_bittiming_const *data_timing;
+       const struct can_bittiming_const *bit_timing;
+       const struct can_bittiming_const *data_timing;
 
        struct m_can_ops *ops;