From: Sreenath Vijayan
> Sent: 17 January 2024 11:14
...
> /* Key Operations table and lock */
> static DEFINE_SPINLOCK(sysrq_key_table_lock);
>
> @@ -505,7 +523,7 @@ static const struct sysrq_key_op *sysrq_key_table[62] = {
> NULL, /* A */
> NULL, /* B */
> NULL, /* C */
> - NULL, /* D */
> + &sysrq_dmesg_dump_op, /* D */
> NULL, /* E */
> NULL, /* F */
> NULL, /* G */
That looks like it ought to use C99 initialisers:
['D' - 'A'] = &sysrq_dmesg_dump_op,
Possible with a #define to hide the offset.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
On Thu, Jan 18, 2024 at 10:56:59PM +0000, David Laight wrote:
> From: Sreenath Vijayan
> > Sent: 17 January 2024 11:14
> ....
> > /* Key Operations table and lock */
> > static DEFINE_SPINLOCK(sysrq_key_table_lock);
> >
> > @@ -505,7 +523,7 @@ static const struct sysrq_key_op *sysrq_key_table[62] = {
> > NULL, /* A */
> > NULL, /* B */
> > NULL, /* C */
> > - NULL, /* D */
> > + &sysrq_dmesg_dump_op, /* D */
> > NULL, /* E */
> > NULL, /* F */
> > NULL, /* G */
>
> That looks like it ought to use C99 initialisers:
> ['D' - 'A'] = &sysrq_dmesg_dump_op,
>
> Possible with a #define to hide the offset.
Maybe in the future, but for now, let's leave it as-is please.
thanks,
greg k-h