All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: linux-can@vger.kernel.org
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH v3 3/7] can: gs_usb: gs_can_open(): merge setting of timestamp flags and init
Date: Thu, 20 Oct 2022 00:10:12 +0200	[thread overview]
Message-ID: <20221019221016.1659260-4-mkl@pengutronix.de> (raw)
In-Reply-To: <20221019221016.1659260-1-mkl@pengutronix.de>

Merge the bodies of 2 consecutive "if (dev->feature &
GS_CAN_FEATURE_HW_TIMESTAMP)" statements.

Link: https://lore.kernel.org/all/20221019213035.1607752-4-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/usb/gs_usb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c
index 5dad0ebb3d3e..f9e2b394c71e 100644
--- a/drivers/net/can/usb/gs_usb.c
+++ b/drivers/net/can/usb/gs_usb.c
@@ -923,12 +923,12 @@ static int gs_can_open(struct net_device *netdev)
 		flags |= GS_CAN_MODE_FD;
 
 	/* if hardware supports timestamps, enable it */
-	if (dev->feature & GS_CAN_FEATURE_HW_TIMESTAMP)
+	if (dev->feature & GS_CAN_FEATURE_HW_TIMESTAMP) {
 		flags |= GS_CAN_MODE_HW_TIMESTAMP;
 
-	/* start polling timestamp */
-	if (dev->feature & GS_CAN_FEATURE_HW_TIMESTAMP)
+		/* start polling timestamp */
 		gs_usb_timestamp_init(dev);
+	}
 
 	/* finally start device */
 	dev->can.state = CAN_STATE_ERROR_ACTIVE;
-- 
2.35.1



  parent reply	other threads:[~2022-10-19 22:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 22:10 [PATCH v3 0/7] can: gs_usb: new features: GS_CAN_FEATURE_GET_STATE, GS_CAN_FEATURE_BERR_REPORTING Marc Kleine-Budde
2022-10-19 22:10 ` [PATCH v3 1/7] can: gs_usb: gs_can_open(): allow loopback and listen only at the same time Marc Kleine-Budde
2022-10-19 22:10 ` [PATCH v3 2/7] can: gs_usb: gs_can_open(): sort checks for ctrlmode Marc Kleine-Budde
2022-10-19 22:10 ` Marc Kleine-Budde [this message]
2022-10-19 22:10 ` [PATCH v3 4/7] can: gs_usb: document GS_CAN_FEATURE_BERR_REPORTING Marc Kleine-Budde
2022-10-19 22:10 ` [PATCH v3 5/7] can: gs_usb: add ability to enable / disable berr reporting Marc Kleine-Budde
2022-10-19 22:10 ` [PATCH v3 6/7] can: gs_usb: document GS_CAN_FEATURE_GET_STATE Marc Kleine-Budde
2022-10-19 22:10 ` [PATCH v3 7/7] can: gs_usb: add support for reading error counters Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221019221016.1659260-4-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.