2016-12-15 11:02:44

by Corentin Labbe

[permalink] [raw]
Subject: [PATCH 1/5] irda: irproc.c: Remove unneeded linux/miscdevice.h include

irproc.c does not use any miscdevice so this patch remove this
unnecessary inclusion.

Signed-off-by: Corentin Labbe <[email protected]>
---
net/irda/irproc.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/net/irda/irproc.c b/net/irda/irproc.c
index b9ac598..77cfdde 100644
--- a/net/irda/irproc.c
+++ b/net/irda/irproc.c
@@ -23,7 +23,6 @@
*
********************************************************************/

-#include <linux/miscdevice.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/module.h>
--
2.10.2


2016-12-15 11:03:01

by Corentin Labbe

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

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 <[email protected]>
---
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

2016-12-15 11:02:55

by Corentin Labbe

[permalink] [raw]
Subject: [PATCH 3/5] irnet: ppp: move IRNET_MINOR to include/linux/miscdevice.h

This patch move the define for IRNET_MINOR to include/linux/miscdevice.h
It is better that all minor number definitions are in the same place.

Signed-off-by: Corentin Labbe <[email protected]>
---
include/linux/miscdevice.h | 1 +
net/irda/irnet/irnet_ppp.h | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index 18b2e3b..5ea0a65 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -37,6 +37,7 @@
#define HWRNG_MINOR 183
#define MICROCODE_MINOR 184
#define KEYPAD_MINOR 185
+#define IRNET_MINOR 187
#define D7S_MINOR 193
#define VFIO_MINOR 196
#define TUN_MINOR 200
diff --git a/net/irda/irnet/irnet_ppp.h b/net/irda/irnet/irnet_ppp.h
index 693ebc0..18fcead 100644
--- a/net/irda/irnet/irnet_ppp.h
+++ b/net/irda/irnet/irnet_ppp.h
@@ -21,7 +21,6 @@

/* /dev/irnet file constants */
#define IRNET_MAJOR 10 /* Misc range */
-#define IRNET_MINOR 187 /* Official allocation */

/* IrNET control channel stuff */
#define IRNET_MAX_COMMAND 256 /* Max length of a command line */
--
2.10.2

2016-12-15 11:43:01

by Corentin Labbe

[permalink] [raw]
Subject: [PATCH 4/5] irda: irnet: Remove unused IRNET_MAJOR define

The IRNET_MAJOR define is not used, so this patch remove it.

Signed-off-by: Corentin Labbe <[email protected]>
---
net/irda/irnet/irnet_ppp.h | 3 ---
1 file changed, 3 deletions(-)

diff --git a/net/irda/irnet/irnet_ppp.h b/net/irda/irnet/irnet_ppp.h
index 18fcead..ec092c9 100644
--- a/net/irda/irnet/irnet_ppp.h
+++ b/net/irda/irnet/irnet_ppp.h
@@ -19,9 +19,6 @@

/************************ CONSTANTS & MACROS ************************/

-/* /dev/irnet file constants */
-#define IRNET_MAJOR 10 /* Misc range */
-
/* IrNET control channel stuff */
#define IRNET_MAX_COMMAND 256 /* Max length of a command line */

--
2.10.2

2016-12-15 11:53:57

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 3/5] irnet: ppp: move IRNET_MINOR to include/linux/miscdevice.h

On Thu, Dec 15, 2016 at 11:42:48AM +0100, Corentin Labbe wrote:
> This patch move the define for IRNET_MINOR to include/linux/miscdevice.h
> It is better that all minor number definitions are in the same place.
>
> Signed-off-by: Corentin Labbe <[email protected]>
> ---
> include/linux/miscdevice.h | 1 +
> net/irda/irnet/irnet_ppp.h | 1 -
> 2 files changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
> index 18b2e3b..5ea0a65 100644
> --- a/include/linux/miscdevice.h
> +++ b/include/linux/miscdevice.h
> @@ -37,6 +37,7 @@
> #define HWRNG_MINOR 183
> #define MICROCODE_MINOR 184
> #define KEYPAD_MINOR 185
> +#define IRNET_MINOR 187
> #define D7S_MINOR 193
> #define VFIO_MINOR 196
> #define TUN_MINOR 200
> diff --git a/net/irda/irnet/irnet_ppp.h b/net/irda/irnet/irnet_ppp.h
> index 693ebc0..18fcead 100644
> --- a/net/irda/irnet/irnet_ppp.h
> +++ b/net/irda/irnet/irnet_ppp.h
> @@ -21,7 +21,6 @@
>
> /* /dev/irnet file constants */
> #define IRNET_MAJOR 10 /* Misc range */
> -#define IRNET_MINOR 187 /* Official allocation */
>
> /* IrNET control channel stuff */
> #define IRNET_MAX_COMMAND 256 /* Max length of a command line */
> --
> 2.10.2

