Hi

Am 15.05.26 um 16:43 schrieb Luca Weiss:
[...]
I checked and include/linux/container_of.h states:

   Do not use container_of() in new code.

and

   Always prefer container_of_const() instead of container_of() in new code.

So sounds like using container_of_const() is the correct way.

I didn't know that. Thanks!

Best regards
Thomas


+
+       ret = regulator_bulk_enable(ARRAY_SIZE(nt37705_supplies), 
ctx->supplies);
+       if (ret < 0) {
Common style is to check for errors with

     if (ret)

Here and everywhere else.
At least for regulator_bulk_enable() "ret < 0" is actually more popular
than just "ret".

Kernel doc says "Return: 0 on success or a negative error number on
failure." so a positive integer should in theory never happen so they're
equivalent.

(git grep -h -A2 regulator_bulk_enable | grep if | sed 's|^[ \t]\+||' | sed 's| 
{$||' | sort | uniq -c)
It's just nitpicking, not a blocker.
I was also curious so I dug around a bit :)

Regards
Luca

--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)



Reply via email to