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


Groups > linux.kernel > #1542642

[PATCH 5/5] irda: irnet: add member name to the miscdevice declaration

From Corentin Labbe <clabbe.montjoie@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 5/5] irda: irnet: add member name to the miscdevice declaration
Date 2016-12-15 12:10 +0100
Message-ID <sOC5c-52L-13@gated-at.bofh.it> (permalink)
References <sOC5c-52L-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 net/irda/irnet/irnet_ppp.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/irda/irnet/irnet_ppp.h b/net/irda/irnet/irnet_ppp.h
index ec092c9..1ed17f9 100644
--- a/net/irda/irnet/irnet_ppp.h
+++ b/net/irda/irnet/irnet_ppp.h
@@ -108,9 +108,9 @@ static const struct file_operations irnet_device_fops =
 /* Structure so that the misc major (drivers/char/misc.c) take care of us... */
 static struct miscdevice irnet_misc_device =
 {
-	IRNET_MINOR,
-	"irnet",
-	&irnet_device_fops
+	.minor = IRNET_MINOR,
+	.name = "irnet",
+	.file_operations = &irnet_device_fops
 };
 
 #endif /* IRNET_PPP_H */
-- 
2.10.2

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/5] irda: irproc.c: Remove unneeded linux/miscdevice.h include Corentin Labbe <clabbe.montjoie@gmail.com> - 2016-12-15 12:10 +0100
  [PATCH 5/5] irda: irnet: add member name to the miscdevice declaration Corentin Labbe <clabbe.montjoie@gmail.com> - 2016-12-15 12:10 +0100
    Re: [PATCH 5/5] irda: irnet: add member name to the miscdevice  declaration David Miller <davem@davemloft.net> - 2016-12-17 17:20 +0100
  [PATCH 4/5] irda: irnet: Remove unused IRNET_MAJOR define Corentin Labbe <clabbe.montjoie@gmail.com> - 2016-12-15 12:50 +0100
    Re: [PATCH 4/5] irda: irnet: Remove unused IRNET_MAJOR define David Miller <davem@davemloft.net> - 2016-12-17 17:20 +0100
  [PATCH 2/5] irda: irnet: Move linux/miscdevice.h include Corentin Labbe <clabbe.montjoie@gmail.com> - 2016-12-15 13:00 +0100
    Re: [PATCH 2/5] irda: irnet: Move linux/miscdevice.h include David Miller <davem@davemloft.net> - 2016-12-17 17:20 +0100
  Re: [PATCH 1/5] irda: irproc.c: Remove unneeded linux/miscdevice.h  include David Miller <davem@davemloft.net> - 2016-12-17 17:20 +0100

csiph-web