Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758217AbcLOOne (ORCPT ); Thu, 15 Dec 2016 09:43:34 -0500 Received: from mail-wj0-f194.google.com ([209.85.210.194]:36075 "EHLO mail-wj0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753378AbcLOOnc (ORCPT ); Thu, 15 Dec 2016 09:43:32 -0500 From: Corentin Labbe To: arnd@arndb.de, gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Corentin Labbe Subject: [PATCH] mmtimer: add member name to the miscdevice declaration Date: Thu, 15 Dec 2016 15:40:33 +0100 Message-Id: <20161215144033.19444-1-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.10.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 795 Lines: 29 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 --- 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