Thread (12 messages) 12 messages, 3 authors, 2021-11-18
STALE1663d LANDED

[PATCH net 3/4] can: m_can: make custom bittiming fields const

From: Matthias Schiffer <hidden>
Date: 2021-11-15 09:21:39
Also in: linux-can, lkml
Subsystem: can network drivers, mcan device driver, the rest · Maintainers: Marc Kleine-Budde, Vincent Mailhol, Markus Schneider-Pargmann, Linus Torvalds

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.

Signed-off-by: Matthias Schiffer <redacted>
---
 drivers/net/can/m_can/m_can.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/can/m_can/m_can.h b/drivers/net/can/m_can/m_can.h
index ad063b101411..2c5d40997168 100644
--- a/drivers/net/can/m_can/m_can.h
+++ b/drivers/net/can/m_can/m_can.h
@@ -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;
 
-- 
2.17.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help