From f17c941cbcdccc4fef49a10622ce2ffd2321a143 Mon Sep 17 00:00:00 2001 From: Corentin Labbe Date: Thu, 15 Dec 2016 15:40:33 +0100 Subject: mmtimer: 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 Signed-off-by: Greg Kroah-Hartman --- drivers/char/mmtimer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/char') diff --git a/drivers/char/mmtimer.c b/drivers/char/mmtimer.c index f786b18ac500..b708c85dc9c1 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; -- cgit v1.2.3 From 8681d5b04f812d9cc5cde72bbbb5081f8f1c9728 Mon Sep 17 00:00:00 2001 From: Corentin Labbe Date: Thu, 15 Dec 2016 15:53:23 +0100 Subject: ds1302: remove unneeded linux/miscdevice.h include drivers/char/ds1302.c does not use any miscdevice so the inclusion of linux/miscdevice.h is unnecessary. This patch remove this inclusion. Signed-off-by: Corentin Labbe Signed-off-by: Greg Kroah-Hartman --- drivers/char/ds1302.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/char') diff --git a/drivers/char/ds1302.c b/drivers/char/ds1302.c index 7d34b203718a..c614a56e68cc 100644 --- a/drivers/char/ds1302.c +++ b/drivers/char/ds1302.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include -- cgit v1.2.3 From 874bcd00f520cac297aefade201c4efc07fc8d17 Mon Sep 17 00:00:00 2001 From: Corentin Labbe Date: Thu, 15 Dec 2016 20:36:33 +0100 Subject: apm-emulation: move APM_MINOR_DEV to include/linux/miscdevice.h This patch move the define for APM_MINOR_DEV to include/linux/miscdevice.h It is better that all minor number definitions are in the same place. Signed-off-by: Corentin Labbe Signed-off-by: Greg Kroah-Hartman --- drivers/char/apm-emulation.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'drivers/char') diff --git a/drivers/char/apm-emulation.c b/drivers/char/apm-emulation.c index dd9dfa15e9d1..1dfb9f8de171 100644 --- a/drivers/char/apm-emulation.c +++ b/drivers/char/apm-emulation.c @@ -31,13 +31,6 @@ #include #include - -/* - * The apm_bios device is one of the misc char devices. - * This is its minor number. - */ -#define APM_MINOR_DEV 134 - /* * One option can be changed at boot time as follows: * apm=on/off enable/disable APM -- cgit v1.2.3 From f2cfa58b136e4b06a9b9db7af5ef62fbb5992f62 Mon Sep 17 00:00:00 2001 From: Max Bires Date: Tue, 3 Jan 2017 08:18:07 -0800 Subject: char: lack of bool string made CONFIG_DEVPORT always on Without a bool string present, using "# CONFIG_DEVPORT is not set" in defconfig files would not actually unset devport. This esnured that /dev/port was always on, but there are reasons a user may wish to disable it (smaller kernel, attack surface reduction) if it's not being used. Adding a message here in order to make this user visible. Signed-off-by: Max Bires Acked-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman --- drivers/char/Kconfig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/char') diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index fde005ef9d36..4ee2a10207d0 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig @@ -571,9 +571,12 @@ config TELCLOCK controlling the behavior of this hardware. config DEVPORT - bool + bool "/dev/port character device" depends on ISA || PCI default y + help + Say Y here if you want to support the /dev/port device. The /dev/port + device is similar to /dev/mem, but for I/O ports. source "drivers/s390/char/Kconfig" -- cgit v1.2.3 From 3c84dc7e79f5bd676599a79a6bfed4d30a38ae30 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Mon, 23 Jan 2017 12:53:36 +0100 Subject: char: xilinx_hwicap: Remove pointless local variables Remove unused variables which generates these warnings: [linux-4.10-rc5/drivers/char/xilinx_hwicap/buffer_icap.c:301]: (style) Variable 'num_writes' is modified but its new value is never used. [linux-4.10-rc5/drivers/char/xilinx_hwicap/buffer_icap.c:356]: (style) Variable 'read_count' is modified but its new value is never used. Reported-by: David Binderman Signed-off-by: Michal Simek Signed-off-by: Greg Kroah-Hartman --- drivers/char/xilinx_hwicap/buffer_icap.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'drivers/char') diff --git a/drivers/char/xilinx_hwicap/buffer_icap.c b/drivers/char/xilinx_hwicap/buffer_icap.c index 53c3882e4981..35981cae1afa 100644 --- a/drivers/char/xilinx_hwicap/buffer_icap.c +++ b/drivers/char/xilinx_hwicap/buffer_icap.c @@ -269,7 +269,6 @@ int buffer_icap_set_configuration(struct hwicap_drvdata *drvdata, u32 *data, { int status; s32 buffer_count = 0; - s32 num_writes = 0; bool dirty = false; u32 i; void __iomem *base_address = drvdata->base_address; @@ -298,7 +297,6 @@ int buffer_icap_set_configuration(struct hwicap_drvdata *drvdata, u32 *data, } buffer_count = 0; - num_writes++; dirty = false; } @@ -328,7 +326,6 @@ int buffer_icap_get_configuration(struct hwicap_drvdata *drvdata, u32 *data, { int status; s32 buffer_count = 0; - s32 read_count = 0; u32 i; void __iomem *base_address = drvdata->base_address; @@ -353,7 +350,6 @@ int buffer_icap_get_configuration(struct hwicap_drvdata *drvdata, u32 *data, } buffer_count = 0; - read_count++; } /* Copy data from bram */ -- cgit v1.2.3