lkml.org 
[lkml]   [2022]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6] can, tty: can327 CAN/ldisc driver for ELM327 based OBD-II adapters
On 13.05.2022 11:38:31, Vincent Mailhol wrote:
> > +static void elm327_parse_line(struct can327 *elm, size_t len)
> > +{
> > + lockdep_assert_held(&elm->lock);
>
> You are using many of those lockdep_assert_held(&elm->lock);
>
> I guess you put them for debug purpose and probaly some of those can
> be removed (if you see a genuine risk at some places, then OK to keep
> as a safety net, but a bit of clean up can be done here, I think).
>
> This comment applies to all use of lockdep_assert_held().

These statements document that the code must be called with the lock
held. They optimize away if lockdep is not enabled. Better keep them in
place.

regards,
Marc

--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2022-05-13 13:49    [W:0.093 / U:0.756 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site