Acked-by: Greg Kroah-Hartman <[email protected]>

2016-12-15 11:54:45

by Corentin Labbe

[permalink] [raw]
Subject: [PATCH 2/5] irda: irnet: Move linux/miscdevice.h include

The only use of miscdevice is irda_ppp so no need to include
linux/miscdevice.h for all irda files.
This patch move the linux/miscdevice.h include to irnet_ppp.h

Signed-off-by: Corentin Labbe <[email protected]>
---
net/irda/irnet/irnet.h | 1 -
net/irda/irnet/irnet_ppp.h | 1 +
2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/irda/irnet/irnet.h b/net/irda/irnet/irnet.h
index 8d65bb9..c69f0f3 100644
--- a/net/irda/irnet/irnet.h
+++ b/net/irda/irnet/irnet.h
@@ -245,7 +245,6 @@
#include <linux/tty.h>
#include <linux/proc_fs.h>
#include <linux/netdevice.h>
-#include <linux/miscdevice.h>
#include <linux/poll.h>
#include <linux/capability.h>
#include <linux/ctype.h> /* isspace() */
diff --git a/net/irda/irnet/irnet_ppp.h b/net/irda/irnet/irnet_ppp.h
index 9402258..693ebc0 100644
--- a/net/irda/irnet/irnet_ppp.h
+++ b/net/irda/irnet/irnet_ppp.h
@@ -15,6 +15,7 @@
/***************************** INCLUDES *****************************/

#include "irnet.h" /* Module global include */
+#include <linux/miscdevice.h>

/************************ CONSTANTS & MACROS ************************/

--
2.10.2

2016-12-17 16:18:12

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 1/5] irda: irproc.c: Remove unneeded linux/miscdevice.h include

From: Corentin Labbe <[email protected]>
Date: Thu, 15 Dec 2016 11:42:46 +0100

> irproc.c does not use any miscdevice so this patch remove this
> unnecessary inclusion.
>
> Signed-off-by: Corentin Labbe <[email protected]>

Applied.

2016-12-17 16:18:18

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 2/5] irda: irnet: Move linux/miscdevice.h include

From: Corentin Labbe <[email protected]>
Date: Thu, 15 Dec 2016 11:42:47 +0100

> The only use of miscdevice is irda_ppp so no need to include
> linux/miscdevice.h for all irda files.
> This patch move the linux/miscdevice.h include to irnet_ppp.h
>
> Signed-off-by: Corentin Labbe <[email protected]>

Applied.

2016-12-17 16:18:23

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 3/5] irnet: ppp: move IRNET_MINOR to include/linux/miscdevice.h

From: Corentin Labbe <[email protected]>
Date: Thu, 15 Dec 2016 11:42:48 +0100

> This patch move the define for IRNET_MINOR to include/linux/miscdevice.h
> It is better that all minor number definitions are in the same place.
>
> Signed-off-by: Corentin Labbe <[email protected]>

Applied.

2016-12-17 16:18:36

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 5/5] irda: irnet: add member name to the miscdevice declaration

From: Corentin Labbe <[email protected]>
Date: Thu, 15 Dec 2016 11:42:50 +0100

> 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 <[email protected]>

Applied.

2016-12-17 16:18:29

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 4/5] irda: irnet: Remove unused IRNET_MAJOR define

From: Corentin Labbe <[email protected]>
Date: Thu, 15 Dec 2016 11:42:49 +0100

> The IRNET_MAJOR define is not used, so this patch remove it.
>
> Signed-off-by: Corentin Labbe <[email protected]>

Applied.