Skip to content

Commit

Permalink
mmtimer: add member name to the miscdevice declaration
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Corentin Labbe authored and Greg Kroah-Hartman committed Jan 10, 2017
1 parent 816c931 commit f17c941
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/char/mmtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f17c941

Please sign in to comment.