Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1542787 > unrolled thread

[PATCH] mmtimer: add member name to the miscdevice declaration

Started byCorentin Labbe <clabbe.montjoie@gmail.com>
First post2016-12-15 15:50 +0100
Last post2016-12-15 15:50 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] mmtimer: add member name to the miscdevice declaration Corentin Labbe <clabbe.montjoie@gmail.com> - 2016-12-15 15:50 +0100

#1542787 — [PATCH] mmtimer: add member name to the miscdevice declaration

FromCorentin Labbe <clabbe.montjoie@gmail.com>
Date2016-12-15 15:50 +0100
Subject[PATCH] mmtimer: add member name to the miscdevice declaration
Message-ID<sOFw5-6Xv-7@gated-at.bofh.it>
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>
---
 drivers/char/mmtimer.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/char/mmtimer.c b/drivers/char/mmtimer.c
index 3d6c067..09a2746 100644
--- a/drivers/char/mmtimer.c
+++ b/drivers/char/mmtimer.c
@@ -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;
-- 
2.10.2

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web