[PATCH v1 02/34] j1939: transport: make const what is possible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
---
 net/can/j1939/j1939-priv.h |  2 +-
 net/can/j1939/transport.c  | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/net/can/j1939/j1939-priv.h b/net/can/j1939/j1939-priv.h
index eeefa2f0cbc9..612ed17864d0 100644
--- a/net/can/j1939/j1939-priv.h
+++ b/net/can/j1939/j1939-priv.h
@@ -161,7 +161,7 @@ struct j1939_sk_buff_cb {
 	priority_t priority;
 };
 
-static inline struct j1939_sk_buff_cb *j1939_skb_to_cb(struct sk_buff *skb)
+static inline struct j1939_sk_buff_cb *j1939_skb_to_cb(const struct sk_buff *skb)
 {
 	BUILD_BUG_ON(sizeof(struct j1939_sk_buff_cb) > sizeof(skb->cb));
 
diff --git a/net/can/j1939/transport.c b/net/can/j1939/transport.c
index fe9ab330f761..b10352fafe84 100644
--- a/net/can/j1939/transport.c
+++ b/net/can/j1939/transport.c
@@ -365,19 +365,19 @@ static struct sk_buff *j1939_session_skb_find(struct j1939_session *session)
 /* see if we are receiver
  * returns 0 for broadcasts, although we will receive them
  */
-static inline int j1939_tp_im_receiver(struct j1939_sk_buff_cb *skcb)
+static inline int j1939_tp_im_receiver(const struct j1939_sk_buff_cb *skcb)
 {
 	return skcb->dst_flags & J1939_ECU_LOCAL;
 }
 
 /* see if we are sender */
-static inline int j1939_tp_im_transmitter(struct j1939_sk_buff_cb *skcb)
+static inline int j1939_tp_im_transmitter(const struct j1939_sk_buff_cb *skcb)
 {
 	return skcb->src_flags & J1939_ECU_LOCAL;
 }
 
 /* see if we are involved as either receiver or transmitter */
-static int j1939_tp_im_involved(struct j1939_sk_buff_cb *skcb, bool swap)
+static int j1939_tp_im_involved(const struct j1939_sk_buff_cb *skcb, bool swap)
 {
 	if (swap)
 		return j1939_tp_im_receiver(skcb);
@@ -506,7 +506,7 @@ static void j1939_skbcb_swap(struct j1939_sk_buff_cb *skcb)
 }
 
 static struct sk_buff *j1939_tp_tx_dat_new(struct j1939_priv *priv,
-					   struct j1939_sk_buff_cb *re_skcb,
+					   const struct j1939_sk_buff_cb *re_skcb,
 					   bool ctl,
 					   bool swap_src_dst)
 {
@@ -564,7 +564,7 @@ static int j1939_tp_tx_dat(struct j1939_session *session,
 }
 
 static int j1939_xtp_do_tx_ctl(struct j1939_priv *priv,
-			       struct j1939_sk_buff_cb *re_skcb,
+			       const struct j1939_sk_buff_cb *re_skcb,
 			       bool swap_src_dst, pgn_t pgn, const u8 *dat)
 {
 	struct sk_buff *skb;
@@ -597,7 +597,7 @@ static inline int j1939_tp_tx_ctl(struct j1939_session *session,
 }
 
 static int j1939_xtp_tx_abort(struct j1939_priv *priv,
-			      struct j1939_sk_buff_cb *re_skcb,
+			      const struct j1939_sk_buff_cb *re_skcb,
 			      bool swap_src_dst,
 			      enum j1939_xtp_abort err,
 			      pgn_t pgn)
-- 
2.20.1




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux