[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250209-platinum-numbat-of-calibration-a8514d-mkl@pengutronix.de>
Date: Sun, 9 Feb 2025 20:45:25 +0100
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Stefan Mätje <Stefan.Maetje@....eu>
Cc: "horms@...nel.org" <horms@...nel.org>,
"linux-can@...r.kernel.org" <linux-can@...r.kernel.org>, Frank Jungclaus <frank.jungclaus@....eu>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>, "mailhol.vincent@...adoo.fr" <mailhol.vincent@...adoo.fr>
Subject: Re: [PATCH 1/1] can: esd_usb: Fix not detecting version reply in
probe routine
On 09.02.2025 18:53:43, Stefan Mätje wrote:
> > > > > - 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 |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists