lkml.org 
[lkml]   [2021]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/4] leds: Add driver for QCOM SPMI Flash LEDs
Hi!

> >>>+#include <linux/kernel.h>
> >>>+#include <linux/module.h>
> >>>+#include <linux/spmi.h>
> >>>+#include <linux/of_device.h>
> >>>+#include <linux/device.h>
> >>>+#include <linux/types.h>
> >>>+#include <linux/string.h>
> >>>+#include <linux/mutex.h>
> >>>+#include <linux/sysfs.h>
> >>>+#include <linux/led-class-flash.h>
> >>>+#include <linux/regulator/consumer.h>
> >>>+#include <linux/delay.h>
> >>>+#include <linux/regmap.h>
> >>>+#include <dt-bindings/leds/leds-qcom-spmi-flash.h>
> >>
> >>Please sort includes alphabetically.
> >
> >No need to do that.
>
> Keeping the includes sorted eliminates the risk of introducing duplicates
> and allows for faster lookup.
>
> What gain is in having them unsorted?

It is not there is gain in them unsorted; it is that keeping sorted
order is not worth the effort.

> >>>+#define FLASH_SAFETY_TIMER 0x40
> >>
> >>Namespacing prefix is needed for macros, e.g. QCOM_FLASH*.
> >
> >No need for that in .c files.
>
> In general it eliminates the risk of name clash with other subsystems
> headers.
>
> And actually the prefix here should be QCOM_LED_FLASH to avoid ambiguity
> with flash memory. If you dropped the vendor prefix then you'd get
> possible name clash with led-class-flash.h namespace prefix.

I believe the cost (longer macro names) outweights the benefits here.

Best regards,
Pavel
--
http://www.livejournal.com/~pavelmachek
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-04-25 22:20    [W:0.065 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site