Skip to contentSkip to conversation

mmtimer: add member name to the miscdevice declaration

PATCH New Corentin Labbe 1 participant 1 message Dec 15, 2016 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmtimer: add member name to the miscdevice declaration

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.

---
 drivers/char/mmtimer.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/char/mmtimer.c +3 -3
index 3d6c067..09a2746 100644
@@ -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;
Signature · 1 line
2.10.2