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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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   |

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux