summaryrefslogtreecommitdiff
path: root/drivers/net/can/dev.c
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2019-08-27 15:04:12 +0300
committerMarc Kleine-Budde <mkl@pengutronix.de>2019-09-03 11:28:13 +0300
commit39fe6fd5fb3a976ceef82a1b7cd100b3d4d8eefa (patch)
treeb7471856e9245ccbc01786614360a1236ba15a71 /drivers/net/can/dev.c
parentd7bda73070201514d0d254f451c11bcc9b5890f1 (diff)
downloadlinux-39fe6fd5fb3a976ceef82a1b7cd100b3d4d8eefa.tar.xz
can: dev: remove unnecessary parentheses
This patch removes unnecessary parentheses from the generic CAN device infrastructure. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/dev.c')
-rw-r--r--drivers/net/can/dev.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index 9f58c4f0344d..7175b61cdc8b 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -99,8 +99,8 @@ can_update_sample_point(const struct can_bittiming_const *btc,
(tseg + CAN_CALC_SYNC_SEG);
sample_point_error = abs(sample_point_nominal - sample_point);
- if ((sample_point <= sample_point_nominal) &&
- (sample_point_error < best_sample_point_error)) {
+ if (sample_point <= sample_point_nominal &&
+ sample_point_error < best_sample_point_error) {
best_sample_point = sample_point;
best_sample_point_error = sample_point_error;
*tseg1_ptr = tseg1;
@@ -151,7 +151,7 @@ static int can_calc_bittiming(struct net_device *dev, struct can_bittiming *bt,
/* choose brp step which is possible in system */
brp = (brp / btc->brp_inc) * btc->brp_inc;
- if ((brp < btc->brp_min) || (brp > btc->brp_max))
+ if (brp < btc->brp_min || brp > btc->brp_max)
continue;
bitrate = priv->clock.freq / (brp * tsegall);
@@ -803,7 +803,7 @@ int open_candev(struct net_device *dev)
/* For CAN FD the data bitrate has to be >= the arbitration bitrate */
if ((priv->ctrlmode & CAN_CTRLMODE_FD) &&
(!priv->data_bittiming.bitrate ||
- (priv->data_bittiming.bitrate < priv->bittiming.bitrate))) {
+ priv->data_bittiming.bitrate < priv->bittiming.bitrate)) {
netdev_err(dev, "incorrect/missing data bit-timing\n");
return -EINVAL;
}
@@ -1253,7 +1253,7 @@ EXPORT_SYMBOL_GPL(unregister_candev);
*/
struct can_priv *safe_candev_priv(struct net_device *dev)
{
- if ((dev->type != ARPHRD_CAN) || (dev->rtnl_link_ops != &can_link_ops))
+ if (dev->type != ARPHRD_CAN || dev->rtnl_link_ops != &can_link_ops)
return NULL;
return netdev_priv(dev);