Thread (6 messages) 6 messages, 2 authors, 2025-02-09

Re: [PATCH 1/1] can: esd_usb: Fix not detecting version reply in probe routine

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: 2025-02-09 19:45:52
Also in: linux-can

On 09.02.2025 18:53:43, Stefan Mätje wrote:
quoted
quoted
quoted
quoted
-	return usb_bulk_msg(dev->udev,
-			    usb_rcvbulkpipe(dev->udev, 1),
-			    msg,
-			    sizeof(*msg),
-			    &actual_length,
-			    1000);
+	for (attempt = 0; attempt < 8 && cnt_vs == 0; ++attempt) {
Can you create a #define for the "8" to avoid a magic number here?
This value was found empirically. But I think I have to reconsider
the style of handling here and may need to adapt the solution.
You're the expert, change it as needed. I can only comment on the coding
style and its best to avoid numbers in the code. Create a define and if
you think it's worth, document that it's an empirically found value.

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help