This patch marks the arguments of some functions as well as some local variables as constant.
Unified · Split
| @@ -24,7 +24,7 @@ · 23 unmodified lines | ||
| 24 | 24 | */ |
| 25 | 25 | static int |
| 26 | 26 | can_update_sample_point(const struct can_bittiming_const *btc, |
| 27 | − unsigned int sample_point_nominal, unsigned int tseg, | |
| 27 | + const unsigned int sample_point_nominal, const unsigned int tseg, | |
| 28 | 28 | unsigned int *tseg1_ptr, unsigned int *tseg2_ptr, |
| 29 | 29 | unsigned int *sample_point_error_ptr) |
| 30 | 30 | { |
| @@ -63,7 +63,7 @@ can_update_sample_point(const struct can_bittiming_const *btc, · 32 unmodified lines | ||
| 63 | 63 | return best_sample_point; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | −int can_calc_bittiming(struct net_device *dev, struct can_bittiming *bt, | |
| 66 | +int can_calc_bittiming(const struct net_device *dev, struct can_bittiming *bt, | |
| 67 | 67 | const struct can_bittiming_const *btc) |
| 68 | 68 | { |
| 69 | 69 | struct can_priv *priv = netdev_priv(dev); |
| @@ -208,10 +208,10 @@ void can_calc_tdco(struct can_tdc *tdc, const struct can_tdc_const *tdc_const, · 138 unmodified lines | ||
| 208 | 208 | * prescaler value brp. You can find more information in the header |
| 209 | 209 | * file linux/can/netlink.h. |
| 210 | 210 | */ |
| 211 | −static int can_fixup_bittiming(struct net_device *dev, struct can_bittiming *bt, | |
| 211 | +static int can_fixup_bittiming(const struct net_device *dev, struct can_bittiming *bt, | |
| 212 | 212 | const struct can_bittiming_const *btc) |
| 213 | 213 | { |
| 214 | − struct can_priv *priv = netdev_priv(dev); | |
| 214 | + const struct can_priv *priv = netdev_priv(dev); | |
| 215 | 215 | unsigned int tseg1, alltseg; |
| 216 | 216 | u64 brp64; |
| 217 | 217 | |
| @@ -244,7 +244,7 @@ static int can_fixup_bittiming(struct net_device *dev, struct can_bittiming *bt, · 26 unmodified lines | ||
| 244 | 244 | |
| 245 | 245 | /* Checks the validity of predefined bitrate settings */ |
| 246 | 246 | static int |
| 247 | −can_validate_bitrate(struct net_device *dev, struct can_bittiming *bt, | |
| 247 | +can_validate_bitrate(const struct net_device *dev, const struct can_bittiming *bt, | |
| 248 | 248 | const u32 *bitrate_const, |
| 249 | 249 | const unsigned int bitrate_const_cnt) |
| 250 | 250 | { |
| @@ -258,7 +258,7 @@ can_validate_bitrate(struct net_device *dev, struct can_bittiming *bt, · 7 unmodified lines | ||
| 258 | 258 | return -EINVAL; |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | −int can_get_bittiming(struct net_device *dev, struct can_bittiming *bt, | |
| 261 | +int can_get_bittiming(const struct net_device *dev, struct can_bittiming *bt, | |
| 262 | 262 | const struct can_bittiming_const *btc, |
| 263 | 263 | const u32 *bitrate_const, |
| 264 | 264 | const unsigned int bitrate_const_cnt) |
| @@ -113,7 +113,7 @@ struct can_tdc_const { · 112 unmodified lines | ||
| 113 | 113 | }; |
| 114 | 114 | |
| 115 | 115 | #ifdef CONFIG_CAN_CALC_BITTIMING |
| 116 | −int can_calc_bittiming(struct net_device *dev, struct can_bittiming *bt, | |
| 116 | +int can_calc_bittiming(const struct net_device *dev, struct can_bittiming *bt, | |
| 117 | 117 | const struct can_bittiming_const *btc); |
| 118 | 118 | |
| 119 | 119 | void can_calc_tdco(struct can_tdc *tdc, const struct can_tdc_const *tdc_const, |
| @@ -121,7 +121,7 @@ void can_calc_tdco(struct can_tdc *tdc, const struct can_tdc_const *tdc_const, · 1 unmodified line | ||
| 121 | 121 | u32 *ctrlmode, u32 ctrlmode_supported); |
| 122 | 122 | #else /* !CONFIG_CAN_CALC_BITTIMING */ |
| 123 | 123 | static inline int |
| 124 | −can_calc_bittiming(struct net_device *dev, struct can_bittiming *bt, | |
| 124 | +can_calc_bittiming(const struct net_device *dev, struct can_bittiming *bt, | |
| 125 | 125 | const struct can_bittiming_const *btc) |
| 126 | 126 | { |
| 127 | 127 | netdev_err(dev, "bit-timing calculation not available\n"); |
| @@ -136,7 +136,7 @@ can_calc_tdco(struct can_tdc *tdc, const struct can_tdc_const *tdc_const, · 8 unmodified lines | ||
| 136 | 136 | } |
| 137 | 137 | #endif /* CONFIG_CAN_CALC_BITTIMING */ |
| 138 | 138 | |
| 139 | −int can_get_bittiming(struct net_device *dev, struct can_bittiming *bt, | |
| 139 | +int can_get_bittiming(const struct net_device *dev, struct can_bittiming *bt, | |
| 140 | 140 | const struct can_bittiming_const *btc, |
| 141 | 141 | const u32 *bitrate_const, |
| 142 | 142 | const unsigned int bitrate_const_cnt); |