mmtimer: add member name to the miscdevice declaration
authorCorentin Labbe <clabbe.montjoie@gmail.com>
Thu, 15 Dec 2016 14:40:33 +0000 (15:40 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Jan 2017 20:46:41 +0000 (21:46 +0100)
Since the struct miscdevice have many members, it is dangerous to init
it without members name relying only on member order.

This patch add member name to the init declaration.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/mmtimer.c

index f786b18..b708c85 100644 (file)
@@ -463,9 +463,9 @@ static int mmtimer_mmap(struct file *file, struct vm_area_struct *vma)
 }
 
 static struct miscdevice mmtimer_miscdev = {
-       SGI_MMTIMER,
-       MMTIMER_NAME,
-       &mmtimer_fops
+       .minor = SGI_MMTIMER,
+       .name = MMTIMER_NAME,
+       .fops = &mmtimer_fops
 };
 
 static struct timespec sgi_clock_offset;