All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmtimer: add member name to the miscdevice declaration
@ 2016-12-15 14:40 Corentin Labbe
  0 siblings, 0 replies; only message in thread
From: Corentin Labbe @ 2016-12-15 14:40 UTC (permalink / raw)
  To: arnd, gregkh; +Cc: linux-kernel, Corentin Labbe

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-12-15 14:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-15 14:40 [PATCH] mmtimer: add member name to the miscdevice declaration Corentin Labbe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.