* [PATCH] move memory_read_from_buffer() from fs.h to string.h
[not found] ` <1215182555.5413.8.camel@localhost.localdomain>
@ 2008-07-04 16:39 ` Akinobu Mita
2008-07-04 16:48 ` [PATCH -mm] fix s390-use-memory_read_from_buffer.patch Akinobu Mita
` (7 more replies)
0 siblings, 8 replies; 11+ messages in thread
From: Akinobu Mita @ 2008-07-04 16:39 UTC (permalink / raw)
To: James Bottomley
Cc: akpm, linux-scsi, andrew.vasquez, linux-driver, seokmann.ju,
linux-kernel
On Fri, Jul 04, 2008 at 09:42:35AM -0500, James Bottomley wrote:
> For such a micro optimisation, this is a pretty big price to pay.
>
> Inclusion of linux/fs.h in a low level driver was always a danger signal
> usually it meant the driver was trying to access files or something at
> the very least it was a warning of a potential layering violation. Now
> you're trying to make it standard practice ... I really don't like that.
> Surely a function that does memory to memory copies belongs either in
> string.h with the rest of our memory copies ... or in another header
> that would be a usual include for the potential users.
OK, I'll move it to linux/string.h
From: Akinobu Mita <akinobu.mita@gmail.com>
Subject: [PATCH] move memory_read_from_buffer() from fs.h to string.h
James Bottomley warns that inclusion of linux/fs.h in a low level driver
was always a danger signal. This patch moves memory_read_from_buffer()
from fs.h to string.h and fixes includes in existing memory_read_from_buffer()
users.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: James Bottomley <James.Bottomley@hansenpartnership.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Bob Moore <robert.moore@intel.com>
Cc: Thomas Renninger <trenn@suse.de>
Cc: Len Brown <lenb@kernel.org>
---
drivers/acpi/system.c | 1 +
drivers/zorro/zorro-sysfs.c | 1 -
include/linux/fs.h | 2 --
include/linux/string.h | 3 +++
4 files changed, 4 insertions(+), 3 deletions(-)
Index: 2.6-mm/include/linux/fs.h
===================================================================
--- 2.6-mm.orig/include/linux/fs.h
+++ 2.6-mm/include/linux/fs.h
@@ -2026,8 +2026,6 @@ extern void simple_release_fs(struct vfs
extern ssize_t simple_read_from_buffer(void __user *to, size_t count,
loff_t *ppos, const void *from, size_t available);
-extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
- const void *from, size_t available);
#ifdef CONFIG_MIGRATION
extern int buffer_migrate_page(struct address_space *,
Index: 2.6-mm/include/linux/string.h
===================================================================
--- 2.6-mm.orig/include/linux/string.h
+++ 2.6-mm/include/linux/string.h
@@ -111,5 +111,8 @@ extern void argv_free(char **argv);
extern bool sysfs_streq(const char *s1, const char *s2);
+extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
+ const void *from, size_t available);
+
#endif
#endif /* _LINUX_STRING_H_ */
Index: 2.6-mm/drivers/acpi/system.c
===================================================================
--- 2.6-mm.orig/drivers/acpi/system.c
+++ 2.6-mm/drivers/acpi/system.c
@@ -26,6 +26,7 @@
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/init.h>
+#include <linux/string.h>
#include <asm/uaccess.h>
#include <acpi/acpi_drivers.h>
Index: 2.6-mm/drivers/zorro/zorro-sysfs.c
===================================================================
--- 2.6-mm.orig/drivers/zorro/zorro-sysfs.c
+++ 2.6-mm/drivers/zorro/zorro-sysfs.c
@@ -15,7 +15,6 @@
#include <linux/zorro.h>
#include <linux/stat.h>
#include <linux/string.h>
-#include <linux/fs.h>
#include "zorro.h"
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH -mm] fix s390-use-memory_read_from_buffer.patch
2008-07-04 16:39 ` [PATCH] move memory_read_from_buffer() from fs.h to string.h Akinobu Mita
@ 2008-07-04 16:48 ` Akinobu Mita
2008-07-04 16:51 ` [PATCH -mm] fix s390-cio-use-memory_read_from_buffer.patch Akinobu Mita
` (6 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Akinobu Mita @ 2008-07-04 16:48 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, Martin Schwidefsky, Heiko Carstens, Michael Holzheu
Now memory_read_from_buffer() belongs in string.h
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Michael Holzheu <holzheu@de.ibm.com>
---
arch/s390/kernel/ipl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: 2.6-mm/arch/s390/kernel/ipl.c
===================================================================
--- 2.6-mm.orig/arch/s390/kernel/ipl.c
+++ 2.6-mm/arch/s390/kernel/ipl.c
@@ -14,7 +14,7 @@
#include <linux/delay.h>
#include <linux/reboot.h>
#include <linux/ctype.h>
-#include <linux/fs.h>
+#include <linux/string.h>
#include <asm/ipl.h>
#include <asm/smp.h>
#include <asm/setup.h>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH -mm] fix s390-cio-use-memory_read_from_buffer.patch
2008-07-04 16:39 ` [PATCH] move memory_read_from_buffer() from fs.h to string.h Akinobu Mita
2008-07-04 16:48 ` [PATCH -mm] fix s390-use-memory_read_from_buffer.patch Akinobu Mita
@ 2008-07-04 16:51 ` Akinobu Mita
2008-07-04 16:53 ` [PATCH -mm] fix qla2xxx-use-memory_read_from_buffer.patch Akinobu Mita
` (5 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Akinobu Mita @ 2008-07-04 16:51 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, Martin Schwidefsky, Heiko Carstens,
Peter Oberparleiter
Now memory_read_from_buffer() belongs in string.h
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
---
drivers/s390/cio/chp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: 2.6-mm/drivers/s390/cio/chp.c
===================================================================
--- 2.6-mm.orig/drivers/s390/cio/chp.c
+++ 2.6-mm/drivers/s390/cio/chp.c
@@ -15,7 +15,7 @@
#include <linux/wait.h>
#include <linux/mutex.h>
#include <linux/errno.h>
-#include <linux/fs.h>
+#include <linux/string.h>
#include <asm/chpid.h>
#include <asm/sclp.h>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH -mm] fix qla2xxx-use-memory_read_from_buffer.patch
2008-07-04 16:39 ` [PATCH] move memory_read_from_buffer() from fs.h to string.h Akinobu Mita
2008-07-04 16:48 ` [PATCH -mm] fix s390-use-memory_read_from_buffer.patch Akinobu Mita
2008-07-04 16:51 ` [PATCH -mm] fix s390-cio-use-memory_read_from_buffer.patch Akinobu Mita
@ 2008-07-04 16:53 ` Akinobu Mita
2008-07-04 16:54 ` [PATCH -mm] fix ipr-use-memory_read_from_buffer.patch Akinobu Mita
` (4 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Akinobu Mita @ 2008-07-04 16:53 UTC (permalink / raw)
To: akpm
Cc: linux-kernel, Andrew Vasquez, James E.J. Bottomley,
Andrew Vasquez, Seokmann Ju
Now memory_read_from_buffer() belongs in string.h
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Andrew Vasquez <linux-driver@qlogic.com>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
Cc: Seokmann Ju <seokmann.ju@qlogic.com>
---
drivers/scsi/qla2xxx/qla_attr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: 2.6-mm/drivers/scsi/qla2xxx/qla_attr.c
===================================================================
--- 2.6-mm.orig/drivers/scsi/qla2xxx/qla_attr.c
+++ 2.6-mm/drivers/scsi/qla2xxx/qla_attr.c
@@ -8,7 +8,7 @@
#include <linux/kthread.h>
#include <linux/vmalloc.h>
-#include <linux/fs.h>
+#include <linux/string.h>
static int qla24xx_vport_disable(struct fc_vport *, bool);
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH -mm] fix ipr-use-memory_read_from_buffer.patch
2008-07-04 16:39 ` [PATCH] move memory_read_from_buffer() from fs.h to string.h Akinobu Mita
` (2 preceding siblings ...)
2008-07-04 16:53 ` [PATCH -mm] fix qla2xxx-use-memory_read_from_buffer.patch Akinobu Mita
@ 2008-07-04 16:54 ` Akinobu Mita
2008-07-04 17:05 ` James Bottomley
2008-07-04 16:55 ` [PATCH -mm] fix dcdbas-use-memory_read_from_buffer.patch Akinobu Mita
` (3 subsequent siblings)
7 siblings, 1 reply; 11+ messages in thread
From: Akinobu Mita @ 2008-07-04 16:54 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, Brian King, James E.J. Bottomley
Now memory_read_from_buffer() belongs in string.h
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Brian King <brking@us.ibm.com>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
---
drivers/scsi/ipr.c | 1 +
1 file changed, 1 insertion(+)
Index: 2.6-mm/drivers/scsi/ipr.c
===================================================================
--- 2.6-mm.orig/drivers/scsi/ipr.c
+++ 2.6-mm/drivers/scsi/ipr.c
@@ -71,6 +71,7 @@
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/libata.h>
+#include <linux/string.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/processor.h>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH -mm] fix dcdbas-use-memory_read_from_buffer.patch
2008-07-04 16:39 ` [PATCH] move memory_read_from_buffer() from fs.h to string.h Akinobu Mita
` (3 preceding siblings ...)
2008-07-04 16:54 ` [PATCH -mm] fix ipr-use-memory_read_from_buffer.patch Akinobu Mita
@ 2008-07-04 16:55 ` Akinobu Mita
2008-07-04 16:57 ` [PATCH -mm] fix aty-use-memory_read_from_buffer.patch Akinobu Mita
` (2 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Akinobu Mita @ 2008-07-04 16:55 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, Doug Warzecha, Zhang Rui, Matt Domsch
Now memory_read_from_buffer() belongs in string.h
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Doug Warzecha <Douglas_Warzecha@dell.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Matt Domsch <Matt_Domsch@dell.com>
---
drivers/firmware/dcdbas.c | 1 -
1 file changed, 1 deletion(-)
Index: 2.6-mm/drivers/firmware/dcdbas.c
===================================================================
--- 2.6-mm.orig/drivers/firmware/dcdbas.c
+++ 2.6-mm/drivers/firmware/dcdbas.c
@@ -34,7 +34,6 @@
#include <linux/string.h>
#include <linux/types.h>
#include <linux/mutex.h>
-#include <linux/fs.h>
#include <asm/io.h>
#include "dcdbas.h"
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH -mm] fix aty-use-memory_read_from_buffer.patch
2008-07-04 16:39 ` [PATCH] move memory_read_from_buffer() from fs.h to string.h Akinobu Mita
` (4 preceding siblings ...)
2008-07-04 16:55 ` [PATCH -mm] fix dcdbas-use-memory_read_from_buffer.patch Akinobu Mita
@ 2008-07-04 16:57 ` Akinobu Mita
2008-07-04 16:58 ` [PATCH -mm] fix firmware-use-memory_read_from_buffer.patch Akinobu Mita
2008-07-04 17:00 ` [PATCH -mm] fix dell_rbu-use-memory_read_from_buffer.patch Akinobu Mita
7 siblings, 0 replies; 11+ messages in thread
From: Akinobu Mita @ 2008-07-04 16:57 UTC (permalink / raw)
To: akpm
Cc: linux-kernel, Benjamin Herrenschmidt, Antonino A. Daplas,
Krzysztof Helt
Now memory_read_from_buffer() belongs in string.h
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
---
drivers/video/aty/radeon_base.c | 1 -
1 file changed, 1 deletion(-)
Index: 2.6-mm/drivers/video/aty/radeon_base.c
===================================================================
--- 2.6-mm.orig/drivers/video/aty/radeon_base.c
+++ 2.6-mm/drivers/video/aty/radeon_base.c
@@ -70,7 +70,6 @@
#include <linux/pci.h>
#include <linux/vmalloc.h>
#include <linux/device.h>
-#include <linux/fs.h>
#include <asm/io.h>
#include <linux/uaccess.h>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH -mm] fix firmware-use-memory_read_from_buffer.patch
2008-07-04 16:39 ` [PATCH] move memory_read_from_buffer() from fs.h to string.h Akinobu Mita
` (5 preceding siblings ...)
2008-07-04 16:57 ` [PATCH -mm] fix aty-use-memory_read_from_buffer.patch Akinobu Mita
@ 2008-07-04 16:58 ` Akinobu Mita
2008-07-04 17:00 ` [PATCH -mm] fix dell_rbu-use-memory_read_from_buffer.patch Akinobu Mita
7 siblings, 0 replies; 11+ messages in thread
From: Akinobu Mita @ 2008-07-04 16:58 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, Greg Kroah-Hartman, Markus Rechberger, Kay Sievers
Now memory_read_from_buffer() belongs in string.h
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Markus Rechberger <markus.rechberger@amd.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
---
drivers/base/firmware_class.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: 2.6-mm/drivers/base/firmware_class.c
===================================================================
--- 2.6-mm.orig/drivers/base/firmware_class.c
+++ 2.6-mm/drivers/base/firmware_class.c
@@ -17,7 +17,7 @@
#include <linux/bitops.h>
#include <linux/mutex.h>
#include <linux/kthread.h>
-#include <linux/fs.h>
+#include <linux/string.h>
#include <linux/firmware.h>
#include "base.h"
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH -mm] fix dell_rbu-use-memory_read_from_buffer.patch
2008-07-04 16:39 ` [PATCH] move memory_read_from_buffer() from fs.h to string.h Akinobu Mita
` (6 preceding siblings ...)
2008-07-04 16:58 ` [PATCH -mm] fix firmware-use-memory_read_from_buffer.patch Akinobu Mita
@ 2008-07-04 17:00 ` Akinobu Mita
7 siblings, 0 replies; 11+ messages in thread
From: Akinobu Mita @ 2008-07-04 17:00 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, Abhay Salunke, Zhang Rui, Matt Domsch
Now memory_read_from_buffer() belongs in string.h
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Abhay Salunke <Abhay_Salunke@dell.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Matt Domsch <Matt_Domsch@dell.com>
---
drivers/firmware/dell_rbu.c | 1 -
1 file changed, 1 deletion(-)
Index: 2.6-mm/drivers/firmware/dell_rbu.c
===================================================================
--- 2.6-mm.orig/drivers/firmware/dell_rbu.c
+++ 2.6-mm/drivers/firmware/dell_rbu.c
@@ -44,7 +44,6 @@
#include <linux/moduleparam.h>
#include <linux/firmware.h>
#include <linux/dma-mapping.h>
-#include <linux/fs.h>
MODULE_AUTHOR("Abhay Salunke <abhay_salunke@dell.com>");
MODULE_DESCRIPTION("Driver for updating BIOS image on DELL systems");
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH -mm] fix ipr-use-memory_read_from_buffer.patch
2008-07-04 16:54 ` [PATCH -mm] fix ipr-use-memory_read_from_buffer.patch Akinobu Mita
@ 2008-07-04 17:05 ` James Bottomley
2008-07-04 17:18 ` Akinobu Mita
0 siblings, 1 reply; 11+ messages in thread
From: James Bottomley @ 2008-07-04 17:05 UTC (permalink / raw)
To: Akinobu Mita; +Cc: akpm, linux-kernel, Brian King
On Sat, 2008-07-05 at 01:54 +0900, Akinobu Mita wrote:
> Now memory_read_from_buffer() belongs in string.h
>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Brian King <brking@us.ibm.com>
> Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
> ---
> drivers/scsi/ipr.c | 1 +
> 1 file changed, 1 insertion(+)
>
> Index: 2.6-mm/drivers/scsi/ipr.c
> ===================================================================
> --- 2.6-mm.orig/drivers/scsi/ipr.c
> +++ 2.6-mm/drivers/scsi/ipr.c
> @@ -71,6 +71,7 @@
> #include <linux/module.h>
> #include <linux/moduleparam.h>
> #include <linux/libata.h>
> +#include <linux/string.h>
> #include <asm/io.h>
> #include <asm/irq.h>
> #include <asm/processor.h>
This isn't really necessary, is it? As you can see from the file being
stuffed full of memcpy directives, it's already getting an implicit
include of string.h from somewhere (like the rest of the SCSI drivers).
James
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH -mm] fix ipr-use-memory_read_from_buffer.patch
2008-07-04 17:05 ` James Bottomley
@ 2008-07-04 17:18 ` Akinobu Mita
0 siblings, 0 replies; 11+ messages in thread
From: Akinobu Mita @ 2008-07-04 17:18 UTC (permalink / raw)
To: James Bottomley; +Cc: akpm, linux-kernel, Brian King
>> --- 2.6-mm.orig/drivers/scsi/ipr.c
>> +++ 2.6-mm/drivers/scsi/ipr.c
>> @@ -71,6 +71,7 @@
>> #include <linux/module.h>
>> #include <linux/moduleparam.h>
>> #include <linux/libata.h>
>> +#include <linux/string.h>
>> #include <asm/io.h>
>> #include <asm/irq.h>
>> #include <asm/processor.h>
>
> This isn't really necessary, is it? As you can see from the file being
> stuffed full of memcpy directives, it's already getting an implicit
> include of string.h from somewhere (like the rest of the SCSI drivers).
Indeed. This is not necessary.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2008-07-04 17:18 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200807040647.m646lXpN017508@imap1.linux-foundation.org>
[not found] ` <1215182555.5413.8.camel@localhost.localdomain>
2008-07-04 16:39 ` [PATCH] move memory_read_from_buffer() from fs.h to string.h Akinobu Mita
2008-07-04 16:48 ` [PATCH -mm] fix s390-use-memory_read_from_buffer.patch Akinobu Mita
2008-07-04 16:51 ` [PATCH -mm] fix s390-cio-use-memory_read_from_buffer.patch Akinobu Mita
2008-07-04 16:53 ` [PATCH -mm] fix qla2xxx-use-memory_read_from_buffer.patch Akinobu Mita
2008-07-04 16:54 ` [PATCH -mm] fix ipr-use-memory_read_from_buffer.patch Akinobu Mita
2008-07-04 17:05 ` James Bottomley
2008-07-04 17:18 ` Akinobu Mita
2008-07-04 16:55 ` [PATCH -mm] fix dcdbas-use-memory_read_from_buffer.patch Akinobu Mita
2008-07-04 16:57 ` [PATCH -mm] fix aty-use-memory_read_from_buffer.patch Akinobu Mita
2008-07-04 16:58 ` [PATCH -mm] fix firmware-use-memory_read_from_buffer.patch Akinobu Mita
2008-07-04 17:00 ` [PATCH -mm] fix dell_rbu-use-memory_read_from_buffer.patch Akinobu Mita
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox