lkml.org 
[lkml]   [2021]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/4] leds: simatic-ipc-leds: add new driver for Siemens Industial PCs

> > + struct led_classdev cdev;
> > +};
> > +
> > +static struct simatic_ipc_led simatic_ipc_leds_io[] = {
> > + {1 << 15, "simatic-ipc:green:" LED_FUNCTION_STATUS "-1" },
> > + {1 << 7, "simatic-ipc:yellow:" LED_FUNCTION_STATUS "-1" },
> > + {1 << 14, "simatic-ipc:red:" LED_FUNCTION_STATUS "-2" },
> > + {1 << 6, "simatic-ipc:yellow:" LED_FUNCTION_STATUS "-2" },
> > + {1 << 13, "simatic-ipc:red:" LED_FUNCTION_STATUS "-3" },
> > + {1 << 5, "simatic-ipc:yellow:" LED_FUNCTION_STATUS "-3" },
>
> Can you use BIT() macro here? And can it be sorted by the bit order?

There's nothing wrong with << and this order is fine.

But I still don't like the naming. simantic-ipc: prefix is
useless. Having 6 status leds is not good, either.

> > + struct simatic_ipc_led *led =
> > + container_of(led_cd, struct simatic_ipc_led, cdev);
>
> One line?

80 columns. It is fine as it is.

Best regards,

Pavel
--
http://www.livejournal.com/~pavelmachek
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-03-15 12:20    [W:0.137 / U:1.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site