[PATCH] [IPMI] remove unused target and action in Makefile

2008-02-26 Thread Denis Cheng
Kbuild system handle this automatically.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 drivers/char/ipmi/Makefile |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/drivers/char/ipmi/Makefile b/drivers/char/ipmi/Makefile
index 553f0a4..eb8a1a8 100644
--- a/drivers/char/ipmi/Makefile
+++ b/drivers/char/ipmi/Makefile
@@ -9,7 +9,3 @@ obj-$(CONFIG_IPMI_DEVICE_INTERFACE) += ipmi_devintf.o
 obj-$(CONFIG_IPMI_SI) += ipmi_si.o
 obj-$(CONFIG_IPMI_WATCHDOG) += ipmi_watchdog.o
 obj-$(CONFIG_IPMI_POWEROFF) += ipmi_poweroff.o
-
-ipmi_si.o: $(ipmi_si-objs)
-   $(LD) -r -o $@ $(ipmi_si-objs)
-
-- 
1.5.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] [IPMI] remove unused target and action in Makefile

2008-02-26 Thread Denis Cheng
Kbuild system handle this automatically.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 drivers/char/ipmi/Makefile |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/drivers/char/ipmi/Makefile b/drivers/char/ipmi/Makefile
index 553f0a4..eb8a1a8 100644
--- a/drivers/char/ipmi/Makefile
+++ b/drivers/char/ipmi/Makefile
@@ -9,7 +9,3 @@ obj-$(CONFIG_IPMI_DEVICE_INTERFACE) += ipmi_devintf.o
 obj-$(CONFIG_IPMI_SI) += ipmi_si.o
 obj-$(CONFIG_IPMI_WATCHDOG) += ipmi_watchdog.o
 obj-$(CONFIG_IPMI_POWEROFF) += ipmi_poweroff.o
-
-ipmi_si.o: $(ipmi_si-objs)
-   $(LD) -r -o $@ $(ipmi_si-objs)
-
-- 
1.5.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] [GFS2] re-support special inode

2008-02-25 Thread Denis Cheng
commit feaa7bba026c181ce071d5a4884f7f9dd26207a1 removed call to
init_special_inode from inode lookuping, this cause problems as:

 # mknod /mnt/gfs2/dev/null c 1 3
 # cat /mnt/gfs2/dev/null
 cat: /mnt/gfs2/dev/null: Invalid argument

without special inode, GFS2 cannot support char device file,
block device file, fifo pipe, and socket file, lose many important
features as a common file system.

this one line patch re add special inode support.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 fs/gfs2/inode.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 1069ceb..18d8e0b 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -150,6 +150,7 @@ void gfs2_set_iop(struct inode *inode)
inode->i_op = _symlink_iops;
} else {
inode->i_op = _file_iops;
+   init_special_inode(inode, inode->i_mode, inode->i_rdev);
}
 
unlock_new_inode(inode);
-- 
1.5.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] [GFS2] remove gfs2_dev_iops

2008-02-25 Thread Denis Cheng
struct inode_operations gfs2_dev_iops is always the same as gfs2_file_iops,
since Jan 2006, when GFS2 merged into mainstream kernel.

So one of them could be removed.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 fs/gfs2/inode.c |2 +-
 fs/gfs2/ops_inode.c |   10 --
 fs/gfs2/ops_inode.h |1 -
 3 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 37725ad..1069ceb 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -149,7 +149,7 @@ void gfs2_set_iop(struct inode *inode)
} else if (S_ISLNK(mode)) {
inode->i_op = _symlink_iops;
} else {
-   inode->i_op = _dev_iops;
+   inode->i_op = _file_iops;
}
 
unlock_new_inode(inode);
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c
index e874129..ab9a073 100644
--- a/fs/gfs2/ops_inode.c
+++ b/fs/gfs2/ops_inode.c
@@ -1148,16 +1148,6 @@ const struct inode_operations gfs2_file_iops = {
.removexattr = gfs2_removexattr,
 };
 
-const struct inode_operations gfs2_dev_iops = {
-   .permission = gfs2_permission,
-   .setattr = gfs2_setattr,
-   .getattr = gfs2_getattr,
-   .setxattr = gfs2_setxattr,
-   .getxattr = gfs2_getxattr,
-   .listxattr = gfs2_listxattr,
-   .removexattr = gfs2_removexattr,
-};
-
 const struct inode_operations gfs2_dir_iops = {
.create = gfs2_create,
.lookup = gfs2_lookup,
diff --git a/fs/gfs2/ops_inode.h b/fs/gfs2/ops_inode.h
index fd8cee2..14b4b79 100644
--- a/fs/gfs2/ops_inode.h
+++ b/fs/gfs2/ops_inode.h
@@ -15,7 +15,6 @@
 extern const struct inode_operations gfs2_file_iops;
 extern const struct inode_operations gfs2_dir_iops;
 extern const struct inode_operations gfs2_symlink_iops;
-extern const struct inode_operations gfs2_dev_iops;
 extern const struct file_operations gfs2_file_fops;
 extern const struct file_operations gfs2_dir_fops;
 extern const struct file_operations gfs2_file_fops_nolock;
-- 
1.5.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] [GFS2] remove gfs2_dev_iops

2008-02-25 Thread Denis Cheng
struct inode_operations gfs2_dev_iops is always the same as gfs2_file_iops,
since Jan 2006, when GFS2 merged into mainstream kernel.

So one of them could be removed.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 fs/gfs2/inode.c |2 +-
 fs/gfs2/ops_inode.c |   10 --
 fs/gfs2/ops_inode.h |1 -
 3 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 37725ad..1069ceb 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -149,7 +149,7 @@ void gfs2_set_iop(struct inode *inode)
} else if (S_ISLNK(mode)) {
inode-i_op = gfs2_symlink_iops;
} else {
-   inode-i_op = gfs2_dev_iops;
+   inode-i_op = gfs2_file_iops;
}
 
unlock_new_inode(inode);
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c
index e874129..ab9a073 100644
--- a/fs/gfs2/ops_inode.c
+++ b/fs/gfs2/ops_inode.c
@@ -1148,16 +1148,6 @@ const struct inode_operations gfs2_file_iops = {
.removexattr = gfs2_removexattr,
 };
 
-const struct inode_operations gfs2_dev_iops = {
-   .permission = gfs2_permission,
-   .setattr = gfs2_setattr,
-   .getattr = gfs2_getattr,
-   .setxattr = gfs2_setxattr,
-   .getxattr = gfs2_getxattr,
-   .listxattr = gfs2_listxattr,
-   .removexattr = gfs2_removexattr,
-};
-
 const struct inode_operations gfs2_dir_iops = {
.create = gfs2_create,
.lookup = gfs2_lookup,
diff --git a/fs/gfs2/ops_inode.h b/fs/gfs2/ops_inode.h
index fd8cee2..14b4b79 100644
--- a/fs/gfs2/ops_inode.h
+++ b/fs/gfs2/ops_inode.h
@@ -15,7 +15,6 @@
 extern const struct inode_operations gfs2_file_iops;
 extern const struct inode_operations gfs2_dir_iops;
 extern const struct inode_operations gfs2_symlink_iops;
-extern const struct inode_operations gfs2_dev_iops;
 extern const struct file_operations gfs2_file_fops;
 extern const struct file_operations gfs2_dir_fops;
 extern const struct file_operations gfs2_file_fops_nolock;
-- 
1.5.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] [GFS2] re-support special inode

2008-02-25 Thread Denis Cheng
commit feaa7bba026c181ce071d5a4884f7f9dd26207a1 removed call to
init_special_inode from inode lookuping, this cause problems as:

 # mknod /mnt/gfs2/dev/null c 1 3
 # cat /mnt/gfs2/dev/null
 cat: /mnt/gfs2/dev/null: Invalid argument

without special inode, GFS2 cannot support char device file,
block device file, fifo pipe, and socket file, lose many important
features as a common file system.

this one line patch re add special inode support.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 fs/gfs2/inode.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 1069ceb..18d8e0b 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -150,6 +150,7 @@ void gfs2_set_iop(struct inode *inode)
inode-i_op = gfs2_symlink_iops;
} else {
inode-i_op = gfs2_file_iops;
+   init_special_inode(inode, inode-i_mode, inode-i_rdev);
}
 
unlock_new_inode(inode);
-- 
1.5.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers/block/: add __devinitdata to all pci_device_id table of block drivers

2008-02-02 Thread Denis Cheng
Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 drivers/block/DAC960.c   |2 +-
 drivers/block/cciss.c|2 +-
 drivers/block/cpqarray.c |2 +-
 drivers/block/sx8.c  |2 +-
 drivers/block/umem.c |2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index cd03473..3bdaabc 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -7102,7 +7102,7 @@ static struct DAC960_privdata DAC960_P_privdata = {
.MemoryWindowSize = DAC960_PD_RegisterWindowSize,
 };
 
-static struct pci_device_id DAC960_id_table[] = {
+static struct pci_device_id DAC960_id_table[] __devinitdata = {
{
.vendor = PCI_VENDOR_ID_MYLEX,
.device = PCI_DEVICE_ID_MYLEX_DAC960_GEM,
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 855ce8e..2e19ef4 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -67,7 +67,7 @@ MODULE_LICENSE("GPL");
 #include 
 
 /* define the PCI info for the cards we can control */
-static const struct pci_device_id cciss_pci_device_id[] = {
+static const struct pci_device_id cciss_pci_device_id[] __devinitdata = {
{PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_CISS,  0x0E11, 0x4070},
{PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_CISSB, 0x0E11, 0x4080},
{PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_CISSB, 0x0E11, 0x4082},
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
index 6919918..15204b9 100644
--- a/drivers/block/cpqarray.c
+++ b/drivers/block/cpqarray.c
@@ -96,7 +96,7 @@ static struct board_type products[] = {
 };
 
 /* define the PCI info for the PCI cards this driver can control */
-static const struct pci_device_id cpqarray_pci_device_id[] =
+static const struct pci_device_id cpqarray_pci_device_id[] __devinitdata =
 {
{ PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_COMPAQ_42XX,
0x0E11, 0x4058, 0, 0, 0},   /* SA431 */
diff --git a/drivers/block/sx8.c b/drivers/block/sx8.c
index cd5674b..d3e18d7 100644
--- a/drivers/block/sx8.c
+++ b/drivers/block/sx8.c
@@ -409,7 +409,7 @@ static int carm_init_one (struct pci_dev *pdev, const 
struct pci_device_id *ent)
 static void carm_remove_one (struct pci_dev *pdev);
 static int carm_bdev_getgeo(struct block_device *bdev, struct hd_geometry 
*geo);
 
-static struct pci_device_id carm_pci_tbl[] = {
+static struct pci_device_id carm_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_PROMISE, 0x8000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
{ PCI_VENDOR_ID_PROMISE, 0x8002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
{ } /* terminate list */
diff --git a/drivers/block/umem.c b/drivers/block/umem.c
index c24e1bd..98846f8 100644
--- a/drivers/block/umem.c
+++ b/drivers/block/umem.c
@@ -1053,7 +1053,7 @@ static void mm_pci_remove(struct pci_dev *dev)
pci_disable_device(dev);
 }
 
-static const struct pci_device_id mm_pci_ids[] = {
+static const struct pci_device_id mm_pci_ids[] __devinitdata = {
 {PCI_DEVICE(PCI_VENDOR_ID_MICRO_MEMORY, 
PCI_DEVICE_ID_MICRO_MEMORY_5415CN)},
 {PCI_DEVICE(PCI_VENDOR_ID_MICRO_MEMORY, 
PCI_DEVICE_ID_MICRO_MEMORY_5425CN)},
 {PCI_DEVICE(PCI_VENDOR_ID_MICRO_MEMORY, PCI_DEVICE_ID_MICRO_MEMORY_6155)},
-- 
1.5.3.8

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] xfs: add __init/__exit mark to specific init/cleanup functions

2008-02-02 Thread Denis Cheng
Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 fs/xfs/linux-2.6/xfs_super.c |2 +-
 fs/xfs/linux-2.6/xfs_vnode.c |2 +-
 fs/xfs/support/ktrace.c  |4 ++--
 fs/xfs/support/uuid.c|2 +-
 fs/xfs/xfs_vfsops.c  |4 ++--
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 8cb63c6..abacbdd 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -361,7 +361,7 @@ xfs_fs_inode_init_once(
inode_init_once(vn_to_inode((bhv_vnode_t *)vnode));
 }
 
-STATIC int
+STATIC int __init
 xfs_init_zones(void)
 {
xfs_vnode_zone = kmem_zone_init_flags(sizeof(bhv_vnode_t), "xfs_vnode",
diff --git a/fs/xfs/linux-2.6/xfs_vnode.c b/fs/xfs/linux-2.6/xfs_vnode.c
index 814169f..56e23cd 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.c
+++ b/fs/xfs/linux-2.6/xfs_vnode.c
@@ -40,7 +40,7 @@
 #define vptosync(v) ([((unsigned long)v) % NVSYNC])
 static wait_queue_head_t vsync[NVSYNC];
 
-void
+void __init
 vn_init(void)
 {
int i;
diff --git a/fs/xfs/support/ktrace.c b/fs/xfs/support/ktrace.c
index 5cf2e86..17f2b7c 100644
--- a/fs/xfs/support/ktrace.c
+++ b/fs/xfs/support/ktrace.c
@@ -21,7 +21,7 @@ static kmem_zone_t *ktrace_hdr_zone;
 static kmem_zone_t *ktrace_ent_zone;
 static int  ktrace_zentries;
 
-void
+void __init
 ktrace_init(int zentries)
 {
ktrace_zentries = zentries;
@@ -36,7 +36,7 @@ ktrace_init(int zentries)
ASSERT(ktrace_ent_zone);
 }
 
-void
+void __exit
 ktrace_uninit(void)
 {
kmem_zone_destroy(ktrace_hdr_zone);
diff --git a/fs/xfs/support/uuid.c b/fs/xfs/support/uuid.c
index e157015..493a6ec 100644
--- a/fs/xfs/support/uuid.c
+++ b/fs/xfs/support/uuid.c
@@ -133,7 +133,7 @@ uuid_table_remove(uuid_t *uuid)
mutex_unlock(_monitor);
 }
 
-void
+void __init
 uuid_init(void)
 {
mutex_init(_monitor);
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
index a154459..cde337e 100644
--- a/fs/xfs/xfs_vfsops.c
+++ b/fs/xfs/xfs_vfsops.c
@@ -58,7 +58,7 @@
 #include "xfs_vfsops.h"
 
 
-int
+int __init
 xfs_init(void)
 {
extern kmem_zone_t  *xfs_bmap_free_item_zone;
@@ -152,7 +152,7 @@ xfs_init(void)
return 0;
 }
 
-void
+void __exit
 xfs_cleanup(void)
 {
extern kmem_zone_t  *xfs_bmap_free_item_zone;
-- 
1.5.3.8

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/3] uio: Kconfig improvements

2008-02-02 Thread Denis Cheng
Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 drivers/uio/Kconfig |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/uio/Kconfig b/drivers/uio/Kconfig
index b778ed7..d8ab7e6 100644
--- a/drivers/uio/Kconfig
+++ b/drivers/uio/Kconfig
@@ -1,8 +1,6 @@
-menu "Userspace I/O"
-   depends on !S390
-
-config UIO
+menuconfig UIO
tristate "Userspace I/O drivers"
+   depends on !S390
default n
help
  Enable this to allow the userspace driver core code to be
@@ -13,6 +11,8 @@ config UIO
 
  If you don't know what to do here, say N.
 
+if UIO
+
 config UIO_CIF
tristate "generic Hilscher CIF Card driver"
depends on UIO && PCI
@@ -26,4 +26,4 @@ config UIO_CIF
  To compile this driver as a module, choose M here: the module
  will be called uio_cif.
 
-endmenu
+endif
-- 
1.5.3.8

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/3] uio: mark pci_device_id hilscher_pci_ids[] __devinitdata

2008-02-02 Thread Denis Cheng
Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 drivers/uio/uio_cif.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/uio/uio_cif.c b/drivers/uio/uio_cif.c
index 838bae4..4a5a97e 100644
--- a/drivers/uio/uio_cif.c
+++ b/drivers/uio/uio_cif.c
@@ -116,7 +116,7 @@ static void hilscher_pci_remove(struct pci_dev *dev)
kfree (info);
 }
 
-static struct pci_device_id hilscher_pci_ids[] = {
+static struct pci_device_id hilscher_pci_ids[] __devinitdata = {
{
.vendor =   PCI_VENDOR_ID_PLX,
.device =   PCI_DEVICE_ID_PLX_9030,
-- 
1.5.3.8

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/3] uio: vm_operations_struct ->nopage to ->fault method conversion

2008-02-02 Thread Denis Cheng
Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 drivers/uio/uio.c |   19 ---
 1 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index cc246fa..47e0c32 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -417,30 +417,27 @@ static void uio_vma_close(struct vm_area_struct *vma)
idev->vma_count--;
 }
 
-static struct page *uio_vma_nopage(struct vm_area_struct *vma,
-  unsigned long address, int *type)
+static int uio_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
struct uio_device *idev = vma->vm_private_data;
-   struct page* page = NOPAGE_SIGBUS;
 
int mi = uio_find_mem_index(vma);
if (mi < 0)
-   return page;
+   return VM_FAULT_SIGBUS;
 
if (idev->info->mem[mi].memtype == UIO_MEM_LOGICAL)
-   page = virt_to_page(idev->info->mem[mi].addr);
+   vmf->page = virt_to_page(idev->info->mem[mi].addr);
else
-   page = vmalloc_to_page((void*)idev->info->mem[mi].addr);
-   get_page(page);
-   if (type)
-   *type = VM_FAULT_MINOR;
-   return page;
+   vmf->page = vmalloc_to_page((void *)idev->info->mem[mi].addr);
+   get_page(vmf->page);
+
+   return 0;
 }
 
 static struct vm_operations_struct uio_vm_ops = {
.open = uio_vma_open,
.close = uio_vma_close,
-   .nopage = uio_vma_nopage,
+   .fault = uio_vma_fault,
 };
 
 static int uio_mmap_physical(struct vm_area_struct *vma)
-- 
1.5.3.8

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ide-pci-generic: kill the unused ifdef/endif/MODULE code

2008-02-02 Thread Denis Cheng
with module_param macro, the __setup code can be killed now:
const __setup("all-generic-ide", ide_generic_all_on);

and the module name "generic.ko" is not descriptive to its functionality,
can be changed in Makefile, the "ide-pci-generic.ko" is better.

the ide-pci-generic.all-generic-ide parameter also documented
in Documentation/kernel-parameters.txt

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 Documentation/kernel-parameters.txt |3 +++
 drivers/ide/pci/Makefile|3 ++-
 drivers/ide/pci/generic.c   |   13 -
 3 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/Documentation/kernel-parameters.txt 
b/Documentation/kernel-parameters.txt
index cf38689..e81bcae 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -780,6 +780,9 @@ and is between 256 and 4096 characters. It is defined in 
the file
loop use the MONITOR/MWAIT idle loop anyways. 
Performance should be the same
as idle=poll.
 
+   ide-pci-generic.all-generic-ide [HW] (E)IDE subsystem
+   Claim all unknown PCI IDE storage controllers.
+
ignore_loglevel [KNL]
Ignore loglevel setting - this will print /all/
kernel messages to the console. Useful for debugging.
diff --git a/drivers/ide/pci/Makefile b/drivers/ide/pci/Makefile
index 9480325..02e6ee7 100644
--- a/drivers/ide/pci/Makefile
+++ b/drivers/ide/pci/Makefile
@@ -34,7 +34,8 @@ obj-$(CONFIG_BLK_DEV_TRM290)  += trm290.o
 obj-$(CONFIG_BLK_DEV_VIA82CXXX)+= via82cxxx.o
 
 # Must appear at the end of the block
-obj-$(CONFIG_BLK_DEV_GENERIC)  += generic.o
+obj-$(CONFIG_BLK_DEV_GENERIC)  += ide-pci-generic.o
+ide-pci-generic-y  += generic.o
 
 ifeq ($(CONFIG_BLK_DEV_CMD640), m)
obj-m += cmd640.o
diff --git a/drivers/ide/pci/generic.c b/drivers/ide/pci/generic.c
index 59ebe84..619912e 100644
--- a/drivers/ide/pci/generic.c
+++ b/drivers/ide/pci/generic.c
@@ -36,19 +36,6 @@
 
 static int ide_generic_all;/* Set to claim all devices */
 
-/*
- * the module_param_named() was added for the modular case
- * the __setup() is left as compatibility for existing setups
- */
-#ifndef MODULE
-static int __init ide_generic_all_on(char *unused)
-{
-   ide_generic_all = 1;
-   printk(KERN_INFO "IDE generic will claim all unknown PCI IDE storage 
controllers.\n");
-   return 1;
-}
-const __setup("all-generic-ide", ide_generic_all_on);
-#endif
 module_param_named(all_generic_ide, ide_generic_all, bool, 0444);
 MODULE_PARM_DESC(all_generic_ide, "IDE generic will claim all unknown PCI IDE 
storage controllers.");
 
-- 
1.5.3.8

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ide-pci-generic: kill the unused ifdef/endif/MODULE code

2008-02-02 Thread Denis Cheng
with module_param macro, the __setup code can be killed now:
const __setup(all-generic-ide, ide_generic_all_on);

and the module name generic.ko is not descriptive to its functionality,
can be changed in Makefile, the ide-pci-generic.ko is better.

the ide-pci-generic.all-generic-ide parameter also documented
in Documentation/kernel-parameters.txt

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 Documentation/kernel-parameters.txt |3 +++
 drivers/ide/pci/Makefile|3 ++-
 drivers/ide/pci/generic.c   |   13 -
 3 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/Documentation/kernel-parameters.txt 
b/Documentation/kernel-parameters.txt
index cf38689..e81bcae 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -780,6 +780,9 @@ and is between 256 and 4096 characters. It is defined in 
the file
loop use the MONITOR/MWAIT idle loop anyways. 
Performance should be the same
as idle=poll.
 
+   ide-pci-generic.all-generic-ide [HW] (E)IDE subsystem
+   Claim all unknown PCI IDE storage controllers.
+
ignore_loglevel [KNL]
Ignore loglevel setting - this will print /all/
kernel messages to the console. Useful for debugging.
diff --git a/drivers/ide/pci/Makefile b/drivers/ide/pci/Makefile
index 9480325..02e6ee7 100644
--- a/drivers/ide/pci/Makefile
+++ b/drivers/ide/pci/Makefile
@@ -34,7 +34,8 @@ obj-$(CONFIG_BLK_DEV_TRM290)  += trm290.o
 obj-$(CONFIG_BLK_DEV_VIA82CXXX)+= via82cxxx.o
 
 # Must appear at the end of the block
-obj-$(CONFIG_BLK_DEV_GENERIC)  += generic.o
+obj-$(CONFIG_BLK_DEV_GENERIC)  += ide-pci-generic.o
+ide-pci-generic-y  += generic.o
 
 ifeq ($(CONFIG_BLK_DEV_CMD640), m)
obj-m += cmd640.o
diff --git a/drivers/ide/pci/generic.c b/drivers/ide/pci/generic.c
index 59ebe84..619912e 100644
--- a/drivers/ide/pci/generic.c
+++ b/drivers/ide/pci/generic.c
@@ -36,19 +36,6 @@
 
 static int ide_generic_all;/* Set to claim all devices */
 
-/*
- * the module_param_named() was added for the modular case
- * the __setup() is left as compatibility for existing setups
- */
-#ifndef MODULE
-static int __init ide_generic_all_on(char *unused)
-{
-   ide_generic_all = 1;
-   printk(KERN_INFO IDE generic will claim all unknown PCI IDE storage 
controllers.\n);
-   return 1;
-}
-const __setup(all-generic-ide, ide_generic_all_on);
-#endif
 module_param_named(all_generic_ide, ide_generic_all, bool, 0444);
 MODULE_PARM_DESC(all_generic_ide, IDE generic will claim all unknown PCI IDE 
storage controllers.);
 
-- 
1.5.3.8

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/3] uio: Kconfig improvements

2008-02-02 Thread Denis Cheng
Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 drivers/uio/Kconfig |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/uio/Kconfig b/drivers/uio/Kconfig
index b778ed7..d8ab7e6 100644
--- a/drivers/uio/Kconfig
+++ b/drivers/uio/Kconfig
@@ -1,8 +1,6 @@
-menu Userspace I/O
-   depends on !S390
-
-config UIO
+menuconfig UIO
tristate Userspace I/O drivers
+   depends on !S390
default n
help
  Enable this to allow the userspace driver core code to be
@@ -13,6 +11,8 @@ config UIO
 
  If you don't know what to do here, say N.
 
+if UIO
+
 config UIO_CIF
tristate generic Hilscher CIF Card driver
depends on UIO  PCI
@@ -26,4 +26,4 @@ config UIO_CIF
  To compile this driver as a module, choose M here: the module
  will be called uio_cif.
 
-endmenu
+endif
-- 
1.5.3.8

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/3] uio: mark pci_device_id hilscher_pci_ids[] __devinitdata

2008-02-02 Thread Denis Cheng
Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 drivers/uio/uio_cif.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/uio/uio_cif.c b/drivers/uio/uio_cif.c
index 838bae4..4a5a97e 100644
--- a/drivers/uio/uio_cif.c
+++ b/drivers/uio/uio_cif.c
@@ -116,7 +116,7 @@ static void hilscher_pci_remove(struct pci_dev *dev)
kfree (info);
 }
 
-static struct pci_device_id hilscher_pci_ids[] = {
+static struct pci_device_id hilscher_pci_ids[] __devinitdata = {
{
.vendor =   PCI_VENDOR_ID_PLX,
.device =   PCI_DEVICE_ID_PLX_9030,
-- 
1.5.3.8

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/3] uio: vm_operations_struct -nopage to -fault method conversion

2008-02-02 Thread Denis Cheng
Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 drivers/uio/uio.c |   19 ---
 1 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index cc246fa..47e0c32 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -417,30 +417,27 @@ static void uio_vma_close(struct vm_area_struct *vma)
idev-vma_count--;
 }
 
-static struct page *uio_vma_nopage(struct vm_area_struct *vma,
-  unsigned long address, int *type)
+static int uio_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
struct uio_device *idev = vma-vm_private_data;
-   struct page* page = NOPAGE_SIGBUS;
 
int mi = uio_find_mem_index(vma);
if (mi  0)
-   return page;
+   return VM_FAULT_SIGBUS;
 
if (idev-info-mem[mi].memtype == UIO_MEM_LOGICAL)
-   page = virt_to_page(idev-info-mem[mi].addr);
+   vmf-page = virt_to_page(idev-info-mem[mi].addr);
else
-   page = vmalloc_to_page((void*)idev-info-mem[mi].addr);
-   get_page(page);
-   if (type)
-   *type = VM_FAULT_MINOR;
-   return page;
+   vmf-page = vmalloc_to_page((void *)idev-info-mem[mi].addr);
+   get_page(vmf-page);
+
+   return 0;
 }
 
 static struct vm_operations_struct uio_vm_ops = {
.open = uio_vma_open,
.close = uio_vma_close,
-   .nopage = uio_vma_nopage,
+   .fault = uio_vma_fault,
 };
 
 static int uio_mmap_physical(struct vm_area_struct *vma)
-- 
1.5.3.8

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] xfs: add __init/__exit mark to specific init/cleanup functions

2008-02-02 Thread Denis Cheng
Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 fs/xfs/linux-2.6/xfs_super.c |2 +-
 fs/xfs/linux-2.6/xfs_vnode.c |2 +-
 fs/xfs/support/ktrace.c  |4 ++--
 fs/xfs/support/uuid.c|2 +-
 fs/xfs/xfs_vfsops.c  |4 ++--
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 8cb63c6..abacbdd 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -361,7 +361,7 @@ xfs_fs_inode_init_once(
inode_init_once(vn_to_inode((bhv_vnode_t *)vnode));
 }
 
-STATIC int
+STATIC int __init
 xfs_init_zones(void)
 {
xfs_vnode_zone = kmem_zone_init_flags(sizeof(bhv_vnode_t), xfs_vnode,
diff --git a/fs/xfs/linux-2.6/xfs_vnode.c b/fs/xfs/linux-2.6/xfs_vnode.c
index 814169f..56e23cd 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.c
+++ b/fs/xfs/linux-2.6/xfs_vnode.c
@@ -40,7 +40,7 @@
 #define vptosync(v) (vsync[((unsigned long)v) % NVSYNC])
 static wait_queue_head_t vsync[NVSYNC];
 
-void
+void __init
 vn_init(void)
 {
int i;
diff --git a/fs/xfs/support/ktrace.c b/fs/xfs/support/ktrace.c
index 5cf2e86..17f2b7c 100644
--- a/fs/xfs/support/ktrace.c
+++ b/fs/xfs/support/ktrace.c
@@ -21,7 +21,7 @@ static kmem_zone_t *ktrace_hdr_zone;
 static kmem_zone_t *ktrace_ent_zone;
 static int  ktrace_zentries;
 
-void
+void __init
 ktrace_init(int zentries)
 {
ktrace_zentries = zentries;
@@ -36,7 +36,7 @@ ktrace_init(int zentries)
ASSERT(ktrace_ent_zone);
 }
 
-void
+void __exit
 ktrace_uninit(void)
 {
kmem_zone_destroy(ktrace_hdr_zone);
diff --git a/fs/xfs/support/uuid.c b/fs/xfs/support/uuid.c
index e157015..493a6ec 100644
--- a/fs/xfs/support/uuid.c
+++ b/fs/xfs/support/uuid.c
@@ -133,7 +133,7 @@ uuid_table_remove(uuid_t *uuid)
mutex_unlock(uuid_monitor);
 }
 
-void
+void __init
 uuid_init(void)
 {
mutex_init(uuid_monitor);
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
index a154459..cde337e 100644
--- a/fs/xfs/xfs_vfsops.c
+++ b/fs/xfs/xfs_vfsops.c
@@ -58,7 +58,7 @@
 #include xfs_vfsops.h
 
 
-int
+int __init
 xfs_init(void)
 {
extern kmem_zone_t  *xfs_bmap_free_item_zone;
@@ -152,7 +152,7 @@ xfs_init(void)
return 0;
 }
 
-void
+void __exit
 xfs_cleanup(void)
 {
extern kmem_zone_t  *xfs_bmap_free_item_zone;
-- 
1.5.3.8

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers/block/: add __devinitdata to all pci_device_id table of block drivers

2008-02-02 Thread Denis Cheng
Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 drivers/block/DAC960.c   |2 +-
 drivers/block/cciss.c|2 +-
 drivers/block/cpqarray.c |2 +-
 drivers/block/sx8.c  |2 +-
 drivers/block/umem.c |2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index cd03473..3bdaabc 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -7102,7 +7102,7 @@ static struct DAC960_privdata DAC960_P_privdata = {
.MemoryWindowSize = DAC960_PD_RegisterWindowSize,
 };
 
-static struct pci_device_id DAC960_id_table[] = {
+static struct pci_device_id DAC960_id_table[] __devinitdata = {
{
.vendor = PCI_VENDOR_ID_MYLEX,
.device = PCI_DEVICE_ID_MYLEX_DAC960_GEM,
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 855ce8e..2e19ef4 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -67,7 +67,7 @@ MODULE_LICENSE(GPL);
 #include linux/cciss_ioctl.h
 
 /* define the PCI info for the cards we can control */
-static const struct pci_device_id cciss_pci_device_id[] = {
+static const struct pci_device_id cciss_pci_device_id[] __devinitdata = {
{PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_CISS,  0x0E11, 0x4070},
{PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_CISSB, 0x0E11, 0x4080},
{PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_CISSB, 0x0E11, 0x4082},
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
index 6919918..15204b9 100644
--- a/drivers/block/cpqarray.c
+++ b/drivers/block/cpqarray.c
@@ -96,7 +96,7 @@ static struct board_type products[] = {
 };
 
 /* define the PCI info for the PCI cards this driver can control */
-static const struct pci_device_id cpqarray_pci_device_id[] =
+static const struct pci_device_id cpqarray_pci_device_id[] __devinitdata =
 {
{ PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_COMPAQ_42XX,
0x0E11, 0x4058, 0, 0, 0},   /* SA431 */
diff --git a/drivers/block/sx8.c b/drivers/block/sx8.c
index cd5674b..d3e18d7 100644
--- a/drivers/block/sx8.c
+++ b/drivers/block/sx8.c
@@ -409,7 +409,7 @@ static int carm_init_one (struct pci_dev *pdev, const 
struct pci_device_id *ent)
 static void carm_remove_one (struct pci_dev *pdev);
 static int carm_bdev_getgeo(struct block_device *bdev, struct hd_geometry 
*geo);
 
-static struct pci_device_id carm_pci_tbl[] = {
+static struct pci_device_id carm_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_PROMISE, 0x8000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
{ PCI_VENDOR_ID_PROMISE, 0x8002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
{ } /* terminate list */
diff --git a/drivers/block/umem.c b/drivers/block/umem.c
index c24e1bd..98846f8 100644
--- a/drivers/block/umem.c
+++ b/drivers/block/umem.c
@@ -1053,7 +1053,7 @@ static void mm_pci_remove(struct pci_dev *dev)
pci_disable_device(dev);
 }
 
-static const struct pci_device_id mm_pci_ids[] = {
+static const struct pci_device_id mm_pci_ids[] __devinitdata = {
 {PCI_DEVICE(PCI_VENDOR_ID_MICRO_MEMORY, 
PCI_DEVICE_ID_MICRO_MEMORY_5415CN)},
 {PCI_DEVICE(PCI_VENDOR_ID_MICRO_MEMORY, 
PCI_DEVICE_ID_MICRO_MEMORY_5425CN)},
 {PCI_DEVICE(PCI_VENDOR_ID_MICRO_MEMORY, PCI_DEVICE_ID_MICRO_MEMORY_6155)},
-- 
1.5.3.8

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ide-core: remove conditional compiling with MODULE in ide-core.c

2008-02-01 Thread Denis Cheng
use module_init/module_exit to replace the original cond-compiling, these
macros were well designed to deal module/built-in compiling.

the original __setup with null string was invalid and not executed,
__setup("", ide_setup);

however, with the current module_param mechanics, module parameters also can
be input on the kernel command line, with this style:

ide-core.options="ide=nodma hdd=cdrom idebus=..."

so Documentation/kernel-parameters.txt also updated.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 Documentation/kernel-parameters.txt |   11 +--
 drivers/ide/ide.c   |   55 ++
 2 files changed, 25 insertions(+), 41 deletions(-)

diff --git a/Documentation/kernel-parameters.txt 
b/Documentation/kernel-parameters.txt
index cf38689..c94730c 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -759,15 +759,8 @@ and is between 256 and 4096 characters. It is defined in 
the file
icn=[HW,ISDN]
Format: [,[,[,]]]
 
-   ide=[HW] (E)IDE subsystem
-   Format: ide=nodma or ide=doubler or ide=reverse
-   See Documentation/ide.txt.
-
-   ide?=   [HW] (E)IDE subsystem
-   Format: ide?=noprobe or chipset specific parameters.
-   See Documentation/ide.txt.
-
-   idebus= [HW] (E)IDE subsystem - VLB/PCI bus speed
+   ide-core.options= [HW] (E)IDE subsystem
+   Format: ide-core.options="ide=nodma hdd=cdrom 
idebus=..."
See Documentation/ide.txt.
 
idle=   [X86]
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index ab9ca2b..28923ef 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -1654,6 +1654,25 @@ struct bus_type ide_bus_type = {
 
 EXPORT_SYMBOL_GPL(ide_bus_type);
 
+static char *options;
+module_param(options, charp, S_IRUGO);
+MODULE_LICENSE("GPL");
+
+static void __init parse_options(char *line)
+{
+   char *next = line;
+
+   if (line == NULL || !*line)
+   return;
+   while ((line = next) != NULL) {
+   next = strchr(line, ' ');
+   if (next != NULL)
+   *next++ = 0;
+   if (!ide_setup(line))
+   printk(KERN_INFO "Unknown option '%s'\n", line);
+   }
+}
+
 /*
  * This is gets invoked once during initialization, to set *everything* up
  */
@@ -1661,6 +1680,8 @@ static int __init ide_init(void)
 {
int ret;
 
+   parse_options(options);
+
printk(KERN_INFO "Uniform Multi-Platform E-IDE driver " REVISION "\n");
system_bus_speed = ide_system_bus_speed();
 
@@ -1681,32 +1702,7 @@ static int __init ide_init(void)
return 0;
 }
 
-#ifdef MODULE
-static char *options = NULL;
-module_param(options, charp, 0);
-MODULE_LICENSE("GPL");
-
-static void __init parse_options (char *line)
-{
-   char *next = line;
-
-   if (line == NULL || !*line)
-   return;
-   while ((line = next) != NULL) {
-   if ((next = strchr(line,' ')) != NULL)
-   *next++ = 0;
-   if (!ide_setup(line))
-   printk (KERN_INFO "Unknown option '%s'\n", line);
-   }
-}
-
-int __init init_module (void)
-{
-   parse_options(options);
-   return ide_init();
-}
-
-void __exit cleanup_module (void)
+static void __exit ide_exit(void)
 {
int index;
 
@@ -1718,10 +1714,5 @@ void __exit cleanup_module (void)
bus_unregister(_bus_type);
 }
 
-#else /* !MODULE */
-
-__setup("", ide_setup);
-
 module_init(ide_init);
-
-#endif /* MODULE */
+module_exit(ide_exit);
-- 
1.5.3.8

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] wireless/ath5k: renamed to ath5k_pci_driver to fix Section mismatch warnings

2008-02-01 Thread Denis Cheng
the struct pci_driver refered ath5k_pci_id_table which in __devinit section,
the sparse tool suggest this renamed to "*driver", kills mismatch warnings.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 drivers/net/wireless/ath5k/base.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath5k/base.c 
b/drivers/net/wireless/ath5k/base.c
index d6599d2..ddc8714 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -153,7 +153,7 @@ static int  ath5k_pci_resume(struct pci_dev *pdev);
 #define ath5k_pci_resume NULL
 #endif /* CONFIG_PM */
 
-static struct pci_driver ath5k_pci_drv_id = {
+static struct pci_driver ath5k_pci_driver = {
.name   = "ath5k_pci",
.id_table   = ath5k_pci_id_table,
.probe  = ath5k_pci_probe,
@@ -329,7 +329,7 @@ init_ath5k_pci(void)
 
ath5k_debug_init();
 
-   ret = pci_register_driver(_pci_drv_id);
+   ret = pci_register_driver(_pci_driver);
if (ret) {
printk(KERN_ERR "ath5k_pci: can't register pci driver\n");
return ret;
@@ -341,7 +341,7 @@ init_ath5k_pci(void)
 static void __exit
 exit_ath5k_pci(void)
 {
-   pci_unregister_driver(_pci_drv_id);
+   pci_unregister_driver(_pci_driver);
 
ath5k_debug_finish();
 }
-- 
1.5.3.8

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] fs/dlm/: add __init and __exit marks to init and exit functions

2008-02-01 Thread Denis Cheng
it moves 365 bytes from .text to .init.text, and 30 bytes from .text to
.exit.text, saves memory.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 fs/dlm/config.c|2 +-
 fs/dlm/debug_fs.c  |2 +-
 fs/dlm/lockspace.c |2 +-
 fs/dlm/memory.c|2 +-
 fs/dlm/netlink.c   |4 ++--
 fs/dlm/user.c  |2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/fs/dlm/config.c b/fs/dlm/config.c
index 2f8e3c8..c3ad1df 100644
--- a/fs/dlm/config.c
+++ b/fs/dlm/config.c
@@ -604,7 +604,7 @@ static struct clusters clusters_root = {
},
 };
 
-int dlm_config_init(void)
+int __init dlm_config_init(void)
 {
config_group_init(_root.subsys.su_group);
mutex_init(_root.subsys.su_mutex);
diff --git a/fs/dlm/debug_fs.c b/fs/dlm/debug_fs.c
index 12c3bfd..d2f98d8 100644
--- a/fs/dlm/debug_fs.c
+++ b/fs/dlm/debug_fs.c
@@ -543,7 +543,7 @@ void dlm_delete_debug_file(struct dlm_ls *ls)
debugfs_remove(ls->ls_debug_locks_dentry);
 }
 
-int dlm_register_debugfs(void)
+int __init dlm_register_debugfs(void)
 {
mutex_init(_buf_lock);
dlm_root = debugfs_create_dir("dlm", NULL);
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index b180fdc..b64e55e 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -191,7 +191,7 @@ static int do_uevent(struct dlm_ls *ls, int in)
 }
 
 
-int dlm_lockspace_init(void)
+int __init dlm_lockspace_init(void)
 {
ls_count = 0;
mutex_init(_lock);
diff --git a/fs/dlm/memory.c b/fs/dlm/memory.c
index f778386..6273109 100644
--- a/fs/dlm/memory.c
+++ b/fs/dlm/memory.c
@@ -18,7 +18,7 @@
 static struct kmem_cache *lkb_cache;
 
 
-int dlm_memory_init(void)
+int __init dlm_memory_init(void)
 {
int ret = 0;
 
diff --git a/fs/dlm/netlink.c b/fs/dlm/netlink.c
index 863b87d..745218c 100644
--- a/fs/dlm/netlink.c
+++ b/fs/dlm/netlink.c
@@ -78,7 +78,7 @@ static struct genl_ops dlm_nl_ops = {
.doit   = user_cmd,
 };
 
-int dlm_netlink_init(void)
+int __init dlm_netlink_init(void)
 {
int rv;
 
@@ -95,7 +95,7 @@ int dlm_netlink_init(void)
return rv;
 }
 
-void dlm_netlink_exit(void)
+void __exit dlm_netlink_exit(void)
 {
genl_unregister_ops(, _nl_ops);
genl_unregister_family();
diff --git a/fs/dlm/user.c b/fs/dlm/user.c
index 7cbc682..0bf8dfe 100644
--- a/fs/dlm/user.c
+++ b/fs/dlm/user.c
@@ -907,7 +907,7 @@ static struct miscdevice ctl_device = {
.minor = MISC_DYNAMIC_MINOR,
 };
 
-int dlm_user_init(void)
+int __init dlm_user_init(void)
 {
int error;
 
-- 
1.5.3.8

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] fs/dlm/: add __init and __exit marks to init and exit functions

2008-02-01 Thread Denis Cheng
it moves 365 bytes from .text to .init.text, and 30 bytes from .text to
.exit.text, saves memory.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 fs/dlm/config.c|2 +-
 fs/dlm/debug_fs.c  |2 +-
 fs/dlm/lockspace.c |2 +-
 fs/dlm/memory.c|2 +-
 fs/dlm/netlink.c   |4 ++--
 fs/dlm/user.c  |2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/fs/dlm/config.c b/fs/dlm/config.c
index 2f8e3c8..c3ad1df 100644
--- a/fs/dlm/config.c
+++ b/fs/dlm/config.c
@@ -604,7 +604,7 @@ static struct clusters clusters_root = {
},
 };
 
-int dlm_config_init(void)
+int __init dlm_config_init(void)
 {
config_group_init(clusters_root.subsys.su_group);
mutex_init(clusters_root.subsys.su_mutex);
diff --git a/fs/dlm/debug_fs.c b/fs/dlm/debug_fs.c
index 12c3bfd..d2f98d8 100644
--- a/fs/dlm/debug_fs.c
+++ b/fs/dlm/debug_fs.c
@@ -543,7 +543,7 @@ void dlm_delete_debug_file(struct dlm_ls *ls)
debugfs_remove(ls-ls_debug_locks_dentry);
 }
 
-int dlm_register_debugfs(void)
+int __init dlm_register_debugfs(void)
 {
mutex_init(debug_buf_lock);
dlm_root = debugfs_create_dir(dlm, NULL);
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index b180fdc..b64e55e 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -191,7 +191,7 @@ static int do_uevent(struct dlm_ls *ls, int in)
 }
 
 
-int dlm_lockspace_init(void)
+int __init dlm_lockspace_init(void)
 {
ls_count = 0;
mutex_init(ls_lock);
diff --git a/fs/dlm/memory.c b/fs/dlm/memory.c
index f778386..6273109 100644
--- a/fs/dlm/memory.c
+++ b/fs/dlm/memory.c
@@ -18,7 +18,7 @@
 static struct kmem_cache *lkb_cache;
 
 
-int dlm_memory_init(void)
+int __init dlm_memory_init(void)
 {
int ret = 0;
 
diff --git a/fs/dlm/netlink.c b/fs/dlm/netlink.c
index 863b87d..745218c 100644
--- a/fs/dlm/netlink.c
+++ b/fs/dlm/netlink.c
@@ -78,7 +78,7 @@ static struct genl_ops dlm_nl_ops = {
.doit   = user_cmd,
 };
 
-int dlm_netlink_init(void)
+int __init dlm_netlink_init(void)
 {
int rv;
 
@@ -95,7 +95,7 @@ int dlm_netlink_init(void)
return rv;
 }
 
-void dlm_netlink_exit(void)
+void __exit dlm_netlink_exit(void)
 {
genl_unregister_ops(family, dlm_nl_ops);
genl_unregister_family(family);
diff --git a/fs/dlm/user.c b/fs/dlm/user.c
index 7cbc682..0bf8dfe 100644
--- a/fs/dlm/user.c
+++ b/fs/dlm/user.c
@@ -907,7 +907,7 @@ static struct miscdevice ctl_device = {
.minor = MISC_DYNAMIC_MINOR,
 };
 
-int dlm_user_init(void)
+int __init dlm_user_init(void)
 {
int error;
 
-- 
1.5.3.8

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] wireless/ath5k: renamed to ath5k_pci_driver to fix Section mismatch warnings

2008-02-01 Thread Denis Cheng
the struct pci_driver refered ath5k_pci_id_table which in __devinit section,
the sparse tool suggest this renamed to *driver, kills mismatch warnings.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 drivers/net/wireless/ath5k/base.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath5k/base.c 
b/drivers/net/wireless/ath5k/base.c
index d6599d2..ddc8714 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -153,7 +153,7 @@ static int  ath5k_pci_resume(struct pci_dev *pdev);
 #define ath5k_pci_resume NULL
 #endif /* CONFIG_PM */
 
-static struct pci_driver ath5k_pci_drv_id = {
+static struct pci_driver ath5k_pci_driver = {
.name   = ath5k_pci,
.id_table   = ath5k_pci_id_table,
.probe  = ath5k_pci_probe,
@@ -329,7 +329,7 @@ init_ath5k_pci(void)
 
ath5k_debug_init();
 
-   ret = pci_register_driver(ath5k_pci_drv_id);
+   ret = pci_register_driver(ath5k_pci_driver);
if (ret) {
printk(KERN_ERR ath5k_pci: can't register pci driver\n);
return ret;
@@ -341,7 +341,7 @@ init_ath5k_pci(void)
 static void __exit
 exit_ath5k_pci(void)
 {
-   pci_unregister_driver(ath5k_pci_drv_id);
+   pci_unregister_driver(ath5k_pci_driver);
 
ath5k_debug_finish();
 }
-- 
1.5.3.8

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ide-core: remove conditional compiling with MODULE in ide-core.c

2008-02-01 Thread Denis Cheng
use module_init/module_exit to replace the original cond-compiling, these
macros were well designed to deal module/built-in compiling.

the original __setup with null string was invalid and not executed,
__setup(, ide_setup);

however, with the current module_param mechanics, module parameters also can
be input on the kernel command line, with this style:

ide-core.options=ide=nodma hdd=cdrom idebus=...

so Documentation/kernel-parameters.txt also updated.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 Documentation/kernel-parameters.txt |   11 +--
 drivers/ide/ide.c   |   55 ++
 2 files changed, 25 insertions(+), 41 deletions(-)

diff --git a/Documentation/kernel-parameters.txt 
b/Documentation/kernel-parameters.txt
index cf38689..c94730c 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -759,15 +759,8 @@ and is between 256 and 4096 characters. It is defined in 
the file
icn=[HW,ISDN]
Format: io[,membase[,icn_id[,icn_id2]]]
 
-   ide=[HW] (E)IDE subsystem
-   Format: ide=nodma or ide=doubler or ide=reverse
-   See Documentation/ide.txt.
-
-   ide?=   [HW] (E)IDE subsystem
-   Format: ide?=noprobe or chipset specific parameters.
-   See Documentation/ide.txt.
-
-   idebus= [HW] (E)IDE subsystem - VLB/PCI bus speed
+   ide-core.options= [HW] (E)IDE subsystem
+   Format: ide-core.options=ide=nodma hdd=cdrom 
idebus=...
See Documentation/ide.txt.
 
idle=   [X86]
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index ab9ca2b..28923ef 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -1654,6 +1654,25 @@ struct bus_type ide_bus_type = {
 
 EXPORT_SYMBOL_GPL(ide_bus_type);
 
+static char *options;
+module_param(options, charp, S_IRUGO);
+MODULE_LICENSE(GPL);
+
+static void __init parse_options(char *line)
+{
+   char *next = line;
+
+   if (line == NULL || !*line)
+   return;
+   while ((line = next) != NULL) {
+   next = strchr(line, ' ');
+   if (next != NULL)
+   *next++ = 0;
+   if (!ide_setup(line))
+   printk(KERN_INFO Unknown option '%s'\n, line);
+   }
+}
+
 /*
  * This is gets invoked once during initialization, to set *everything* up
  */
@@ -1661,6 +1680,8 @@ static int __init ide_init(void)
 {
int ret;
 
+   parse_options(options);
+
printk(KERN_INFO Uniform Multi-Platform E-IDE driver  REVISION \n);
system_bus_speed = ide_system_bus_speed();
 
@@ -1681,32 +1702,7 @@ static int __init ide_init(void)
return 0;
 }
 
-#ifdef MODULE
-static char *options = NULL;
-module_param(options, charp, 0);
-MODULE_LICENSE(GPL);
-
-static void __init parse_options (char *line)
-{
-   char *next = line;
-
-   if (line == NULL || !*line)
-   return;
-   while ((line = next) != NULL) {
-   if ((next = strchr(line,' ')) != NULL)
-   *next++ = 0;
-   if (!ide_setup(line))
-   printk (KERN_INFO Unknown option '%s'\n, line);
-   }
-}
-
-int __init init_module (void)
-{
-   parse_options(options);
-   return ide_init();
-}
-
-void __exit cleanup_module (void)
+static void __exit ide_exit(void)
 {
int index;
 
@@ -1718,10 +1714,5 @@ void __exit cleanup_module (void)
bus_unregister(ide_bus_type);
 }
 
-#else /* !MODULE */
-
-__setup(, ide_setup);
-
 module_init(ide_init);
-
-#endif /* MODULE */
+module_exit(ide_exit);
-- 
1.5.3.8

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] fs/char_dev.c: chrdev_open marked static and removed from fs.h

2008-01-31 Thread Denis Cheng
there is an outdated comment in serial_core.c also fixed.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 drivers/serial/serial_core.c |4 ++--
 fs/char_dev.c|2 +-
 include/linux/fs.h   |1 -
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 3bb5d24..2f0b61c 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -1550,8 +1550,8 @@ static struct uart_state *uart_get(struct uart_driver 
*drv, int line)
 }
 
 /*
- * In 2.4.5, calls to uart_open are serialised by the BKL in
- *   linux/fs/devices.c:chrdev_open()
+ * calls to uart_open are serialised by the BKL in
+ *   fs/char_dev.c:chrdev_open()
  * Note that if this fails, then uart_close() _will_ be called.
  *
  * In time, we want to scrap the "opening nonpresent ports"
diff --git a/fs/char_dev.c b/fs/char_dev.c
index 2c7a8b5..038674a 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -357,7 +357,7 @@ void cdev_put(struct cdev *p)
 /*
  * Called every time a character special file is opened
  */
-int chrdev_open(struct inode * inode, struct file * filp)
+static int chrdev_open(struct inode *inode, struct file *filp)
 {
struct cdev *p;
struct cdev *new = NULL;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index a516b67..a5fb302 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1620,7 +1620,6 @@ extern int register_chrdev(unsigned int, const char *,
   const struct file_operations *);
 extern void unregister_chrdev(unsigned int, const char *);
 extern void unregister_chrdev_region(dev_t, unsigned);
-extern int chrdev_open(struct inode *, struct file *);
 extern void chrdev_show(struct seq_file *,off_t);
 
 /* fs/block_dev.c */
-- 
1.5.3.8

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] fs/char_dev.c: chrdev_open marked static and removed from fs.h

2008-01-31 Thread Denis Cheng
there is an outdated comment in serial_core.c also fixed.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 drivers/serial/serial_core.c |4 ++--
 fs/char_dev.c|2 +-
 include/linux/fs.h   |1 -
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 3bb5d24..2f0b61c 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -1550,8 +1550,8 @@ static struct uart_state *uart_get(struct uart_driver 
*drv, int line)
 }
 
 /*
- * In 2.4.5, calls to uart_open are serialised by the BKL in
- *   linux/fs/devices.c:chrdev_open()
+ * calls to uart_open are serialised by the BKL in
+ *   fs/char_dev.c:chrdev_open()
  * Note that if this fails, then uart_close() _will_ be called.
  *
  * In time, we want to scrap the opening nonpresent ports
diff --git a/fs/char_dev.c b/fs/char_dev.c
index 2c7a8b5..038674a 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -357,7 +357,7 @@ void cdev_put(struct cdev *p)
 /*
  * Called every time a character special file is opened
  */
-int chrdev_open(struct inode * inode, struct file * filp)
+static int chrdev_open(struct inode *inode, struct file *filp)
 {
struct cdev *p;
struct cdev *new = NULL;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index a516b67..a5fb302 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1620,7 +1620,6 @@ extern int register_chrdev(unsigned int, const char *,
   const struct file_operations *);
 extern void unregister_chrdev(unsigned int, const char *);
 extern void unregister_chrdev_region(dev_t, unsigned);
-extern int chrdev_open(struct inode *, struct file *);
 extern void chrdev_show(struct seq_file *,off_t);
 
 /* fs/block_dev.c */
-- 
1.5.3.8

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] dlm/user.c: static initialization improvements

2008-01-28 Thread Denis Cheng
also change name_prefix from char pointer to char array.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 fs/dlm/user.c |   13 +++--
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/fs/dlm/user.c b/fs/dlm/user.c
index 4f74154..2cc5415 100644
--- a/fs/dlm/user.c
+++ b/fs/dlm/user.c
@@ -24,8 +24,7 @@
 #include "lvb_table.h"
 #include "user.h"
 
-static const char *name_prefix="dlm";
-static struct miscdevice ctl_device;
+static const char name_prefix[] = "dlm";
 static const struct file_operations device_fops;
 
 #ifdef CONFIG_COMPAT
@@ -896,14 +895,16 @@ static const struct file_operations ctl_device_fops = {
.owner   = THIS_MODULE,
 };
 
+static struct miscdevice ctl_device = {
+   .name  = "dlm-control",
+   .fops  = _device_fops,
+   .minor = MISC_DYNAMIC_MINOR,
+};
+
 int dlm_user_init(void)
 {
int error;
 
-   ctl_device.name = "dlm-control";
-   ctl_device.fops = _device_fops;
-   ctl_device.minor = MISC_DYNAMIC_MINOR;
-
error = misc_register(_device);
if (error)
log_print("misc_register failed for control device");
-- 
1.5.3.8

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] dlm/user.c: static initialization improvements

2008-01-28 Thread Denis Cheng
also change name_prefix from char pointer to char array.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 fs/dlm/user.c |   13 +++--
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/fs/dlm/user.c b/fs/dlm/user.c
index 4f74154..2cc5415 100644
--- a/fs/dlm/user.c
+++ b/fs/dlm/user.c
@@ -24,8 +24,7 @@
 #include lvb_table.h
 #include user.h
 
-static const char *name_prefix=dlm;
-static struct miscdevice ctl_device;
+static const char name_prefix[] = dlm;
 static const struct file_operations device_fops;
 
 #ifdef CONFIG_COMPAT
@@ -896,14 +895,16 @@ static const struct file_operations ctl_device_fops = {
.owner   = THIS_MODULE,
 };
 
+static struct miscdevice ctl_device = {
+   .name  = dlm-control,
+   .fops  = ctl_device_fops,
+   .minor = MISC_DYNAMIC_MINOR,
+};
+
 int dlm_user_init(void)
 {
int error;
 
-   ctl_device.name = dlm-control;
-   ctl_device.fops = ctl_device_fops;
-   ctl_device.minor = MISC_DYNAMIC_MINOR;
-
error = misc_register(ctl_device);
if (error)
log_print(misc_register failed for control device);
-- 
1.5.3.8

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] USB: Use menuconfig objects

2008-01-24 Thread Denis Cheng
commit 04d06ad0f1fdb499af84ae3d7969e2136a462f38 have added menuconfig support
for the whole USB Kconfig, but there are still menuconfig need for usb/serial,
usb/atm, and usb/gadget, so that the user can disable all the options in that
menu at once instead of having to disable each option separately.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 drivers/usb/atm/Kconfig|9 -
 drivers/usb/gadget/Kconfig |9 +
 drivers/usb/serial/Kconfig |   11 ---
 3 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/drivers/usb/atm/Kconfig b/drivers/usb/atm/Kconfig
index b450cba..86e6403 100644
--- a/drivers/usb/atm/Kconfig
+++ b/drivers/usb/atm/Kconfig
@@ -2,10 +2,7 @@
 # USB/ATM DSL configuration
 #
 
-menu "USB DSL modem support"
-   depends on USB
-
-config USB_ATM
+menuconfig USB_ATM
tristate "USB DSL modem support"
depends on USB && ATM
select CRC32
@@ -18,6 +15,8 @@ config USB_ATM
  To compile this driver as a module, choose M here: the
  module will be called usbatm.
 
+if USB_ATM
+
 config USB_SPEEDTOUCH
tristate "Speedtouch USB support"
depends on USB_ATM
@@ -70,4 +69,4 @@ config USB_XUSBATM
  To compile this driver as a module, choose M here: the
  module will be called xusbatm.
 
-endmenu
+endif # USB_ATM
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index f81d08d..8393176 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -12,10 +12,9 @@
 # With help from a special transceiver and a "Mini-AB" jack, systems with
 # both kinds of controller can also support "USB On-the-Go" (CONFIG_USB_OTG).
 #
-menu "USB Gadget Support"
 
-config USB_GADGET
-   tristate "Support for USB Gadgets"
+menuconfig USB_GADGET
+   tristate "USB Gadget Support"
help
   USB is a master/slave protocol, organized with one master
   host (such as a PC) controlling up to 127 peripheral devices.
@@ -42,6 +41,8 @@ config USB_GADGET
   For more information, see <http://www.linux-usb.org/gadget> and
   the kernel DocBook documentation for this API.
 
+if USB_GADGET
+
 config USB_GADGET_DEBUG
boolean "Debugging messages"
depends on USB_GADGET && DEBUG_KERNEL && EXPERIMENTAL
@@ -546,4 +547,4 @@ config USB_MIDI_GADGET
 
 endchoice
 
-endmenu
+endif # USB_GADGET
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig
index 4a86696..0474412 100644
--- a/drivers/usb/serial/Kconfig
+++ b/drivers/usb/serial/Kconfig
@@ -2,10 +2,7 @@
 # USB Serial device configuration
 #
 
-menu "USB Serial Converter support"
-   depends on USB!=n
-
-config USB_SERIAL
+menuconfig USB_SERIAL
tristate "USB Serial Converter support"
depends on USB
---help---
@@ -20,6 +17,8 @@ config USB_SERIAL
  To compile this driver as a module, choose M here: the
  module will be called usbserial.
 
+if USB_SERIAL
+
 config USB_SERIAL_CONSOLE
bool "USB Serial Console device support (EXPERIMENTAL)"
depends on USB_SERIAL=y && EXPERIMENTAL
@@ -590,6 +589,4 @@ config USB_EZUSB
depends on USB_SERIAL_KEYSPAN_PDA || USB_SERIAL_XIRCOM || 
USB_SERIAL_KEYSPAN || USB_SERIAL_WHITEHEAT
default y
 
-
-endmenu
-
+endif # USB_SERIAL
-- 
1.5.3.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] USB: Use menuconfig objects

2008-01-24 Thread Denis Cheng
commit 04d06ad0f1fdb499af84ae3d7969e2136a462f38 have added menuconfig support
for the whole USB Kconfig, but there are still menuconfig need for usb/serial,
usb/atm, and usb/gadget, so that the user can disable all the options in that
menu at once instead of having to disable each option separately.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 drivers/usb/atm/Kconfig|9 -
 drivers/usb/gadget/Kconfig |9 +
 drivers/usb/serial/Kconfig |   11 ---
 3 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/drivers/usb/atm/Kconfig b/drivers/usb/atm/Kconfig
index b450cba..86e6403 100644
--- a/drivers/usb/atm/Kconfig
+++ b/drivers/usb/atm/Kconfig
@@ -2,10 +2,7 @@
 # USB/ATM DSL configuration
 #
 
-menu USB DSL modem support
-   depends on USB
-
-config USB_ATM
+menuconfig USB_ATM
tristate USB DSL modem support
depends on USB  ATM
select CRC32
@@ -18,6 +15,8 @@ config USB_ATM
  To compile this driver as a module, choose M here: the
  module will be called usbatm.
 
+if USB_ATM
+
 config USB_SPEEDTOUCH
tristate Speedtouch USB support
depends on USB_ATM
@@ -70,4 +69,4 @@ config USB_XUSBATM
  To compile this driver as a module, choose M here: the
  module will be called xusbatm.
 
-endmenu
+endif # USB_ATM
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index f81d08d..8393176 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -12,10 +12,9 @@
 # With help from a special transceiver and a Mini-AB jack, systems with
 # both kinds of controller can also support USB On-the-Go (CONFIG_USB_OTG).
 #
-menu USB Gadget Support
 
-config USB_GADGET
-   tristate Support for USB Gadgets
+menuconfig USB_GADGET
+   tristate USB Gadget Support
help
   USB is a master/slave protocol, organized with one master
   host (such as a PC) controlling up to 127 peripheral devices.
@@ -42,6 +41,8 @@ config USB_GADGET
   For more information, see http://www.linux-usb.org/gadget and
   the kernel DocBook documentation for this API.
 
+if USB_GADGET
+
 config USB_GADGET_DEBUG
boolean Debugging messages
depends on USB_GADGET  DEBUG_KERNEL  EXPERIMENTAL
@@ -546,4 +547,4 @@ config USB_MIDI_GADGET
 
 endchoice
 
-endmenu
+endif # USB_GADGET
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig
index 4a86696..0474412 100644
--- a/drivers/usb/serial/Kconfig
+++ b/drivers/usb/serial/Kconfig
@@ -2,10 +2,7 @@
 # USB Serial device configuration
 #
 
-menu USB Serial Converter support
-   depends on USB!=n
-
-config USB_SERIAL
+menuconfig USB_SERIAL
tristate USB Serial Converter support
depends on USB
---help---
@@ -20,6 +17,8 @@ config USB_SERIAL
  To compile this driver as a module, choose M here: the
  module will be called usbserial.
 
+if USB_SERIAL
+
 config USB_SERIAL_CONSOLE
bool USB Serial Console device support (EXPERIMENTAL)
depends on USB_SERIAL=y  EXPERIMENTAL
@@ -590,6 +589,4 @@ config USB_EZUSB
depends on USB_SERIAL_KEYSPAN_PDA || USB_SERIAL_XIRCOM || 
USB_SERIAL_KEYSPAN || USB_SERIAL_WHITEHEAT
default y
 
-
-endmenu
-
+endif # USB_SERIAL
-- 
1.5.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] kernel/params.c: fix the module name length in param_sysfs_builtin

2008-01-21 Thread Denis Cheng
the original code use KOBJ_NAME_LEN for built-in module name length,
that's defined to 20 in linux/kobject.h, but this is not enough,
some module names(such as nf_conntrack_proto_icmp) are longer than this;
 #define KOBJ_NAME_LEN   20

another macro is MODULE_NAME_LEN defined in linux/module.h, I think this is
enough for module names:
 #define MODULE_NAME_LEN (64 - sizeof(unsigned long))

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 kernel/params.c |8 +++-
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/kernel/params.c b/kernel/params.c
index 7686417..a085b40 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -376,8 +376,6 @@ int param_get_string(char *buffer, struct kernel_param *kp)
 
 extern struct kernel_param __start___param[], __stop___param[];
 
-#define MAX_KBUILD_MODNAME KOBJ_NAME_LEN
-
 struct param_attribute
 {
struct module_attribute mattr;
@@ -588,7 +586,7 @@ static void __init param_sysfs_builtin(void)
 {
struct kernel_param *kp, *kp_begin = NULL;
unsigned int i, name_len, count = 0;
-   char modname[MAX_KBUILD_MODNAME + 1] = "";
+   char modname[MODULE_NAME_LEN + 1] = "";
 
for (i=0; i < __stop___param - __start___param; i++) {
char *dot;
@@ -596,12 +594,12 @@ static void __init param_sysfs_builtin(void)
 
kp = &__start___param[i];
max_name_len =
-   min_t(size_t, MAX_KBUILD_MODNAME, strlen(kp->name));
+   min_t(size_t, MODULE_NAME_LEN, strlen(kp->name));
 
dot = memchr(kp->name, '.', max_name_len);
if (!dot) {
DEBUGP("couldn't find period in first %d characters "
-  "of %s\n", MAX_KBUILD_MODNAME, kp->name);
+  "of %s\n", MODULE_NAME_LEN, kp->name);
continue;
}
name_len = dot - kp->name;
-- 
1.5.3.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] kernel/params.c: fix the module name length in param_sysfs_builtin

2008-01-21 Thread Denis Cheng
the original code use KOBJ_NAME_LEN for built-in module name length,
that's defined to 20 in linux/kobject.h, but this is not enough appearntly,
many module names are longer than this;
 #define KOBJ_NAME_LEN   20

another macro is MODULE_NAME_LEN defined in linux/module.h, I think this is
enough for module names:
 #define MODULE_NAME_LEN (64 - sizeof(unsigned long))

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 kernel/params.c |8 +++-
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/kernel/params.c b/kernel/params.c
index 7686417..a085b40 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -376,8 +376,6 @@ int param_get_string(char *buffer, struct kernel_param *kp)
 
 extern struct kernel_param __start___param[], __stop___param[];
 
-#define MAX_KBUILD_MODNAME KOBJ_NAME_LEN
-
 struct param_attribute
 {
struct module_attribute mattr;
@@ -588,7 +586,7 @@ static void __init param_sysfs_builtin(void)
 {
struct kernel_param *kp, *kp_begin = NULL;
unsigned int i, name_len, count = 0;
-   char modname[MAX_KBUILD_MODNAME + 1] = "";
+   char modname[MODULE_NAME_LEN + 1] = "";
 
for (i=0; i < __stop___param - __start___param; i++) {
char *dot;
@@ -596,12 +594,12 @@ static void __init param_sysfs_builtin(void)
 
kp = &__start___param[i];
max_name_len =
-   min_t(size_t, MAX_KBUILD_MODNAME, strlen(kp->name));
+   min_t(size_t, MODULE_NAME_LEN, strlen(kp->name));
 
dot = memchr(kp->name, '.', max_name_len);
if (!dot) {
DEBUGP("couldn't find period in first %d characters "
-  "of %s\n", MAX_KBUILD_MODNAME, kp->name);
+  "of %s\n", MODULE_NAME_LEN, kp->name);
continue;
}
name_len = dot - kp->name;
-- 
1.5.3.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] kernel/params.c: fix the module name length in param_sysfs_builtin

2008-01-21 Thread Denis Cheng
the original code use KOBJ_NAME_LEN for built-in module name length,
that's defined to 20 in linux/kobject.h, but this is not enough,
some module names(such as nf_conntrack_proto_icmp) are longer than this;
 #define KOBJ_NAME_LEN   20

another macro is MODULE_NAME_LEN defined in linux/module.h, I think this is
enough for module names:
 #define MODULE_NAME_LEN (64 - sizeof(unsigned long))

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 kernel/params.c |8 +++-
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/kernel/params.c b/kernel/params.c
index 7686417..a085b40 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -376,8 +376,6 @@ int param_get_string(char *buffer, struct kernel_param *kp)
 
 extern struct kernel_param __start___param[], __stop___param[];
 
-#define MAX_KBUILD_MODNAME KOBJ_NAME_LEN
-
 struct param_attribute
 {
struct module_attribute mattr;
@@ -588,7 +586,7 @@ static void __init param_sysfs_builtin(void)
 {
struct kernel_param *kp, *kp_begin = NULL;
unsigned int i, name_len, count = 0;
-   char modname[MAX_KBUILD_MODNAME + 1] = ;
+   char modname[MODULE_NAME_LEN + 1] = ;
 
for (i=0; i  __stop___param - __start___param; i++) {
char *dot;
@@ -596,12 +594,12 @@ static void __init param_sysfs_builtin(void)
 
kp = __start___param[i];
max_name_len =
-   min_t(size_t, MAX_KBUILD_MODNAME, strlen(kp-name));
+   min_t(size_t, MODULE_NAME_LEN, strlen(kp-name));
 
dot = memchr(kp-name, '.', max_name_len);
if (!dot) {
DEBUGP(couldn't find period in first %d characters 
-  of %s\n, MAX_KBUILD_MODNAME, kp-name);
+  of %s\n, MODULE_NAME_LEN, kp-name);
continue;
}
name_len = dot - kp-name;
-- 
1.5.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] kernel/params.c: fix the module name length in param_sysfs_builtin

2008-01-21 Thread Denis Cheng
the original code use KOBJ_NAME_LEN for built-in module name length,
that's defined to 20 in linux/kobject.h, but this is not enough appearntly,
many module names are longer than this;
 #define KOBJ_NAME_LEN   20

another macro is MODULE_NAME_LEN defined in linux/module.h, I think this is
enough for module names:
 #define MODULE_NAME_LEN (64 - sizeof(unsigned long))

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 kernel/params.c |8 +++-
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/kernel/params.c b/kernel/params.c
index 7686417..a085b40 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -376,8 +376,6 @@ int param_get_string(char *buffer, struct kernel_param *kp)
 
 extern struct kernel_param __start___param[], __stop___param[];
 
-#define MAX_KBUILD_MODNAME KOBJ_NAME_LEN
-
 struct param_attribute
 {
struct module_attribute mattr;
@@ -588,7 +586,7 @@ static void __init param_sysfs_builtin(void)
 {
struct kernel_param *kp, *kp_begin = NULL;
unsigned int i, name_len, count = 0;
-   char modname[MAX_KBUILD_MODNAME + 1] = ;
+   char modname[MODULE_NAME_LEN + 1] = ;
 
for (i=0; i  __stop___param - __start___param; i++) {
char *dot;
@@ -596,12 +594,12 @@ static void __init param_sysfs_builtin(void)
 
kp = __start___param[i];
max_name_len =
-   min_t(size_t, MAX_KBUILD_MODNAME, strlen(kp-name));
+   min_t(size_t, MODULE_NAME_LEN, strlen(kp-name));
 
dot = memchr(kp-name, '.', max_name_len);
if (!dot) {
DEBUGP(couldn't find period in first %d characters 
-  of %s\n, MAX_KBUILD_MODNAME, kp-name);
+  of %s\n, MODULE_NAME_LEN, kp-name);
continue;
}
name_len = dot - kp-name;
-- 
1.5.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] PROC_FS: get and set the smp affinity of tasks by read-write /proc//smp_affinity

2008-01-03 Thread Denis Cheng
this adds a read-write /proc//smp_affinity entry,
just like what /proc/irq//smp_affinity does,
so now we can get and set the affinity of tasks by procfs,
this is especially useful used in shell scripts.

this also adds a read-write /proc//tasks//smp_affinity
for the same purpose.

Cc: Eli M Dow <[EMAIL PROTECTED]>
Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 fs/proc/base.c |   57 
 1 files changed, 57 insertions(+), 0 deletions(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 7411bfb..ca0cbc2 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1083,6 +1083,57 @@ static const struct file_operations 
proc_pid_sched_operations = {
 
 #endif
 
+#ifdef CONFIG_SMP
+static ssize_t smp_affinity_read(struct file *file,
+   char __user *buf, size_t count, loff_t *ppos)
+{
+   cpumask_t mask;
+   char *page;
+   ssize_t length;
+   pid_t pid = pid_nr(proc_pid(file->f_dentry->d_inode));
+
+   length = sched_getaffinity(pid, );
+   if (length < 0)
+   return length;
+
+   if (count > PROC_BLOCK_SIZE)
+   count = PROC_BLOCK_SIZE;
+
+   page = (char *)__get_free_page(GFP_TEMPORARY);
+   if (!page)
+   return -ENOMEM;
+
+   length = cpumask_scnprintf(page, count, mask);
+   length += sprintf(page + length, "\n");
+   length = simple_read_from_buffer(buf, count, ppos, page, length);
+   free_page((unsigned long) page);
+
+   return length;
+}
+
+static ssize_t smp_affinity_write(struct file *file,
+   const char __user *buf, size_t count, loff_t *ppos)
+{
+   cpumask_t mask;
+   int ret;
+   pid_t pid = pid_nr(proc_pid(file->f_dentry->d_inode));
+
+   ret = cpumask_parse_user(buf, count, mask);
+   if (ret < 0)
+   return ret;
+   ret = sched_setaffinity(pid, mask);
+   if (ret < 0)
+   return ret;
+
+   return count;
+}
+
+static const struct file_operations proc_smp_affinity_operations = {
+   .read  = smp_affinity_read,
+   .write = smp_affinity_write,
+};
+#endif
+
 static void *proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
struct inode *inode = dentry->d_inode;
@@ -2230,6 +2281,9 @@ static const struct pid_entry tgid_base_stuff[] = {
 #ifdef CONFIG_SCHEDSTATS
INF("schedstat",  S_IRUGO, pid_schedstat),
 #endif
+#ifdef CONFIG_SMP
+   REG("smp_affinity", S_IRUGO|S_IWUSR, smp_affinity),
+#endif
 #ifdef CONFIG_PROC_PID_CPUSET
REG("cpuset", S_IRUGO, cpuset),
 #endif
@@ -2555,6 +2609,9 @@ static const struct pid_entry tid_base_stuff[] = {
 #ifdef CONFIG_SCHEDSTATS
INF("schedstat", S_IRUGO, pid_schedstat),
 #endif
+#ifdef CONFIG_SMP
+   REG("smp_affinity", S_IRUGO|S_IWUSR, smp_affinity),
+#endif
 #ifdef CONFIG_PROC_PID_CPUSET
REG("cpuset",S_IRUGO, cpuset),
 #endif
-- 
1.5.3.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] PROC_FS: get and set the smp affinity of tasks by read-write /proc/pid/smp_affinity

2008-01-03 Thread Denis Cheng
this adds a read-write /proc/pid/smp_affinity entry,
just like what /proc/irq/irq/smp_affinity does,
so now we can get and set the affinity of tasks by procfs,
this is especially useful used in shell scripts.

this also adds a read-write /proc/pid/tasks/tid/smp_affinity
for the same purpose.

Cc: Eli M Dow [EMAIL PROTECTED]
Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 fs/proc/base.c |   57 
 1 files changed, 57 insertions(+), 0 deletions(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 7411bfb..ca0cbc2 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1083,6 +1083,57 @@ static const struct file_operations 
proc_pid_sched_operations = {
 
 #endif
 
+#ifdef CONFIG_SMP
+static ssize_t smp_affinity_read(struct file *file,
+   char __user *buf, size_t count, loff_t *ppos)
+{
+   cpumask_t mask;
+   char *page;
+   ssize_t length;
+   pid_t pid = pid_nr(proc_pid(file-f_dentry-d_inode));
+
+   length = sched_getaffinity(pid, mask);
+   if (length  0)
+   return length;
+
+   if (count  PROC_BLOCK_SIZE)
+   count = PROC_BLOCK_SIZE;
+
+   page = (char *)__get_free_page(GFP_TEMPORARY);
+   if (!page)
+   return -ENOMEM;
+
+   length = cpumask_scnprintf(page, count, mask);
+   length += sprintf(page + length, \n);
+   length = simple_read_from_buffer(buf, count, ppos, page, length);
+   free_page((unsigned long) page);
+
+   return length;
+}
+
+static ssize_t smp_affinity_write(struct file *file,
+   const char __user *buf, size_t count, loff_t *ppos)
+{
+   cpumask_t mask;
+   int ret;
+   pid_t pid = pid_nr(proc_pid(file-f_dentry-d_inode));
+
+   ret = cpumask_parse_user(buf, count, mask);
+   if (ret  0)
+   return ret;
+   ret = sched_setaffinity(pid, mask);
+   if (ret  0)
+   return ret;
+
+   return count;
+}
+
+static const struct file_operations proc_smp_affinity_operations = {
+   .read  = smp_affinity_read,
+   .write = smp_affinity_write,
+};
+#endif
+
 static void *proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
struct inode *inode = dentry-d_inode;
@@ -2230,6 +2281,9 @@ static const struct pid_entry tgid_base_stuff[] = {
 #ifdef CONFIG_SCHEDSTATS
INF(schedstat,  S_IRUGO, pid_schedstat),
 #endif
+#ifdef CONFIG_SMP
+   REG(smp_affinity, S_IRUGO|S_IWUSR, smp_affinity),
+#endif
 #ifdef CONFIG_PROC_PID_CPUSET
REG(cpuset, S_IRUGO, cpuset),
 #endif
@@ -2555,6 +2609,9 @@ static const struct pid_entry tid_base_stuff[] = {
 #ifdef CONFIG_SCHEDSTATS
INF(schedstat, S_IRUGO, pid_schedstat),
 #endif
+#ifdef CONFIG_SMP
+   REG(smp_affinity, S_IRUGO|S_IWUSR, smp_affinity),
+#endif
 #ifdef CONFIG_PROC_PID_CPUSET
REG(cpuset,S_IRUGO, cpuset),
 #endif
-- 
1.5.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] 3W RAID drivers: memset not needed in probe

2007-12-08 Thread Denis Cheng
the memory return from scsi_host_alloc is alloced by kzalloc,
which is already zero initilized, so memset not needed.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 drivers/scsi/3w-9xxx.c |2 --
 drivers/scsi/3w-.c |2 --
 2 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index afb262b..cb28511 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -2028,8 +2028,6 @@ static int __devinit twa_probe(struct pci_dev *pdev, 
const struct pci_device_id
}
tw_dev = (TW_Device_Extension *)host->hostdata;
 
-   memset(tw_dev, 0, sizeof(TW_Device_Extension));
-
/* Save values to device extension */
tw_dev->host = host;
tw_dev->tw_pci_dev = pdev;
diff --git a/drivers/scsi/3w-.c b/drivers/scsi/3w-.c
index 59716eb..a8c12d7 100644
--- a/drivers/scsi/3w-.c
+++ b/drivers/scsi/3w-.c
@@ -2295,8 +2295,6 @@ static int __devinit tw_probe(struct pci_dev *pdev, const 
struct pci_device_id *
}
tw_dev = (TW_Device_Extension *)host->hostdata;
 
-   memset(tw_dev, 0, sizeof(TW_Device_Extension));
-
/* Save values to device extension */
tw_dev->host = host;
tw_dev->tw_pci_dev = pdev;
-- 
1.5.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] 3W RAID drivers: memset not needed in probe

2007-12-08 Thread Denis Cheng
the memory return from scsi_host_alloc is alloced by kzalloc,
which is already zero initilized, so memset not needed.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 drivers/scsi/3w-9xxx.c |2 --
 drivers/scsi/3w-.c |2 --
 2 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index afb262b..cb28511 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -2028,8 +2028,6 @@ static int __devinit twa_probe(struct pci_dev *pdev, 
const struct pci_device_id
}
tw_dev = (TW_Device_Extension *)host-hostdata;
 
-   memset(tw_dev, 0, sizeof(TW_Device_Extension));
-
/* Save values to device extension */
tw_dev-host = host;
tw_dev-tw_pci_dev = pdev;
diff --git a/drivers/scsi/3w-.c b/drivers/scsi/3w-.c
index 59716eb..a8c12d7 100644
--- a/drivers/scsi/3w-.c
+++ b/drivers/scsi/3w-.c
@@ -2295,8 +2295,6 @@ static int __devinit tw_probe(struct pci_dev *pdev, const 
struct pci_device_id *
}
tw_dev = (TW_Device_Extension *)host-hostdata;
 
-   memset(tw_dev, 0, sizeof(TW_Device_Extension));
-
/* Save values to device extension */
tw_dev-host = host;
tw_dev-tw_pci_dev = pdev;
-- 
1.5.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 20/20] net/iucv/iucv.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
these three list_head are all local variables, but can also use LIST_HEAD.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 net/iucv/iucv.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c
index 7698f6c..f13fe88 100644
--- a/net/iucv/iucv.c
+++ b/net/iucv/iucv.c
@@ -1492,7 +1492,7 @@ static void iucv_tasklet_fn(unsigned long ignored)
[0x08] = iucv_message_pending,
[0x09] = iucv_message_pending,
};
-   struct list_head task_queue = LIST_HEAD_INIT(task_queue);
+   LIST_HEAD(task_queue);
struct iucv_irq_list *p, *n;
 
/* Serialize tasklet, iucv_path_sever and iucv_path_connect. */
@@ -1526,7 +1526,7 @@ static void iucv_tasklet_fn(unsigned long ignored)
 static void iucv_work_fn(struct work_struct *work)
 {
typedef void iucv_irq_fn(struct iucv_irq_data *);
-   struct list_head work_queue = LIST_HEAD_INIT(work_queue);
+   LIST_HEAD(work_queue);
struct iucv_irq_list *p, *n;
 
/* Serialize tasklet, iucv_path_sever and iucv_path_connect. */
-- 
1.5.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 18/20] drivers/char/ipmi/ipmi_msghandler.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
these three list_head are all local variables, but can also use LIST_HEAD.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 drivers/char/ipmi/ipmi_msghandler.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/char/ipmi/ipmi_msghandler.c 
b/drivers/char/ipmi/ipmi_msghandler.c
index d01c4ff..32b2b22 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -441,7 +441,7 @@ struct watcher_entry {
 int ipmi_smi_watcher_register(struct ipmi_smi_watcher *watcher)
 {
ipmi_smi_t intf;
-   struct list_head to_deliver = LIST_HEAD_INIT(to_deliver);
+   LIST_HEAD(to_deliver);
struct watcher_entry *e, *e2;
 
mutex_lock(_watchers_mutex);
-- 
1.5.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 19/20] drivers/dma/iop-adma.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
these three list_head are all local variables, but can also use LIST_HEAD.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 drivers/dma/iop-adma.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/iop-adma.c b/drivers/dma/iop-adma.c
index e5c62b7..b011b5a 100644
--- a/drivers/dma/iop-adma.c
+++ b/drivers/dma/iop-adma.c
@@ -284,7 +284,7 @@ iop_adma_alloc_slots(struct iop_adma_chan *iop_chan, int 
num_slots,
int slots_per_op)
 {
struct iop_adma_desc_slot *iter, *_iter, *alloc_start = NULL;
-   struct list_head chain = LIST_HEAD_INIT(chain);
+   LIST_HEAD(chain);
int slots_found, retry = 0;
 
/* start search from the last allocated descrtiptor
-- 
1.5.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 17/20] net/xfrm/xfrm_state.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 net/xfrm/xfrm_state.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index cf43c49..452d972 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -1657,7 +1657,7 @@ void xfrm_replay_advance(struct xfrm_state *x, __be32 
net_seq)
 }
 EXPORT_SYMBOL(xfrm_replay_advance);
 
-static struct list_head xfrm_km_list = LIST_HEAD_INIT(xfrm_km_list);
+static LIST_HEAD(xfrm_km_list);
 static DEFINE_RWLOCK(xfrm_km_lock);
 
 void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c)
-- 
1.5.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 16/20] net/x25/: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 net/x25/x25_forward.c |2 +-
 net/x25/x25_link.c|2 +-
 net/x25/x25_route.c   |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/x25/x25_forward.c b/net/x25/x25_forward.c
index 8738ec7..4dd8ff7 100644
--- a/net/x25/x25_forward.c
+++ b/net/x25/x25_forward.c
@@ -12,7 +12,7 @@
 #include 
 #include 
 
-struct list_head x25_forward_list = LIST_HEAD_INIT(x25_forward_list);
+LIST_HEAD(x25_forward_list);
 DEFINE_RWLOCK(x25_forward_list_lock);
 
 int x25_forward_call(struct x25_address *dest_addr, struct x25_neigh *from,
diff --git a/net/x25/x25_link.c b/net/x25/x25_link.c
index 741ce95..4a3602e 100644
--- a/net/x25/x25_link.c
+++ b/net/x25/x25_link.c
@@ -30,7 +30,7 @@
 #include 
 #include 
 
-static struct list_head x25_neigh_list = LIST_HEAD_INIT(x25_neigh_list);
+static LIST_HEAD(x25_neigh_list);
 static DEFINE_RWLOCK(x25_neigh_list_lock);
 
 static void x25_t20timer_expiry(unsigned long);
diff --git a/net/x25/x25_route.c b/net/x25/x25_route.c
index 86b5b4d..2c999cc 100644
--- a/net/x25/x25_route.c
+++ b/net/x25/x25_route.c
@@ -21,7 +21,7 @@
 #include 
 #include 
 
-struct list_head x25_route_list = LIST_HEAD_INIT(x25_route_list);
+LIST_HEAD(x25_route_list);
 DEFINE_RWLOCK(x25_route_list_lock);
 
 /*
-- 
1.5.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 15/20] net/lapb/lapb_iface.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 net/lapb/lapb_iface.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/lapb/lapb_iface.c b/net/lapb/lapb_iface.c
index a2e7aa6..2ba1bc4 100644
--- a/net/lapb/lapb_iface.c
+++ b/net/lapb/lapb_iface.c
@@ -39,7 +39,7 @@
 #include 
 #include 
 
-static struct list_head lapb_list = LIST_HEAD_INIT(lapb_list);
+static LIST_HEAD(lapb_list);
 static DEFINE_RWLOCK(lapb_list_lock);
 
 /*
-- 
1.5.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 14/20] net/ipv4/cipso_ipv4.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 net/ipv4/cipso_ipv4.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
index f18e88b..d4dc4eb 100644
--- a/net/ipv4/cipso_ipv4.c
+++ b/net/ipv4/cipso_ipv4.c
@@ -63,7 +63,7 @@ struct cipso_v4_domhsh_entry {
  * probably be turned into a hash table or something similar so we
  * can do quick lookups. */
 static DEFINE_SPINLOCK(cipso_v4_doi_list_lock);
-static struct list_head cipso_v4_doi_list = LIST_HEAD_INIT(cipso_v4_doi_list);
+static LIST_HEAD(cipso_v4_doi_list);
 
 /* Label mapping cache */
 int cipso_v4_cache_enabled = 1;
-- 
1.5.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 13/20] net/core/dev.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 net/core/dev.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 86d6261..7626db4 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3501,7 +3501,7 @@ static int dev_new_index(struct net *net)
 
 /* Delayed registration/unregisteration */
 static DEFINE_SPINLOCK(net_todo_list_lock);
-static struct list_head net_todo_list = LIST_HEAD_INIT(net_todo_list);
+static LIST_HEAD(net_todo_list);
 
 static void net_set_todo(struct net_device *dev)
 {
-- 
1.5.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 12/20] fs/reiserfs/xattr.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 fs/reiserfs/xattr.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index 1597f6b..a5bd23c 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -1084,7 +1084,7 @@ ssize_t reiserfs_listxattr(struct dentry * dentry, char 
*buffer, size_t size)
 }
 
 /* This is the implementation for the xattr plugin infrastructure */
-static struct list_head xattr_handlers = LIST_HEAD_INIT(xattr_handlers);
+static LIST_HEAD(xattr_handlers);
 static DEFINE_RWLOCK(handler_lock);
 
 static struct reiserfs_xattr_handler *find_xattr_handler_prefix(const char
-- 
1.5.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 11/20] fs/afs/cell.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 fs/afs/cell.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/afs/cell.c b/fs/afs/cell.c
index 970d38f..b4a09ab 100644
--- a/fs/afs/cell.c
+++ b/fs/afs/cell.c
@@ -20,7 +20,7 @@
 DECLARE_RWSEM(afs_proc_cells_sem);
 LIST_HEAD(afs_proc_cells);
 
-static struct list_head afs_cells = LIST_HEAD_INIT(afs_cells);
+static LIST_HEAD(afs_cells);
 static DEFINE_RWLOCK(afs_cells_lock);
 static DECLARE_RWSEM(afs_cells_sem); /* add/remove serialisation */
 static DECLARE_WAIT_QUEUE_HEAD(afs_cells_freeable_wq);
-- 
1.5.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 10/20] drivers/scsi/ipr.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 drivers/scsi/ipr.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 0841df0..9018ee8 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -84,7 +84,7 @@
 /*
  *   Global Data
  */
-static struct list_head ipr_ioa_head = LIST_HEAD_INIT(ipr_ioa_head);
+static LIST_HEAD(ipr_ioa_head);
 static unsigned int ipr_log_level = IPR_DEFAULT_LOG_LEVEL;
 static unsigned int ipr_max_speed = 1;
 static int ipr_testmode = 0;
-- 
1.5.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 09/20] drivers/s390/: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 drivers/s390/block/dcssblk.c  |2 +-
 drivers/s390/char/raw3270.c   |4 ++--
 drivers/s390/char/tape_core.c |2 +-
 drivers/s390/net/netiucv.c|3 +--
 drivers/s390/net/smsgiucv.c   |2 +-
 5 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c
index 15a5789..7779bfc 100644
--- a/drivers/s390/block/dcssblk.c
+++ b/drivers/s390/block/dcssblk.c
@@ -82,7 +82,7 @@ struct dcssblk_dev_info {
struct request_queue *dcssblk_queue;
 };
 
-static struct list_head dcssblk_devices = LIST_HEAD_INIT(dcssblk_devices);
+static LIST_HEAD(dcssblk_devices);
 static struct rw_semaphore dcssblk_devices_sem;
 
 /*
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c
index 8d1c64a..0d98f1f 100644
--- a/drivers/s390/char/raw3270.c
+++ b/drivers/s390/char/raw3270.c
@@ -66,7 +66,7 @@ struct raw3270 {
 static DEFINE_MUTEX(raw3270_mutex);
 
 /* List of 3270 devices. */
-static struct list_head raw3270_devices = LIST_HEAD_INIT(raw3270_devices);
+static LIST_HEAD(raw3270_devices);
 
 /*
  * Flag to indicate if the driver has been registered. Some operations
@@ -1210,7 +1210,7 @@ struct raw3270_notifier {
void (*notifier)(int, int);
 };
 
-static struct list_head raw3270_notifier = LIST_HEAD_INIT(raw3270_notifier);
+static LIST_HEAD(raw3270_notifier);
 
 int raw3270_register_notifier(void (*notifier)(int, int))
 {
diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c
index 2fae633..7ad8cf1 100644
--- a/drivers/s390/char/tape_core.c
+++ b/drivers/s390/char/tape_core.c
@@ -37,7 +37,7 @@ static void tape_long_busy_timeout(unsigned long data);
  * we can assign the devices to minor numbers of the same major
  * The list is protected by the rwlock
  */
-static struct list_head tape_device_list = LIST_HEAD_INIT(tape_device_list);
+static LIST_HEAD(tape_device_list);
 static DEFINE_RWLOCK(tape_device_lock);
 
 /*
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
index 4d18d64..f385350 100644
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -198,8 +198,7 @@ struct iucv_connection {
 /**
  * Linked list of all connection structs.
  */
-static struct list_head iucv_connection_list =
-   LIST_HEAD_INIT(iucv_connection_list);
+static LIST_HEAD(iucv_connection_list);
 static DEFINE_RWLOCK(iucv_connection_rwlock);
 
 /**
diff --git a/drivers/s390/net/smsgiucv.c b/drivers/s390/net/smsgiucv.c
index 47bb47b..8735a41 100644
--- a/drivers/s390/net/smsgiucv.c
+++ b/drivers/s390/net/smsgiucv.c
@@ -42,7 +42,7 @@ MODULE_DESCRIPTION ("Linux for S/390 IUCV special message 
driver");
 static struct iucv_path *smsg_path;
 
 static DEFINE_SPINLOCK(smsg_list_lock);
-static struct list_head smsg_list = LIST_HEAD_INIT(smsg_list);
+static LIST_HEAD(smsg_list);
 
 static int smsg_path_pending(struct iucv_path *, u8 ipvmid[8], u8 ipuser[16]);
 static void smsg_message_pending(struct iucv_path *, struct iucv_message *);
-- 
1.5.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 09/20] drivers/s390/: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 drivers/s390/block/dcssblk.c  |2 +-
 drivers/s390/char/raw3270.c   |4 ++--
 drivers/s390/char/tape_core.c |2 +-
 drivers/s390/net/netiucv.c|3 +--
 drivers/s390/net/smsgiucv.c   |2 +-
 5 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c
index 15a5789..7779bfc 100644
--- a/drivers/s390/block/dcssblk.c
+++ b/drivers/s390/block/dcssblk.c
@@ -82,7 +82,7 @@ struct dcssblk_dev_info {
struct request_queue *dcssblk_queue;
 };
 
-static struct list_head dcssblk_devices = LIST_HEAD_INIT(dcssblk_devices);
+static LIST_HEAD(dcssblk_devices);
 static struct rw_semaphore dcssblk_devices_sem;
 
 /*
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c
index 8d1c64a..0d98f1f 100644
--- a/drivers/s390/char/raw3270.c
+++ b/drivers/s390/char/raw3270.c
@@ -66,7 +66,7 @@ struct raw3270 {
 static DEFINE_MUTEX(raw3270_mutex);
 
 /* List of 3270 devices. */
-static struct list_head raw3270_devices = LIST_HEAD_INIT(raw3270_devices);
+static LIST_HEAD(raw3270_devices);
 
 /*
  * Flag to indicate if the driver has been registered. Some operations
@@ -1210,7 +1210,7 @@ struct raw3270_notifier {
void (*notifier)(int, int);
 };
 
-static struct list_head raw3270_notifier = LIST_HEAD_INIT(raw3270_notifier);
+static LIST_HEAD(raw3270_notifier);
 
 int raw3270_register_notifier(void (*notifier)(int, int))
 {
diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c
index 2fae633..7ad8cf1 100644
--- a/drivers/s390/char/tape_core.c
+++ b/drivers/s390/char/tape_core.c
@@ -37,7 +37,7 @@ static void tape_long_busy_timeout(unsigned long data);
  * we can assign the devices to minor numbers of the same major
  * The list is protected by the rwlock
  */
-static struct list_head tape_device_list = LIST_HEAD_INIT(tape_device_list);
+static LIST_HEAD(tape_device_list);
 static DEFINE_RWLOCK(tape_device_lock);
 
 /*
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
index 4d18d64..f385350 100644
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -198,8 +198,7 @@ struct iucv_connection {
 /**
  * Linked list of all connection structs.
  */
-static struct list_head iucv_connection_list =
-   LIST_HEAD_INIT(iucv_connection_list);
+static LIST_HEAD(iucv_connection_list);
 static DEFINE_RWLOCK(iucv_connection_rwlock);
 
 /**
diff --git a/drivers/s390/net/smsgiucv.c b/drivers/s390/net/smsgiucv.c
index 47bb47b..8735a41 100644
--- a/drivers/s390/net/smsgiucv.c
+++ b/drivers/s390/net/smsgiucv.c
@@ -42,7 +42,7 @@ MODULE_DESCRIPTION (Linux for S/390 IUCV special message 
driver);
 static struct iucv_path *smsg_path;
 
 static DEFINE_SPINLOCK(smsg_list_lock);
-static struct list_head smsg_list = LIST_HEAD_INIT(smsg_list);
+static LIST_HEAD(smsg_list);
 
 static int smsg_path_pending(struct iucv_path *, u8 ipvmid[8], u8 ipuser[16]);
 static void smsg_message_pending(struct iucv_path *, struct iucv_message *);
-- 
1.5.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 10/20] drivers/scsi/ipr.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 drivers/scsi/ipr.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 0841df0..9018ee8 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -84,7 +84,7 @@
 /*
  *   Global Data
  */
-static struct list_head ipr_ioa_head = LIST_HEAD_INIT(ipr_ioa_head);
+static LIST_HEAD(ipr_ioa_head);
 static unsigned int ipr_log_level = IPR_DEFAULT_LOG_LEVEL;
 static unsigned int ipr_max_speed = 1;
 static int ipr_testmode = 0;
-- 
1.5.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 11/20] fs/afs/cell.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 fs/afs/cell.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/afs/cell.c b/fs/afs/cell.c
index 970d38f..b4a09ab 100644
--- a/fs/afs/cell.c
+++ b/fs/afs/cell.c
@@ -20,7 +20,7 @@
 DECLARE_RWSEM(afs_proc_cells_sem);
 LIST_HEAD(afs_proc_cells);
 
-static struct list_head afs_cells = LIST_HEAD_INIT(afs_cells);
+static LIST_HEAD(afs_cells);
 static DEFINE_RWLOCK(afs_cells_lock);
 static DECLARE_RWSEM(afs_cells_sem); /* add/remove serialisation */
 static DECLARE_WAIT_QUEUE_HEAD(afs_cells_freeable_wq);
-- 
1.5.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 12/20] fs/reiserfs/xattr.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 fs/reiserfs/xattr.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index 1597f6b..a5bd23c 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -1084,7 +1084,7 @@ ssize_t reiserfs_listxattr(struct dentry * dentry, char 
*buffer, size_t size)
 }
 
 /* This is the implementation for the xattr plugin infrastructure */
-static struct list_head xattr_handlers = LIST_HEAD_INIT(xattr_handlers);
+static LIST_HEAD(xattr_handlers);
 static DEFINE_RWLOCK(handler_lock);
 
 static struct reiserfs_xattr_handler *find_xattr_handler_prefix(const char
-- 
1.5.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 13/20] net/core/dev.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 net/core/dev.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 86d6261..7626db4 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3501,7 +3501,7 @@ static int dev_new_index(struct net *net)
 
 /* Delayed registration/unregisteration */
 static DEFINE_SPINLOCK(net_todo_list_lock);
-static struct list_head net_todo_list = LIST_HEAD_INIT(net_todo_list);
+static LIST_HEAD(net_todo_list);
 
 static void net_set_todo(struct net_device *dev)
 {
-- 
1.5.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 14/20] net/ipv4/cipso_ipv4.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 net/ipv4/cipso_ipv4.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
index f18e88b..d4dc4eb 100644
--- a/net/ipv4/cipso_ipv4.c
+++ b/net/ipv4/cipso_ipv4.c
@@ -63,7 +63,7 @@ struct cipso_v4_domhsh_entry {
  * probably be turned into a hash table or something similar so we
  * can do quick lookups. */
 static DEFINE_SPINLOCK(cipso_v4_doi_list_lock);
-static struct list_head cipso_v4_doi_list = LIST_HEAD_INIT(cipso_v4_doi_list);
+static LIST_HEAD(cipso_v4_doi_list);
 
 /* Label mapping cache */
 int cipso_v4_cache_enabled = 1;
-- 
1.5.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 15/20] net/lapb/lapb_iface.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 net/lapb/lapb_iface.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/lapb/lapb_iface.c b/net/lapb/lapb_iface.c
index a2e7aa6..2ba1bc4 100644
--- a/net/lapb/lapb_iface.c
+++ b/net/lapb/lapb_iface.c
@@ -39,7 +39,7 @@
 #include linux/init.h
 #include net/lapb.h
 
-static struct list_head lapb_list = LIST_HEAD_INIT(lapb_list);
+static LIST_HEAD(lapb_list);
 static DEFINE_RWLOCK(lapb_list_lock);
 
 /*
-- 
1.5.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 16/20] net/x25/: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 net/x25/x25_forward.c |2 +-
 net/x25/x25_link.c|2 +-
 net/x25/x25_route.c   |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/x25/x25_forward.c b/net/x25/x25_forward.c
index 8738ec7..4dd8ff7 100644
--- a/net/x25/x25_forward.c
+++ b/net/x25/x25_forward.c
@@ -12,7 +12,7 @@
 #include linux/init.h
 #include net/x25.h
 
-struct list_head x25_forward_list = LIST_HEAD_INIT(x25_forward_list);
+LIST_HEAD(x25_forward_list);
 DEFINE_RWLOCK(x25_forward_list_lock);
 
 int x25_forward_call(struct x25_address *dest_addr, struct x25_neigh *from,
diff --git a/net/x25/x25_link.c b/net/x25/x25_link.c
index 741ce95..4a3602e 100644
--- a/net/x25/x25_link.c
+++ b/net/x25/x25_link.c
@@ -30,7 +30,7 @@
 #include linux/init.h
 #include net/x25.h
 
-static struct list_head x25_neigh_list = LIST_HEAD_INIT(x25_neigh_list);
+static LIST_HEAD(x25_neigh_list);
 static DEFINE_RWLOCK(x25_neigh_list_lock);
 
 static void x25_t20timer_expiry(unsigned long);
diff --git a/net/x25/x25_route.c b/net/x25/x25_route.c
index 86b5b4d..2c999cc 100644
--- a/net/x25/x25_route.c
+++ b/net/x25/x25_route.c
@@ -21,7 +21,7 @@
 #include linux/init.h
 #include net/x25.h
 
-struct list_head x25_route_list = LIST_HEAD_INIT(x25_route_list);
+LIST_HEAD(x25_route_list);
 DEFINE_RWLOCK(x25_route_list_lock);
 
 /*
-- 
1.5.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 17/20] net/xfrm/xfrm_state.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 net/xfrm/xfrm_state.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index cf43c49..452d972 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -1657,7 +1657,7 @@ void xfrm_replay_advance(struct xfrm_state *x, __be32 
net_seq)
 }
 EXPORT_SYMBOL(xfrm_replay_advance);
 
-static struct list_head xfrm_km_list = LIST_HEAD_INIT(xfrm_km_list);
+static LIST_HEAD(xfrm_km_list);
 static DEFINE_RWLOCK(xfrm_km_lock);
 
 void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c)
-- 
1.5.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 18/20] drivers/char/ipmi/ipmi_msghandler.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
these three list_head are all local variables, but can also use LIST_HEAD.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 drivers/char/ipmi/ipmi_msghandler.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/char/ipmi/ipmi_msghandler.c 
b/drivers/char/ipmi/ipmi_msghandler.c
index d01c4ff..32b2b22 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -441,7 +441,7 @@ struct watcher_entry {
 int ipmi_smi_watcher_register(struct ipmi_smi_watcher *watcher)
 {
ipmi_smi_t intf;
-   struct list_head to_deliver = LIST_HEAD_INIT(to_deliver);
+   LIST_HEAD(to_deliver);
struct watcher_entry *e, *e2;
 
mutex_lock(smi_watchers_mutex);
-- 
1.5.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 19/20] drivers/dma/iop-adma.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
these three list_head are all local variables, but can also use LIST_HEAD.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 drivers/dma/iop-adma.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/iop-adma.c b/drivers/dma/iop-adma.c
index e5c62b7..b011b5a 100644
--- a/drivers/dma/iop-adma.c
+++ b/drivers/dma/iop-adma.c
@@ -284,7 +284,7 @@ iop_adma_alloc_slots(struct iop_adma_chan *iop_chan, int 
num_slots,
int slots_per_op)
 {
struct iop_adma_desc_slot *iter, *_iter, *alloc_start = NULL;
-   struct list_head chain = LIST_HEAD_INIT(chain);
+   LIST_HEAD(chain);
int slots_found, retry = 0;
 
/* start search from the last allocated descrtiptor
-- 
1.5.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 20/20] net/iucv/iucv.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-06 Thread Denis Cheng
these three list_head are all local variables, but can also use LIST_HEAD.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 net/iucv/iucv.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c
index 7698f6c..f13fe88 100644
--- a/net/iucv/iucv.c
+++ b/net/iucv/iucv.c
@@ -1492,7 +1492,7 @@ static void iucv_tasklet_fn(unsigned long ignored)
[0x08] = iucv_message_pending,
[0x09] = iucv_message_pending,
};
-   struct list_head task_queue = LIST_HEAD_INIT(task_queue);
+   LIST_HEAD(task_queue);
struct iucv_irq_list *p, *n;
 
/* Serialize tasklet, iucv_path_sever and iucv_path_connect. */
@@ -1526,7 +1526,7 @@ static void iucv_tasklet_fn(unsigned long ignored)
 static void iucv_work_fn(struct work_struct *work)
 {
typedef void iucv_irq_fn(struct iucv_irq_data *);
-   struct list_head work_queue = LIST_HEAD_INIT(work_queue);
+   LIST_HEAD(work_queue);
struct iucv_irq_list *p, *n;
 
/* Serialize tasklet, iucv_path_sever and iucv_path_connect. */
-- 
1.5.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 08/20] drivers/net/wan/lapbether.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-05 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 drivers/net/wan/lapbether.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
index fb37b80..824df3b 100644
--- a/drivers/net/wan/lapbether.c
+++ b/drivers/net/wan/lapbether.c
@@ -58,7 +58,7 @@ struct lapbethdev {
struct net_device_stats stats;  /* some statistics */
 };
 
-static struct list_head lapbeth_devices = LIST_HEAD_INIT(lapbeth_devices);
+static LIST_HEAD(lapbeth_devices);
 
 /*  */
 
-- 
1.5.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 07/20] drivers/edac/: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-05 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 drivers/edac/edac_device.c |2 +-
 drivers/edac/edac_mc.c |2 +-
 drivers/edac/edac_pci.c|2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c
index f3690a6..6f0b522 100644
--- a/drivers/edac/edac_device.c
+++ b/drivers/edac/edac_device.c
@@ -36,7 +36,7 @@
  * is protected by the 'device_ctls_mutex' lock
  */
 static DEFINE_MUTEX(device_ctls_mutex);
-static struct list_head edac_device_list = LIST_HEAD_INIT(edac_device_list);
+static LIST_HEAD(edac_device_list);
 
 #ifdef CONFIG_EDAC_DEBUG
 static void edac_device_dump_device(struct edac_device_ctl_info *edac_dev)
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 063a1bf..9cd778f 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -36,7 +36,7 @@
 
 /* lock to memory controller's control array */
 static DEFINE_MUTEX(mem_ctls_mutex);
-static struct list_head mc_devices = LIST_HEAD_INIT(mc_devices);
+static LIST_HEAD(mc_devices);
 
 #ifdef CONFIG_EDAC_DEBUG
 
diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c
index 5dee9f5..dabba2d 100644
--- a/drivers/edac/edac_pci.c
+++ b/drivers/edac/edac_pci.c
@@ -29,7 +29,7 @@
 #include "edac_module.h"
 
 static DEFINE_MUTEX(edac_pci_ctls_mutex);
-static struct list_head edac_pci_list = LIST_HEAD_INIT(edac_pci_list);
+static LIST_HEAD(edac_pci_list);
 
 /*
  * edac_pci_alloc_ctl_info
-- 
1.5.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 07/20] drivers/edac/: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-05 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 drivers/edac/edac_device.c |2 +-
 drivers/edac/edac_mc.c |2 +-
 drivers/edac/edac_pci.c|2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c
index f3690a6..6f0b522 100644
--- a/drivers/edac/edac_device.c
+++ b/drivers/edac/edac_device.c
@@ -36,7 +36,7 @@
  * is protected by the 'device_ctls_mutex' lock
  */
 static DEFINE_MUTEX(device_ctls_mutex);
-static struct list_head edac_device_list = LIST_HEAD_INIT(edac_device_list);
+static LIST_HEAD(edac_device_list);
 
 #ifdef CONFIG_EDAC_DEBUG
 static void edac_device_dump_device(struct edac_device_ctl_info *edac_dev)
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 063a1bf..9cd778f 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -36,7 +36,7 @@
 
 /* lock to memory controller's control array */
 static DEFINE_MUTEX(mem_ctls_mutex);
-static struct list_head mc_devices = LIST_HEAD_INIT(mc_devices);
+static LIST_HEAD(mc_devices);
 
 #ifdef CONFIG_EDAC_DEBUG
 
diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c
index 5dee9f5..dabba2d 100644
--- a/drivers/edac/edac_pci.c
+++ b/drivers/edac/edac_pci.c
@@ -29,7 +29,7 @@
 #include "edac_module.h"
 
 static DEFINE_MUTEX(edac_pci_ctls_mutex);
-static struct list_head edac_pci_list = LIST_HEAD_INIT(edac_pci_list);
+static LIST_HEAD(edac_pci_list);
 
 /*
  * edac_pci_alloc_ctl_info
-- 
1.5.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 06/20] drivers/char: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-05 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 drivers/char/hvc_console.c  |2 +-
 drivers/char/hvcs.c |2 +-
 drivers/char/ipmi/ipmi_msghandler.c |4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index 8252f86..9e64211 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -93,7 +93,7 @@ struct hvc_struct {
 };
 
 /* dynamic list of hvc_struct instances */
-static struct list_head hvc_structs = LIST_HEAD_INIT(hvc_structs);
+static LIST_HEAD(hvc_structs);
 
 /*
  * Protect the list of hvc_struct instances from inserts and removals during
diff --git a/drivers/char/hvcs.c b/drivers/char/hvcs.c
index 69d8866..ae60e0e 100644
--- a/drivers/char/hvcs.c
+++ b/drivers/char/hvcs.c
@@ -310,7 +310,7 @@ struct hvcs_struct {
 /* Required to back map a kobject to its containing object */
 #define from_kobj(kobj) container_of(kobj, struct hvcs_struct, kobj)
 
-static struct list_head hvcs_structs = LIST_HEAD_INIT(hvcs_structs);
+static LIST_HEAD(hvcs_structs);
 static DEFINE_SPINLOCK(hvcs_structs_lock);
 
 static void hvcs_unthrottle(struct tty_struct *tty);
diff --git a/drivers/char/ipmi/ipmi_msghandler.c 
b/drivers/char/ipmi/ipmi_msghandler.c
index 5dc1265..d01c4ff 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -365,12 +365,12 @@ static struct device_driver ipmidriver = {
 };
 static DEFINE_MUTEX(ipmidriver_mutex);
 
-static struct list_head ipmi_interfaces = LIST_HEAD_INIT(ipmi_interfaces);
+static LIST_HEAD(ipmi_interfaces);
 static DEFINE_MUTEX(ipmi_interfaces_mutex);
 
 /* List of watchers that want to know when smi's are added and
deleted. */
-static struct list_head smi_watchers = LIST_HEAD_INIT(smi_watchers);
+static LIST_HEAD(smi_watchers);
 static DEFINE_MUTEX(smi_watchers_mutex);
 
 
-- 
1.5.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 05/20] crypto/async_tx/async_tx.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-05 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 crypto/async_tx/async_tx.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/crypto/async_tx/async_tx.c b/crypto/async_tx/async_tx.c
index bc18cbb..f39777f 100644
--- a/crypto/async_tx/async_tx.c
+++ b/crypto/async_tx/async_tx.c
@@ -57,8 +57,7 @@ static struct chan_ref_percpu *channel_table[DMA_TX_TYPE_END];
  */
 static spinlock_t async_tx_lock;
 
-static struct list_head
-async_tx_master_list = LIST_HEAD_INIT(async_tx_master_list);
+static LIST_HEAD(async_tx_master_list);
 
 /* async_tx_issue_pending_all - start all transactions on all channels */
 void async_tx_issue_pending_all(void)
-- 
1.5.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 04/20] arch/x86/mm/pageattr_32.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-05 Thread Denis Cheng
Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 arch/x86/mm/pageattr_32.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/mm/pageattr_32.c b/arch/x86/mm/pageattr_32.c
index 260073c..f223cc0 100644
--- a/arch/x86/mm/pageattr_32.c
+++ b/arch/x86/mm/pageattr_32.c
@@ -15,7 +15,7 @@
 #include 
 
 static DEFINE_SPINLOCK(cpa_lock);
-static struct list_head df_list = LIST_HEAD_INIT(df_list);
+static LIST_HEAD(df_list);
 
 
 pte_t *lookup_address(unsigned long address) 
-- 
1.5.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers/base: use LIST_HEAD instead of call to INIT_LIST_HEAD in __init

2007-12-05 Thread Denis Cheng
LIST_HEAD has been widely used, so switch to this simpler method.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 drivers/base/attribute_container.c |9 +
 drivers/base/base.h|1 -
 drivers/base/init.c|1 -
 3 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/drivers/base/attribute_container.c 
b/drivers/base/attribute_container.c
index 7370d7c..d4dfb97 100644
--- a/drivers/base/attribute_container.c
+++ b/drivers/base/attribute_container.c
@@ -61,7 +61,7 @@ attribute_container_classdev_to_container(struct class_device 
*classdev)
 }
 EXPORT_SYMBOL_GPL(attribute_container_classdev_to_container);
 
-static struct list_head attribute_container_list;
+static LIST_HEAD(attribute_container_list);
 
 static DEFINE_MUTEX(attribute_container_mutex);
 
@@ -429,10 +429,3 @@ attribute_container_find_class_device(struct 
attribute_container *cont,
return cdev;
 }
 EXPORT_SYMBOL_GPL(attribute_container_find_class_device);
-
-int __init
-attribute_container_init(void)
-{
-   INIT_LIST_HEAD(_container_list);
-   return 0;
-}
diff --git a/drivers/base/base.h b/drivers/base/base.h
index 10b2fb6..8bddd74 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -13,7 +13,6 @@ static inline int hypervisor_init(void) { return 0; }
 extern int platform_bus_init(void);
 extern int system_bus_init(void);
 extern int cpu_dev_init(void);
-extern int attribute_container_init(void);
 
 extern int bus_add_device(struct device * dev);
 extern void bus_attach_device(struct device * dev);
diff --git a/drivers/base/init.c b/drivers/base/init.c
index 3713815..1da88a1 100644
--- a/drivers/base/init.c
+++ b/drivers/base/init.c
@@ -36,5 +36,4 @@ void __init driver_init(void)
system_bus_init();
cpu_dev_init();
memory_dev_init();
-   attribute_container_init();
 }
-- 
1.5.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 07/20] drivers/edac/: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-05 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 drivers/edac/edac_device.c |2 +-
 drivers/edac/edac_mc.c |2 +-
 drivers/edac/edac_pci.c|2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c
index f3690a6..6f0b522 100644
--- a/drivers/edac/edac_device.c
+++ b/drivers/edac/edac_device.c
@@ -36,7 +36,7 @@
  * is protected by the 'device_ctls_mutex' lock
  */
 static DEFINE_MUTEX(device_ctls_mutex);
-static struct list_head edac_device_list = LIST_HEAD_INIT(edac_device_list);
+static LIST_HEAD(edac_device_list);
 
 #ifdef CONFIG_EDAC_DEBUG
 static void edac_device_dump_device(struct edac_device_ctl_info *edac_dev)
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 063a1bf..9cd778f 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -36,7 +36,7 @@
 
 /* lock to memory controller's control array */
 static DEFINE_MUTEX(mem_ctls_mutex);
-static struct list_head mc_devices = LIST_HEAD_INIT(mc_devices);
+static LIST_HEAD(mc_devices);
 
 #ifdef CONFIG_EDAC_DEBUG
 
diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c
index 5dee9f5..dabba2d 100644
--- a/drivers/edac/edac_pci.c
+++ b/drivers/edac/edac_pci.c
@@ -29,7 +29,7 @@
 #include edac_module.h
 
 static DEFINE_MUTEX(edac_pci_ctls_mutex);
-static struct list_head edac_pci_list = LIST_HEAD_INIT(edac_pci_list);
+static LIST_HEAD(edac_pci_list);
 
 /*
  * edac_pci_alloc_ctl_info
-- 
1.5.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers/base: use LIST_HEAD instead of call to INIT_LIST_HEAD in __init

2007-12-05 Thread Denis Cheng
LIST_HEAD has been widely used, so switch to this simpler method.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 drivers/base/attribute_container.c |9 +
 drivers/base/base.h|1 -
 drivers/base/init.c|1 -
 3 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/drivers/base/attribute_container.c 
b/drivers/base/attribute_container.c
index 7370d7c..d4dfb97 100644
--- a/drivers/base/attribute_container.c
+++ b/drivers/base/attribute_container.c
@@ -61,7 +61,7 @@ attribute_container_classdev_to_container(struct class_device 
*classdev)
 }
 EXPORT_SYMBOL_GPL(attribute_container_classdev_to_container);
 
-static struct list_head attribute_container_list;
+static LIST_HEAD(attribute_container_list);
 
 static DEFINE_MUTEX(attribute_container_mutex);
 
@@ -429,10 +429,3 @@ attribute_container_find_class_device(struct 
attribute_container *cont,
return cdev;
 }
 EXPORT_SYMBOL_GPL(attribute_container_find_class_device);
-
-int __init
-attribute_container_init(void)
-{
-   INIT_LIST_HEAD(attribute_container_list);
-   return 0;
-}
diff --git a/drivers/base/base.h b/drivers/base/base.h
index 10b2fb6..8bddd74 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -13,7 +13,6 @@ static inline int hypervisor_init(void) { return 0; }
 extern int platform_bus_init(void);
 extern int system_bus_init(void);
 extern int cpu_dev_init(void);
-extern int attribute_container_init(void);
 
 extern int bus_add_device(struct device * dev);
 extern void bus_attach_device(struct device * dev);
diff --git a/drivers/base/init.c b/drivers/base/init.c
index 3713815..1da88a1 100644
--- a/drivers/base/init.c
+++ b/drivers/base/init.c
@@ -36,5 +36,4 @@ void __init driver_init(void)
system_bus_init();
cpu_dev_init();
memory_dev_init();
-   attribute_container_init();
 }
-- 
1.5.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 05/20] crypto/async_tx/async_tx.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-05 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 crypto/async_tx/async_tx.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/crypto/async_tx/async_tx.c b/crypto/async_tx/async_tx.c
index bc18cbb..f39777f 100644
--- a/crypto/async_tx/async_tx.c
+++ b/crypto/async_tx/async_tx.c
@@ -57,8 +57,7 @@ static struct chan_ref_percpu *channel_table[DMA_TX_TYPE_END];
  */
 static spinlock_t async_tx_lock;
 
-static struct list_head
-async_tx_master_list = LIST_HEAD_INIT(async_tx_master_list);
+static LIST_HEAD(async_tx_master_list);
 
 /* async_tx_issue_pending_all - start all transactions on all channels */
 void async_tx_issue_pending_all(void)
-- 
1.5.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 07/20] drivers/edac/: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-05 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 drivers/edac/edac_device.c |2 +-
 drivers/edac/edac_mc.c |2 +-
 drivers/edac/edac_pci.c|2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c
index f3690a6..6f0b522 100644
--- a/drivers/edac/edac_device.c
+++ b/drivers/edac/edac_device.c
@@ -36,7 +36,7 @@
  * is protected by the 'device_ctls_mutex' lock
  */
 static DEFINE_MUTEX(device_ctls_mutex);
-static struct list_head edac_device_list = LIST_HEAD_INIT(edac_device_list);
+static LIST_HEAD(edac_device_list);
 
 #ifdef CONFIG_EDAC_DEBUG
 static void edac_device_dump_device(struct edac_device_ctl_info *edac_dev)
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 063a1bf..9cd778f 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -36,7 +36,7 @@
 
 /* lock to memory controller's control array */
 static DEFINE_MUTEX(mem_ctls_mutex);
-static struct list_head mc_devices = LIST_HEAD_INIT(mc_devices);
+static LIST_HEAD(mc_devices);
 
 #ifdef CONFIG_EDAC_DEBUG
 
diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c
index 5dee9f5..dabba2d 100644
--- a/drivers/edac/edac_pci.c
+++ b/drivers/edac/edac_pci.c
@@ -29,7 +29,7 @@
 #include edac_module.h
 
 static DEFINE_MUTEX(edac_pci_ctls_mutex);
-static struct list_head edac_pci_list = LIST_HEAD_INIT(edac_pci_list);
+static LIST_HEAD(edac_pci_list);
 
 /*
  * edac_pci_alloc_ctl_info
-- 
1.5.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 06/20] drivers/char: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-05 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 drivers/char/hvc_console.c  |2 +-
 drivers/char/hvcs.c |2 +-
 drivers/char/ipmi/ipmi_msghandler.c |4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index 8252f86..9e64211 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -93,7 +93,7 @@ struct hvc_struct {
 };
 
 /* dynamic list of hvc_struct instances */
-static struct list_head hvc_structs = LIST_HEAD_INIT(hvc_structs);
+static LIST_HEAD(hvc_structs);
 
 /*
  * Protect the list of hvc_struct instances from inserts and removals during
diff --git a/drivers/char/hvcs.c b/drivers/char/hvcs.c
index 69d8866..ae60e0e 100644
--- a/drivers/char/hvcs.c
+++ b/drivers/char/hvcs.c
@@ -310,7 +310,7 @@ struct hvcs_struct {
 /* Required to back map a kobject to its containing object */
 #define from_kobj(kobj) container_of(kobj, struct hvcs_struct, kobj)
 
-static struct list_head hvcs_structs = LIST_HEAD_INIT(hvcs_structs);
+static LIST_HEAD(hvcs_structs);
 static DEFINE_SPINLOCK(hvcs_structs_lock);
 
 static void hvcs_unthrottle(struct tty_struct *tty);
diff --git a/drivers/char/ipmi/ipmi_msghandler.c 
b/drivers/char/ipmi/ipmi_msghandler.c
index 5dc1265..d01c4ff 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -365,12 +365,12 @@ static struct device_driver ipmidriver = {
 };
 static DEFINE_MUTEX(ipmidriver_mutex);
 
-static struct list_head ipmi_interfaces = LIST_HEAD_INIT(ipmi_interfaces);
+static LIST_HEAD(ipmi_interfaces);
 static DEFINE_MUTEX(ipmi_interfaces_mutex);
 
 /* List of watchers that want to know when smi's are added and
deleted. */
-static struct list_head smi_watchers = LIST_HEAD_INIT(smi_watchers);
+static LIST_HEAD(smi_watchers);
 static DEFINE_MUTEX(smi_watchers_mutex);
 
 
-- 
1.5.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 04/20] arch/x86/mm/pageattr_32.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-05 Thread Denis Cheng
Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 arch/x86/mm/pageattr_32.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/mm/pageattr_32.c b/arch/x86/mm/pageattr_32.c
index 260073c..f223cc0 100644
--- a/arch/x86/mm/pageattr_32.c
+++ b/arch/x86/mm/pageattr_32.c
@@ -15,7 +15,7 @@
 #include asm/sections.h
 
 static DEFINE_SPINLOCK(cpa_lock);
-static struct list_head df_list = LIST_HEAD_INIT(df_list);
+static LIST_HEAD(df_list);
 
 
 pte_t *lookup_address(unsigned long address) 
-- 
1.5.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 08/20] drivers/net/wan/lapbether.c: use LIST_HEAD instead of LIST_HEAD_INIT

2007-12-05 Thread Denis Cheng
single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 drivers/net/wan/lapbether.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
index fb37b80..824df3b 100644
--- a/drivers/net/wan/lapbether.c
+++ b/drivers/net/wan/lapbether.c
@@ -58,7 +58,7 @@ struct lapbethdev {
struct net_device_stats stats;  /* some statistics */
 };
 
-static struct list_head lapbeth_devices = LIST_HEAD_INIT(lapbeth_devices);
+static LIST_HEAD(lapbeth_devices);
 
 /*  */
 
-- 
1.5.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mm/backing-dev.c: fix percpu_counter_destroy call bug in bdi_init

2007-12-02 Thread Denis Cheng
this call should use the array index j, not i:

--- mm/backing-dev.c.orig   2007-12-02 19:42:57.0 +0800
+++ mm/backing-dev.c2007-12-02 19:43:14.0 +0800
@@ -22,7 +22,7 @@ int bdi_init(struct backing_dev_info *bd
if (err) {
 err:
for (j = 0; j < i; j++)
-   percpu_counter_destroy(>bdi_stat[i]);
+   percpu_counter_destroy(>bdi_stat[j]);
}

return err;

but with this approach, just one int i is enough, int j is not needed.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 mm/backing-dev.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index b0ceb29..e8644b1 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -7,7 +7,7 @@
 
 int bdi_init(struct backing_dev_info *bdi)
 {
-   int i, j;
+   int i;
int err;
 
for (i = 0; i < NR_BDI_STAT_ITEMS; i++) {
@@ -21,7 +21,7 @@ int bdi_init(struct backing_dev_info *bdi)
 
if (err) {
 err:
-   for (j = 0; j < i; j++)
+   while (i--)
percpu_counter_destroy(>bdi_stat[i]);
}
 
-- 
1.5.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mm/backing-dev.c: fix percpu_counter_destroy call bug in bdi_init

2007-12-02 Thread Denis Cheng
this call should use the array index j, not i:

--- mm/backing-dev.c.orig   2007-12-02 19:42:57.0 +0800
+++ mm/backing-dev.c2007-12-02 19:43:14.0 +0800
@@ -22,7 +22,7 @@ int bdi_init(struct backing_dev_info *bd
if (err) {
 err:
for (j = 0; j  i; j++)
-   percpu_counter_destroy(bdi-bdi_stat[i]);
+   percpu_counter_destroy(bdi-bdi_stat[j]);
}

return err;

but with this approach, just one int i is enough, int j is not needed.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 mm/backing-dev.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index b0ceb29..e8644b1 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -7,7 +7,7 @@
 
 int bdi_init(struct backing_dev_info *bdi)
 {
-   int i, j;
+   int i;
int err;
 
for (i = 0; i  NR_BDI_STAT_ITEMS; i++) {
@@ -21,7 +21,7 @@ int bdi_init(struct backing_dev_info *bdi)
 
if (err) {
 err:
-   for (j = 0; j  i; j++)
+   while (i--)
percpu_counter_destroy(bdi-bdi_stat[i]);
}
 
-- 
1.5.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead

2007-11-26 Thread Denis Cheng
Cc: Randy Dunlap <[EMAIL PROTECTED]>
Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
this is against the lastest cryptodev tree.

 crypto/tcrypt.c |9 -
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 1e12b86..ae762c2 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -87,12 +87,11 @@ static char *check[] = {
"camellia", "seed", "salsa20", NULL
 };
 
-static void hexdump(unsigned char *buf, unsigned int len)
+static inline void hexdump(unsigned char *buf, unsigned int len)
 {
-   while (len--)
-   printk("%02x", *buf++);
-
-   printk("\n");
+   print_hex_dump(KERN_CONT, "", DUMP_PREFIX_OFFSET,
+   16, 1,
+   buf, len, 0);
 }
 
 static void tcrypt_complete(struct crypto_async_request *req, int err)
-- 
1.5.3.5

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] [RESEND] crypto test: use print_hex_dump from instead

2007-11-26 Thread Denis Cheng
this patch is against cryptodev-2.6, and have passed scripts/checkpatch.pl

KERN_DEBUG is stripped out, this acts more like the original in tcrypto.c

and the last parameter "bool ascii" set to zero to disable ascii output,
this could keep it happy on Unicode terminals.

Cc: Randy Dunlap <[EMAIL PROTECTED]>
Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 crypto/tcrypt.c |   30 --
 1 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 24141fb..665aa87 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -81,14 +81,6 @@ static char *check[] = {
"camellia", "seed", NULL
 };
 
-static void hexdump(unsigned char *buf, unsigned int len)
-{
-   while (len--)
-   printk("%02x", *buf++);
-
-   printk("\n");
-}
-
 static void tcrypt_complete(struct crypto_async_request *req, int err)
 {
struct tcrypt_result *res = req->data;
@@ -156,7 +148,9 @@ static void test_hash(char *algo, struct hash_testvec 
*template,
goto out;
}
 
-   hexdump(result, crypto_hash_digestsize(tfm));
+   print_hex_dump("", "", DUMP_PREFIX_OFFSET, 16, 1,
+   result, crypto_hash_digestsize(tfm), 0);
+
printk("%s\n",
   memcmp(result, hash_tv[i].digest,
  crypto_hash_digestsize(tfm)) ?
@@ -203,7 +197,9 @@ static void test_hash(char *algo, struct hash_testvec 
*template,
goto out;
}
 
-   hexdump(result, crypto_hash_digestsize(tfm));
+   print_hex_dump("", "", DUMP_PREFIX_OFFSET,
+   16, 1,
+   result, crypto_hash_digestsize(tfm), 0);
printk("%s\n",
   memcmp(result, hash_tv[i].digest,
  crypto_hash_digestsize(tfm)) ?
@@ -319,7 +315,9 @@ static void test_cipher(char *algo, int enc,
}
 
q = kmap(sg_page([0])) + sg[0].offset;
-   hexdump(q, cipher_tv[i].rlen);
+   print_hex_dump("", "", DUMP_PREFIX_OFFSET,
+   16, 1,
+   q, cipher_tv[i].rlen, 0);
 
printk("%s\n",
   memcmp(q, cipher_tv[i].result,
@@ -393,7 +391,9 @@ static void test_cipher(char *algo, int enc,
for (k = 0; k < cipher_tv[i].np; k++) {
printk("page %u\n", k);
q = kmap(sg_page([k])) + sg[k].offset;
-   hexdump(q, cipher_tv[i].tap[k]);
+   print_hex_dump("", "", DUMP_PREFIX_OFFSET,
+   16, 1,
+   q, cipher_tv[i].tap[k], 0);
printk("%s\n",
memcmp(q, cipher_tv[i].result + temp,
cipher_tv[i].tap[k]) ? "fail" :
@@ -839,7 +839,8 @@ static void test_deflate(void)
printk("fail: ret=%d\n", ret);
continue;
}
-   hexdump(result, dlen);
+   print_hex_dump("", "", DUMP_PREFIX_OFFSET, 16, 1,
+   result, dlen, 0);
printk("%s (ratio %d:%d)\n",
   memcmp(result, tv[i].output, dlen) ? "fail" : "pass",
   ilen, dlen);
@@ -870,7 +871,8 @@ static void test_deflate(void)
printk("fail: ret=%d\n", ret);
continue;
}
-   hexdump(result, dlen);
+   print_hex_dump("", "", DUMP_PREFIX_OFFSET, 16, 1,
+   result, dlen, 0);
printk("%s (ratio %d:%d)\n",
   memcmp(result, tv[i].output, dlen) ? "fail" : "pass",
   ilen, dlen);
-- 
1.5.3.4

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] [RESEND] crypto test: use print_hex_dump from linux/kernel.h instead

2007-11-26 Thread Denis Cheng
this patch is against cryptodev-2.6, and have passed scripts/checkpatch.pl

KERN_DEBUG is stripped out, this acts more like the original in tcrypto.c

and the last parameter bool ascii set to zero to disable ascii output,
this could keep it happy on Unicode terminals.

Cc: Randy Dunlap [EMAIL PROTECTED]
Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 crypto/tcrypt.c |   30 --
 1 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 24141fb..665aa87 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -81,14 +81,6 @@ static char *check[] = {
camellia, seed, NULL
 };
 
-static void hexdump(unsigned char *buf, unsigned int len)
-{
-   while (len--)
-   printk(%02x, *buf++);
-
-   printk(\n);
-}
-
 static void tcrypt_complete(struct crypto_async_request *req, int err)
 {
struct tcrypt_result *res = req-data;
@@ -156,7 +148,9 @@ static void test_hash(char *algo, struct hash_testvec 
*template,
goto out;
}
 
-   hexdump(result, crypto_hash_digestsize(tfm));
+   print_hex_dump(, , DUMP_PREFIX_OFFSET, 16, 1,
+   result, crypto_hash_digestsize(tfm), 0);
+
printk(%s\n,
   memcmp(result, hash_tv[i].digest,
  crypto_hash_digestsize(tfm)) ?
@@ -203,7 +197,9 @@ static void test_hash(char *algo, struct hash_testvec 
*template,
goto out;
}
 
-   hexdump(result, crypto_hash_digestsize(tfm));
+   print_hex_dump(, , DUMP_PREFIX_OFFSET,
+   16, 1,
+   result, crypto_hash_digestsize(tfm), 0);
printk(%s\n,
   memcmp(result, hash_tv[i].digest,
  crypto_hash_digestsize(tfm)) ?
@@ -319,7 +315,9 @@ static void test_cipher(char *algo, int enc,
}
 
q = kmap(sg_page(sg[0])) + sg[0].offset;
-   hexdump(q, cipher_tv[i].rlen);
+   print_hex_dump(, , DUMP_PREFIX_OFFSET,
+   16, 1,
+   q, cipher_tv[i].rlen, 0);
 
printk(%s\n,
   memcmp(q, cipher_tv[i].result,
@@ -393,7 +391,9 @@ static void test_cipher(char *algo, int enc,
for (k = 0; k  cipher_tv[i].np; k++) {
printk(page %u\n, k);
q = kmap(sg_page(sg[k])) + sg[k].offset;
-   hexdump(q, cipher_tv[i].tap[k]);
+   print_hex_dump(, , DUMP_PREFIX_OFFSET,
+   16, 1,
+   q, cipher_tv[i].tap[k], 0);
printk(%s\n,
memcmp(q, cipher_tv[i].result + temp,
cipher_tv[i].tap[k]) ? fail :
@@ -839,7 +839,8 @@ static void test_deflate(void)
printk(fail: ret=%d\n, ret);
continue;
}
-   hexdump(result, dlen);
+   print_hex_dump(, , DUMP_PREFIX_OFFSET, 16, 1,
+   result, dlen, 0);
printk(%s (ratio %d:%d)\n,
   memcmp(result, tv[i].output, dlen) ? fail : pass,
   ilen, dlen);
@@ -870,7 +871,8 @@ static void test_deflate(void)
printk(fail: ret=%d\n, ret);
continue;
}
-   hexdump(result, dlen);
+   print_hex_dump(, , DUMP_PREFIX_OFFSET, 16, 1,
+   result, dlen, 0);
printk(%s (ratio %d:%d)\n,
   memcmp(result, tv[i].output, dlen) ? fail : pass,
   ilen, dlen);
-- 
1.5.3.4

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead

2007-11-26 Thread Denis Cheng
Cc: Randy Dunlap [EMAIL PROTECTED]
Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
this is against the lastest cryptodev tree.

 crypto/tcrypt.c |9 -
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 1e12b86..ae762c2 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -87,12 +87,11 @@ static char *check[] = {
camellia, seed, salsa20, NULL
 };
 
-static void hexdump(unsigned char *buf, unsigned int len)
+static inline void hexdump(unsigned char *buf, unsigned int len)
 {
-   while (len--)
-   printk(%02x, *buf++);
-
-   printk(\n);
+   print_hex_dump(KERN_CONT, , DUMP_PREFIX_OFFSET,
+   16, 1,
+   buf, len, 0);
 }
 
 static void tcrypt_complete(struct crypto_async_request *req, int err)
-- 
1.5.3.5

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] ide-scsi: use print_hex_dump from

2007-11-25 Thread Denis Cheng
these utilities implemented in lib/hexdump.c are more handy, please use this.

Cc: Randy Dunlap <[EMAIL PROTECTED]>
Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
there are still much other private hexdump implementations in the source,
which reinvent the wheel, we can find them through:

  $ grep -RsIn hexdump 
  ...

 drivers/scsi/ide-scsi.c |   18 --
 1 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index 8d0244c..8f3fc1d 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -242,16 +242,6 @@ static void idescsi_output_buffers (ide_drive_t *drive, 
idescsi_pc_t *pc, unsign
}
 }
 
-static void hexdump(u8 *x, int len)
-{
-   int i;
-
-   printk("[ ");
-   for (i = 0; i < len; i++)
-   printk("%x ", x[i]);
-   printk("]\n");
-}
-
 static int idescsi_check_condition(ide_drive_t *drive, struct request 
*failed_command)
 {
idescsi_scsi_t *scsi = drive_to_idescsi(drive);
@@ -282,7 +272,7 @@ static int idescsi_check_condition(ide_drive_t *drive, 
struct request *failed_co
pc->scsi_cmd = ((idescsi_pc_t *) failed_command->special)->scsi_cmd;
if (test_bit(IDESCSI_LOG_CMD, >log)) {
printk ("ide-scsi: %s: queue cmd = ", drive->name);
-   hexdump(pc->c, 6);
+   print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 1, 
pc->c, 6, 1);
}
rq->rq_disk = scsi->disk;
return ide_do_drive_cmd(drive, rq, ide_preempt);
@@ -337,7 +327,7 @@ static int idescsi_end_request (ide_drive_t *drive, int 
uptodate, int nrsecs)
idescsi_pc_t *opc = (idescsi_pc_t *) rq->buffer;
if (log) {
printk ("ide-scsi: %s: wrap up check %lu, rst = ", 
drive->name, opc->scsi_cmd->serial_number);
-   hexdump(pc->buffer,16);
+   print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 
1, pc->buffer, 16, 1);
}
memcpy((void *) opc->scsi_cmd->sense_buffer, pc->buffer, 
SCSI_SENSE_BUFFERSIZE);
kfree(pc->buffer);
@@ -816,10 +806,10 @@ static int idescsi_queue (struct scsi_cmnd *cmd,
 
if (test_bit(IDESCSI_LOG_CMD, >log)) {
printk ("ide-scsi: %s: que %lu, cmd = ", drive->name, 
cmd->serial_number);
-   hexdump(cmd->cmnd, cmd->cmd_len);
+   print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 1, 
cmd->cmnd, cmd->cmd_len, 1);
if (memcmp(pc->c, cmd->cmnd, cmd->cmd_len)) {
printk ("ide-scsi: %s: que %lu, tsl = ", drive->name, 
cmd->serial_number);
-   hexdump(pc->c, 12);
+   print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 
1, pc->c, 12, 1);
}
}
 
-- 
1.5.3.5

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] crypto test: use print_hex_dump from

2007-11-25 Thread Denis Cheng
these utilities implemented in lib/hexdump.c are more handy, please use this.

Cc: Randy Dunlap <[EMAIL PROTECTED]>
Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 crypto/tcrypt.c |   21 +++--
 1 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 24141fb..8766023 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -81,14 +81,6 @@ static char *check[] = {
"camellia", "seed", NULL
 };
 
-static void hexdump(unsigned char *buf, unsigned int len)
-{
-   while (len--)
-   printk("%02x", *buf++);
-
-   printk("\n");
-}
-
 static void tcrypt_complete(struct crypto_async_request *req, int err)
 {
struct tcrypt_result *res = req->data;
@@ -156,7 +148,8 @@ static void test_hash(char *algo, struct hash_testvec 
*template,
goto out;
}
 
-   hexdump(result, crypto_hash_digestsize(tfm));
+   print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 1, 
result, crypto_hash_digestsize(tfm), 1);
+
printk("%s\n",
   memcmp(result, hash_tv[i].digest,
  crypto_hash_digestsize(tfm)) ?
@@ -203,7 +196,7 @@ static void test_hash(char *algo, struct hash_testvec 
*template,
goto out;
}
 
-   hexdump(result, crypto_hash_digestsize(tfm));
+   print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 
1, result, crypto_hash_digestsize(tfm), 1);
printk("%s\n",
   memcmp(result, hash_tv[i].digest,
  crypto_hash_digestsize(tfm)) ?
@@ -319,7 +312,7 @@ static void test_cipher(char *algo, int enc,
}
 
q = kmap(sg_page([0])) + sg[0].offset;
-   hexdump(q, cipher_tv[i].rlen);
+   print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 
1, q, cipher_tv[i].rlen, 1);
 
printk("%s\n",
   memcmp(q, cipher_tv[i].result,
@@ -393,7 +386,7 @@ static void test_cipher(char *algo, int enc,
for (k = 0; k < cipher_tv[i].np; k++) {
printk("page %u\n", k);
q = kmap(sg_page([k])) + sg[k].offset;
-   hexdump(q, cipher_tv[i].tap[k]);
+   print_hex_dump(KERN_DEBUG, "", 
DUMP_PREFIX_OFFSET, 16, 1, q, cipher_tv[i].tap[k], 1);
printk("%s\n",
memcmp(q, cipher_tv[i].result + temp,
cipher_tv[i].tap[k]) ? "fail" :
@@ -839,7 +832,7 @@ static void test_deflate(void)
printk("fail: ret=%d\n", ret);
continue;
}
-   hexdump(result, dlen);
+   print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 1, 
result, dlen, 1);
printk("%s (ratio %d:%d)\n",
   memcmp(result, tv[i].output, dlen) ? "fail" : "pass",
   ilen, dlen);
@@ -870,7 +863,7 @@ static void test_deflate(void)
printk("fail: ret=%d\n", ret);
continue;
}
-   hexdump(result, dlen);
+   print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 1, 
result, dlen, 1);
printk("%s (ratio %d:%d)\n",
   memcmp(result, tv[i].output, dlen) ? "fail" : "pass",
   ilen, dlen);
-- 
1.5.3.5

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] crypto test: use print_hex_dump from linux/kernel.h

2007-11-25 Thread Denis Cheng
these utilities implemented in lib/hexdump.c are more handy, please use this.

Cc: Randy Dunlap [EMAIL PROTECTED]
Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 crypto/tcrypt.c |   21 +++--
 1 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 24141fb..8766023 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -81,14 +81,6 @@ static char *check[] = {
camellia, seed, NULL
 };
 
-static void hexdump(unsigned char *buf, unsigned int len)
-{
-   while (len--)
-   printk(%02x, *buf++);
-
-   printk(\n);
-}
-
 static void tcrypt_complete(struct crypto_async_request *req, int err)
 {
struct tcrypt_result *res = req-data;
@@ -156,7 +148,8 @@ static void test_hash(char *algo, struct hash_testvec 
*template,
goto out;
}
 
-   hexdump(result, crypto_hash_digestsize(tfm));
+   print_hex_dump(KERN_DEBUG, , DUMP_PREFIX_OFFSET, 16, 1, 
result, crypto_hash_digestsize(tfm), 1);
+
printk(%s\n,
   memcmp(result, hash_tv[i].digest,
  crypto_hash_digestsize(tfm)) ?
@@ -203,7 +196,7 @@ static void test_hash(char *algo, struct hash_testvec 
*template,
goto out;
}
 
-   hexdump(result, crypto_hash_digestsize(tfm));
+   print_hex_dump(KERN_DEBUG, , DUMP_PREFIX_OFFSET, 16, 
1, result, crypto_hash_digestsize(tfm), 1);
printk(%s\n,
   memcmp(result, hash_tv[i].digest,
  crypto_hash_digestsize(tfm)) ?
@@ -319,7 +312,7 @@ static void test_cipher(char *algo, int enc,
}
 
q = kmap(sg_page(sg[0])) + sg[0].offset;
-   hexdump(q, cipher_tv[i].rlen);
+   print_hex_dump(KERN_DEBUG, , DUMP_PREFIX_OFFSET, 16, 
1, q, cipher_tv[i].rlen, 1);
 
printk(%s\n,
   memcmp(q, cipher_tv[i].result,
@@ -393,7 +386,7 @@ static void test_cipher(char *algo, int enc,
for (k = 0; k  cipher_tv[i].np; k++) {
printk(page %u\n, k);
q = kmap(sg_page(sg[k])) + sg[k].offset;
-   hexdump(q, cipher_tv[i].tap[k]);
+   print_hex_dump(KERN_DEBUG, , 
DUMP_PREFIX_OFFSET, 16, 1, q, cipher_tv[i].tap[k], 1);
printk(%s\n,
memcmp(q, cipher_tv[i].result + temp,
cipher_tv[i].tap[k]) ? fail :
@@ -839,7 +832,7 @@ static void test_deflate(void)
printk(fail: ret=%d\n, ret);
continue;
}
-   hexdump(result, dlen);
+   print_hex_dump(KERN_DEBUG, , DUMP_PREFIX_OFFSET, 16, 1, 
result, dlen, 1);
printk(%s (ratio %d:%d)\n,
   memcmp(result, tv[i].output, dlen) ? fail : pass,
   ilen, dlen);
@@ -870,7 +863,7 @@ static void test_deflate(void)
printk(fail: ret=%d\n, ret);
continue;
}
-   hexdump(result, dlen);
+   print_hex_dump(KERN_DEBUG, , DUMP_PREFIX_OFFSET, 16, 1, 
result, dlen, 1);
printk(%s (ratio %d:%d)\n,
   memcmp(result, tv[i].output, dlen) ? fail : pass,
   ilen, dlen);
-- 
1.5.3.5

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] ide-scsi: use print_hex_dump from linux/kernel.h

2007-11-25 Thread Denis Cheng
these utilities implemented in lib/hexdump.c are more handy, please use this.

Cc: Randy Dunlap [EMAIL PROTECTED]
Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
there are still much other private hexdump implementations in the source,
which reinvent the wheel, we can find them through:

  $ grep -RsIn hexdump kernel-src
  ...

 drivers/scsi/ide-scsi.c |   18 --
 1 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index 8d0244c..8f3fc1d 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -242,16 +242,6 @@ static void idescsi_output_buffers (ide_drive_t *drive, 
idescsi_pc_t *pc, unsign
}
 }
 
-static void hexdump(u8 *x, int len)
-{
-   int i;
-
-   printk([ );
-   for (i = 0; i  len; i++)
-   printk(%x , x[i]);
-   printk(]\n);
-}
-
 static int idescsi_check_condition(ide_drive_t *drive, struct request 
*failed_command)
 {
idescsi_scsi_t *scsi = drive_to_idescsi(drive);
@@ -282,7 +272,7 @@ static int idescsi_check_condition(ide_drive_t *drive, 
struct request *failed_co
pc-scsi_cmd = ((idescsi_pc_t *) failed_command-special)-scsi_cmd;
if (test_bit(IDESCSI_LOG_CMD, scsi-log)) {
printk (ide-scsi: %s: queue cmd = , drive-name);
-   hexdump(pc-c, 6);
+   print_hex_dump(KERN_DEBUG, , DUMP_PREFIX_OFFSET, 16, 1, 
pc-c, 6, 1);
}
rq-rq_disk = scsi-disk;
return ide_do_drive_cmd(drive, rq, ide_preempt);
@@ -337,7 +327,7 @@ static int idescsi_end_request (ide_drive_t *drive, int 
uptodate, int nrsecs)
idescsi_pc_t *opc = (idescsi_pc_t *) rq-buffer;
if (log) {
printk (ide-scsi: %s: wrap up check %lu, rst = , 
drive-name, opc-scsi_cmd-serial_number);
-   hexdump(pc-buffer,16);
+   print_hex_dump(KERN_DEBUG, , DUMP_PREFIX_OFFSET, 16, 
1, pc-buffer, 16, 1);
}
memcpy((void *) opc-scsi_cmd-sense_buffer, pc-buffer, 
SCSI_SENSE_BUFFERSIZE);
kfree(pc-buffer);
@@ -816,10 +806,10 @@ static int idescsi_queue (struct scsi_cmnd *cmd,
 
if (test_bit(IDESCSI_LOG_CMD, scsi-log)) {
printk (ide-scsi: %s: que %lu, cmd = , drive-name, 
cmd-serial_number);
-   hexdump(cmd-cmnd, cmd-cmd_len);
+   print_hex_dump(KERN_DEBUG, , DUMP_PREFIX_OFFSET, 16, 1, 
cmd-cmnd, cmd-cmd_len, 1);
if (memcmp(pc-c, cmd-cmnd, cmd-cmd_len)) {
printk (ide-scsi: %s: que %lu, tsl = , drive-name, 
cmd-serial_number);
-   hexdump(pc-c, 12);
+   print_hex_dump(KERN_DEBUG, , DUMP_PREFIX_OFFSET, 16, 
1, pc-c, 12, 1);
}
}
 
-- 
1.5.3.5

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] SLUB: killed the unused "end" variable

2007-11-12 Thread Denis Cheng
Since the macro "for_each_object" introduced, the "end" variable becomes unused 
anymore.

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 mm/slub.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index 84f59fd..9acb413 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1080,7 +1080,6 @@ static struct page *new_slab(struct kmem_cache *s, gfp_t 
flags, int node)
struct page *page;
struct kmem_cache_node *n;
void *start;
-   void *end;
void *last;
void *p;
 
@@ -1101,7 +1100,6 @@ static struct page *new_slab(struct kmem_cache *s, gfp_t 
flags, int node)
SetSlabDebug(page);
 
start = page_address(page);
-   end = start + s->objects * s->size;
 
if (unlikely(s->flags & SLAB_POISON))
memset(start, POISON_INUSE, PAGE_SIZE << s->order);
-- 
1.5.3.4

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] SLUB: killed the unused end variable

2007-11-12 Thread Denis Cheng
Since the macro for_each_object introduced, the end variable becomes unused 
anymore.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 mm/slub.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index 84f59fd..9acb413 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1080,7 +1080,6 @@ static struct page *new_slab(struct kmem_cache *s, gfp_t 
flags, int node)
struct page *page;
struct kmem_cache_node *n;
void *start;
-   void *end;
void *last;
void *p;
 
@@ -1101,7 +1100,6 @@ static struct page *new_slab(struct kmem_cache *s, gfp_t 
flags, int node)
SetSlabDebug(page);
 
start = page_address(page);
-   end = start + s-objects * s-size;
 
if (unlikely(s-flags  SLAB_POISON))
memset(start, POISON_INUSE, PAGE_SIZE  s-order);
-- 
1.5.3.4

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] [sysfs]: make readlink result shorter when the symlink and its target shared some base sysfs subdirectory

2007-10-31 Thread Denis Cheng
this is especially useful after /sys/slab introduced, for example:

$ ls -l /sys/slab/mm_struct
lrwxrwxrwx 1 root root 0 2007-10-31 17:40 /sys/slab/mm_struct -> :448

instead of:

$ ls -l /sys/slab/mm_struct
lrwxrwxrwx 1 root root 0 2007-10-31 17:40 /sys/slab/mm_struct -> 
../slab/:448

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 fs/sysfs/symlink.c |   38 +++---
 1 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c
index 3eac20c..230a925 100644
--- a/fs/sysfs/symlink.c
+++ b/fs/sysfs/symlink.c
@@ -19,30 +19,41 @@
 
 #include "sysfs.h"
 
-static int object_depth(struct sysfs_dirent *sd)
+static struct sysfs_dirent *object_base(struct sysfs_dirent *parent,
+   struct sysfs_dirent *sd)
+{
+   for (; sd->s_parent; sd = sd->s_parent)
+   if (sd->s_parent == parent)
+   return parent;
+   return NULL;
+}
+
+static int object_depth(struct sysfs_dirent *base, struct sysfs_dirent *sd)
 {
int depth = 0;
 
-   for (; sd->s_parent; sd = sd->s_parent)
+   for (; sd->s_parent && sd != base; sd = sd->s_parent)
depth++;
 
return depth;
 }
 
-static int object_path_length(struct sysfs_dirent * sd)
+static int object_path_length(struct sysfs_dirent *base,
+   struct sysfs_dirent *sd)
 {
int length = 1;
 
-   for (; sd->s_parent; sd = sd->s_parent)
+   for (; sd->s_parent && sd != base; sd = sd->s_parent)
length += strlen(sd->s_name) + 1;
 
return length;
 }
 
-static void fill_object_path(struct sysfs_dirent *sd, char *buffer, int length)
+static void fill_object_path(struct sysfs_dirent *base,
+   struct sysfs_dirent *sd, char *buffer, int length)
 {
--length;
-   for (; sd->s_parent; sd = sd->s_parent) {
+   for (; sd->s_parent && sd != base; sd = sd->s_parent) {
int cur = strlen(sd->s_name);
 
/* back up enough to print this bus id with '/' */
@@ -129,18 +140,23 @@ static int sysfs_get_target_path(struct sysfs_dirent * 
parent_sd,
 {
char * s;
int depth, size;
+   struct sysfs_dirent *base;
 
-   depth = object_depth(parent_sd);
-   size = object_path_length(target_sd) + depth * 3 - 1;
+   base = object_base(parent_sd, target_sd);
+   depth = object_depth(base, parent_sd);
+   size = object_path_length(base, target_sd) + depth * 3 - 1;
if (size > PATH_MAX)
return -ENAMETOOLONG;
 
-   pr_debug("%s: depth = %d, size = %d\n", __FUNCTION__, depth, size);
+   pr_debug("%s: base = %s, depth = %d, size = %d\n",
+   __FUNCTION__,
+   base ? base->s_name : "/sys",
+   depth, size);
 
for (s = path; depth--; s += 3)
-   strcpy(s,"../");
+   strcpy(s, "../");
 
-   fill_object_path(target_sd, path, size);
+   fill_object_path(base, target_sd, path, size);
pr_debug("%s: path = '%s'\n", __FUNCTION__, path);
 
return 0;
-- 
1.5.3.4

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] [sysfs]: make readlink result shorter when the symlink and its target shared some base sysfs subdirectory

2007-10-31 Thread Denis Cheng
this is especially useful after /sys/slab introduced, for example:

$ ls -l /sys/slab/mm_struct
lrwxrwxrwx 1 root root 0 2007-10-31 17:40 /sys/slab/mm_struct - :448

instead of:

$ ls -l /sys/slab/mm_struct
lrwxrwxrwx 1 root root 0 2007-10-31 17:40 /sys/slab/mm_struct - 
../slab/:448

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 fs/sysfs/symlink.c |   38 +++---
 1 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c
index 3eac20c..230a925 100644
--- a/fs/sysfs/symlink.c
+++ b/fs/sysfs/symlink.c
@@ -19,30 +19,41 @@
 
 #include sysfs.h
 
-static int object_depth(struct sysfs_dirent *sd)
+static struct sysfs_dirent *object_base(struct sysfs_dirent *parent,
+   struct sysfs_dirent *sd)
+{
+   for (; sd-s_parent; sd = sd-s_parent)
+   if (sd-s_parent == parent)
+   return parent;
+   return NULL;
+}
+
+static int object_depth(struct sysfs_dirent *base, struct sysfs_dirent *sd)
 {
int depth = 0;
 
-   for (; sd-s_parent; sd = sd-s_parent)
+   for (; sd-s_parent  sd != base; sd = sd-s_parent)
depth++;
 
return depth;
 }
 
-static int object_path_length(struct sysfs_dirent * sd)
+static int object_path_length(struct sysfs_dirent *base,
+   struct sysfs_dirent *sd)
 {
int length = 1;
 
-   for (; sd-s_parent; sd = sd-s_parent)
+   for (; sd-s_parent  sd != base; sd = sd-s_parent)
length += strlen(sd-s_name) + 1;
 
return length;
 }
 
-static void fill_object_path(struct sysfs_dirent *sd, char *buffer, int length)
+static void fill_object_path(struct sysfs_dirent *base,
+   struct sysfs_dirent *sd, char *buffer, int length)
 {
--length;
-   for (; sd-s_parent; sd = sd-s_parent) {
+   for (; sd-s_parent  sd != base; sd = sd-s_parent) {
int cur = strlen(sd-s_name);
 
/* back up enough to print this bus id with '/' */
@@ -129,18 +140,23 @@ static int sysfs_get_target_path(struct sysfs_dirent * 
parent_sd,
 {
char * s;
int depth, size;
+   struct sysfs_dirent *base;
 
-   depth = object_depth(parent_sd);
-   size = object_path_length(target_sd) + depth * 3 - 1;
+   base = object_base(parent_sd, target_sd);
+   depth = object_depth(base, parent_sd);
+   size = object_path_length(base, target_sd) + depth * 3 - 1;
if (size  PATH_MAX)
return -ENAMETOOLONG;
 
-   pr_debug(%s: depth = %d, size = %d\n, __FUNCTION__, depth, size);
+   pr_debug(%s: base = %s, depth = %d, size = %d\n,
+   __FUNCTION__,
+   base ? base-s_name : /sys,
+   depth, size);
 
for (s = path; depth--; s += 3)
-   strcpy(s,../);
+   strcpy(s, ../);
 
-   fill_object_path(target_sd, path, size);
+   fill_object_path(base, target_sd, path, size);
pr_debug(%s: path = '%s'\n, __FUNCTION__, path);
 
return 0;
-- 
1.5.3.4

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] [net/ipv4]: fib_seq_show function adjustment to get a more sensable output of /proc/net/route

2007-10-22 Thread Denis Cheng
the temporary bf[127] char array is redundant, and the specified width 127 make 
the output of /proc/net/route include many trailing spaces;
since most terminal's cols are less than 127, this made every fib entry occupy 
two lines,

after applied this patch, the output of /proc/net/route is more sensable like 
this:

Iface   Destination Gateway Flags   RefCnt  Use Metric  Mask
MTU Window  IRTT
eth00001A8C000010   0   0   
00FF0   0   0
lo  007F00010   0   0   
00FF0   0   0
eth00101A8C000030   0   0   
0   0   0

Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 net/ipv4/fib_hash.c |   15 +++
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
index 527a6e0..2a4033e 100644
--- a/net/ipv4/fib_hash.c
+++ b/net/ipv4/fib_hash.c
@@ -992,7 +992,6 @@ static unsigned fib_flag_trans(int type, __be32 mask, 
struct fib_info *fi)
 static int fib_seq_show(struct seq_file *seq, void *v)
 {
struct fib_iter_state *iter;
-   char bf[128];
__be32 prefix, mask;
unsigned flags;
struct fib_node *f;
@@ -1000,9 +999,9 @@ static int fib_seq_show(struct seq_file *seq, void *v)
struct fib_info *fi;
 
if (v == SEQ_START_TOKEN) {
-   seq_printf(seq, "%-127s\n", "Iface\tDestination\tGateway "
+   seq_printf(seq, "Iface\tDestination\tGateway "
   "\tFlags\tRefCnt\tUse\tMetric\tMask\t\tMTU"
-  "\tWindow\tIRTT");
+  "\tWindow\tIRTT\n");
goto out;
}
 
@@ -1014,18 +1013,18 @@ static int fib_seq_show(struct seq_file *seq, void *v)
mask= FZ_MASK(iter->zone);
flags   = fib_flag_trans(fa->fa_type, mask, fi);
if (fi)
-   snprintf(bf, sizeof(bf),
-"%s\t%08X\t%08X\t%04X\t%d\t%u\t%d\t%08X\t%d\t%u\t%u",
+   seq_printf(seq,
+"%s\t%08X\t%08X\t%04X\t%d\t%u\t%d\t%08X\t%d\t%u\t%u\n",
 fi->fib_dev ? fi->fib_dev->name : "*", prefix,
 fi->fib_nh->nh_gw, flags, 0, 0, fi->fib_priority,
 mask, (fi->fib_advmss ? fi->fib_advmss + 40 : 0),
 fi->fib_window,
 fi->fib_rtt >> 3);
else
-   snprintf(bf, sizeof(bf),
-"*\t%08X\t%08X\t%04X\t%d\t%u\t%d\t%08X\t%d\t%u\t%u",
+   seq_printf(seq,
+"*\t%08X\t%08X\t%04X\t%d\t%u\t%d\t%08X\t%d\t%u\t%u\n",
 prefix, 0, flags, 0, 0, 0, mask, 0, 0, 0);
-   seq_printf(seq, "%-127s\n", bf);
+
 out:
return 0;
 }
-- 
1.5.3.4

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] [net/ipv4]: fib_seq_show function adjustment to get a more sensable output of /proc/net/route

2007-10-22 Thread Denis Cheng
the temporary bf[127] char array is redundant, and the specified width 127 make 
the output of /proc/net/route include many trailing spaces;
since most terminal's cols are less than 127, this made every fib entry occupy 
two lines,

after applied this patch, the output of /proc/net/route is more sensable like 
this:

Iface   Destination Gateway Flags   RefCnt  Use Metric  Mask
MTU Window  IRTT
eth00001A8C000010   0   0   
00FF0   0   0
lo  007F00010   0   0   
00FF0   0   0
eth00101A8C000030   0   0   
0   0   0

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 net/ipv4/fib_hash.c |   15 +++
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
index 527a6e0..2a4033e 100644
--- a/net/ipv4/fib_hash.c
+++ b/net/ipv4/fib_hash.c
@@ -992,7 +992,6 @@ static unsigned fib_flag_trans(int type, __be32 mask, 
struct fib_info *fi)
 static int fib_seq_show(struct seq_file *seq, void *v)
 {
struct fib_iter_state *iter;
-   char bf[128];
__be32 prefix, mask;
unsigned flags;
struct fib_node *f;
@@ -1000,9 +999,9 @@ static int fib_seq_show(struct seq_file *seq, void *v)
struct fib_info *fi;
 
if (v == SEQ_START_TOKEN) {
-   seq_printf(seq, %-127s\n, Iface\tDestination\tGateway 
+   seq_printf(seq, Iface\tDestination\tGateway 
   \tFlags\tRefCnt\tUse\tMetric\tMask\t\tMTU
-  \tWindow\tIRTT);
+  \tWindow\tIRTT\n);
goto out;
}
 
@@ -1014,18 +1013,18 @@ static int fib_seq_show(struct seq_file *seq, void *v)
mask= FZ_MASK(iter-zone);
flags   = fib_flag_trans(fa-fa_type, mask, fi);
if (fi)
-   snprintf(bf, sizeof(bf),
-%s\t%08X\t%08X\t%04X\t%d\t%u\t%d\t%08X\t%d\t%u\t%u,
+   seq_printf(seq,
+%s\t%08X\t%08X\t%04X\t%d\t%u\t%d\t%08X\t%d\t%u\t%u\n,
 fi-fib_dev ? fi-fib_dev-name : *, prefix,
 fi-fib_nh-nh_gw, flags, 0, 0, fi-fib_priority,
 mask, (fi-fib_advmss ? fi-fib_advmss + 40 : 0),
 fi-fib_window,
 fi-fib_rtt  3);
else
-   snprintf(bf, sizeof(bf),
-*\t%08X\t%08X\t%04X\t%d\t%u\t%d\t%08X\t%d\t%u\t%u,
+   seq_printf(seq,
+*\t%08X\t%08X\t%04X\t%d\t%u\t%d\t%08X\t%d\t%u\t%u\n,
 prefix, 0, flags, 0, 0, 0, mask, 0, 0, 0);
-   seq_printf(seq, %-127s\n, bf);
+
 out:
return 0;
 }
-- 
1.5.3.4

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] fs/ocfs2/: removed unneeded initial value and function's return value

2007-09-26 Thread Denis Cheng
Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 fs/ocfs2/super.c |   17 -
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index c034b51..b98ec12 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -105,7 +105,7 @@ static int ocfs2_sync_fs(struct super_block *sb, int wait);
 
 static int ocfs2_init_global_system_inodes(struct ocfs2_super *osb);
 static int ocfs2_init_local_system_inodes(struct ocfs2_super *osb);
-static int ocfs2_release_system_inodes(struct ocfs2_super *osb);
+static void ocfs2_release_system_inodes(struct ocfs2_super *osb);
 static int ocfs2_fill_local_node_info(struct ocfs2_super *osb);
 static int ocfs2_check_volume(struct ocfs2_super *osb);
 static int ocfs2_verify_volume(struct ocfs2_dinode *di,
@@ -177,7 +177,7 @@ static void ocfs2_write_super(struct super_block *sb)
 
 static int ocfs2_sync_fs(struct super_block *sb, int wait)
 {
-   int status = 0;
+   int status;
tid_t target;
struct ocfs2_super *osb = OCFS2_SB(sb);
 
@@ -275,9 +275,9 @@ bail:
return status;
 }
 
-static int ocfs2_release_system_inodes(struct ocfs2_super *osb)
+static void ocfs2_release_system_inodes(struct ocfs2_super *osb)
 {
-   int status = 0, i;
+   int i;
struct inode *inode;
 
mlog_entry_void();
@@ -302,8 +302,7 @@ static int ocfs2_release_system_inodes(struct ocfs2_super 
*osb)
osb->root_inode = NULL;
}
 
-   mlog_exit(status);
-   return status;
+   mlog_exit(0);
 }
 
 /* We're allocating fs objects, use GFP_NOFS */
@@ -453,7 +452,7 @@ static int ocfs2_sb_probe(struct super_block *sb,
  struct buffer_head **bh,
  int *sector_size)
 {
-   int status = 0, tmpstat;
+   int status, tmpstat;
struct ocfs1_vol_disk_hdr *hdr;
struct ocfs2_dinode *di;
int blksize;
@@ -1275,7 +1274,7 @@ static int ocfs2_initialize_super(struct super_block *sb,
  struct buffer_head *bh,
  int sector_size)
 {
-   int status = 0;
+   int status;
int i, cbits, bbits;
struct ocfs2_dinode *di = (struct ocfs2_dinode *)bh->b_data;
struct inode *inode = NULL;
@@ -1596,7 +1595,7 @@ static int ocfs2_verify_volume(struct ocfs2_dinode *di,
 
 static int ocfs2_check_volume(struct ocfs2_super *osb)
 {
-   int status = 0;
+   int status;
int dirty;
int local;
struct ocfs2_dinode *local_alloc = NULL; /* only used if we
-- 
1.5.3.2

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] fs/ocfs2/: removed unneeded initial value and function's return value

2007-09-26 Thread Denis Cheng
Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 fs/ocfs2/super.c |   17 -
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index c034b51..b98ec12 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -105,7 +105,7 @@ static int ocfs2_sync_fs(struct super_block *sb, int wait);
 
 static int ocfs2_init_global_system_inodes(struct ocfs2_super *osb);
 static int ocfs2_init_local_system_inodes(struct ocfs2_super *osb);
-static int ocfs2_release_system_inodes(struct ocfs2_super *osb);
+static void ocfs2_release_system_inodes(struct ocfs2_super *osb);
 static int ocfs2_fill_local_node_info(struct ocfs2_super *osb);
 static int ocfs2_check_volume(struct ocfs2_super *osb);
 static int ocfs2_verify_volume(struct ocfs2_dinode *di,
@@ -177,7 +177,7 @@ static void ocfs2_write_super(struct super_block *sb)
 
 static int ocfs2_sync_fs(struct super_block *sb, int wait)
 {
-   int status = 0;
+   int status;
tid_t target;
struct ocfs2_super *osb = OCFS2_SB(sb);
 
@@ -275,9 +275,9 @@ bail:
return status;
 }
 
-static int ocfs2_release_system_inodes(struct ocfs2_super *osb)
+static void ocfs2_release_system_inodes(struct ocfs2_super *osb)
 {
-   int status = 0, i;
+   int i;
struct inode *inode;
 
mlog_entry_void();
@@ -302,8 +302,7 @@ static int ocfs2_release_system_inodes(struct ocfs2_super 
*osb)
osb-root_inode = NULL;
}
 
-   mlog_exit(status);
-   return status;
+   mlog_exit(0);
 }
 
 /* We're allocating fs objects, use GFP_NOFS */
@@ -453,7 +452,7 @@ static int ocfs2_sb_probe(struct super_block *sb,
  struct buffer_head **bh,
  int *sector_size)
 {
-   int status = 0, tmpstat;
+   int status, tmpstat;
struct ocfs1_vol_disk_hdr *hdr;
struct ocfs2_dinode *di;
int blksize;
@@ -1275,7 +1274,7 @@ static int ocfs2_initialize_super(struct super_block *sb,
  struct buffer_head *bh,
  int sector_size)
 {
-   int status = 0;
+   int status;
int i, cbits, bbits;
struct ocfs2_dinode *di = (struct ocfs2_dinode *)bh-b_data;
struct inode *inode = NULL;
@@ -1596,7 +1595,7 @@ static int ocfs2_verify_volume(struct ocfs2_dinode *di,
 
 static int ocfs2_check_volume(struct ocfs2_super *osb)
 {
-   int status = 0;
+   int status;
int dirty;
int local;
struct ocfs2_dinode *local_alloc = NULL; /* only used if we
-- 
1.5.3.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] fs/dcache.c: revamped to use a more straightforward and efficient way to operate

2007-09-25 Thread Denis Cheng
Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 fs/dcache.c |   39 ++-
 1 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index 678d39d..05ed44a 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1138,29 +1138,26 @@ struct dentry * d_alloc_anon(struct inode *inode)

spin_lock(_lock);
res = __d_find_alias(inode, 0);
-   if (!res) {
-   /* attach a disconnected dentry */
-   res = tmp;
-   tmp = NULL;
-   spin_lock(>d_lock);
-   res->d_sb = inode->i_sb;
-   res->d_parent = res;
-   res->d_inode = inode;
-   res->d_flags |= DCACHE_DISCONNECTED;
-   res->d_flags &= ~DCACHE_UNHASHED;
-   list_add(>d_alias, >i_dentry);
-   hlist_add_head(>d_hash, >i_sb->s_anon);
-   spin_unlock(>d_lock);
-
-   inode = NULL; /* don't drop reference */
-   }
-   spin_unlock(_lock);
-
-   if (inode)
+   if (unlikely(res)) {
+   spin_unlock(_lock);
iput(inode);
-   if (tmp)
dput(tmp);
-   return res;
+   return res;
+   } else {
+   /* attach a disconnected dentry */
+   spin_lock(>d_lock);
+   tmp->d_sb = inode->i_sb;
+   tmp->d_parent = tmp;
+   tmp->d_inode = inode;
+   tmp->d_flags |= DCACHE_DISCONNECTED;
+   tmp->d_flags &= ~DCACHE_UNHASHED;
+   list_add(>d_alias, >i_dentry);
+   hlist_add_head(>d_hash, >i_sb->s_anon);
+   spin_unlock(>d_lock);
+
+   spin_unlock(_lock);
+   return tmp;
+   }
 }
 
 
-- 
1.5.3.2

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] fs/dcache.c: revamped to use a more straightforward and efficient way to operate

2007-09-25 Thread Denis Cheng
Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 fs/dcache.c |   39 ++-
 1 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index 678d39d..05ed44a 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1138,29 +1138,26 @@ struct dentry * d_alloc_anon(struct inode *inode)

spin_lock(dcache_lock);
res = __d_find_alias(inode, 0);
-   if (!res) {
-   /* attach a disconnected dentry */
-   res = tmp;
-   tmp = NULL;
-   spin_lock(res-d_lock);
-   res-d_sb = inode-i_sb;
-   res-d_parent = res;
-   res-d_inode = inode;
-   res-d_flags |= DCACHE_DISCONNECTED;
-   res-d_flags = ~DCACHE_UNHASHED;
-   list_add(res-d_alias, inode-i_dentry);
-   hlist_add_head(res-d_hash, inode-i_sb-s_anon);
-   spin_unlock(res-d_lock);
-
-   inode = NULL; /* don't drop reference */
-   }
-   spin_unlock(dcache_lock);
-
-   if (inode)
+   if (unlikely(res)) {
+   spin_unlock(dcache_lock);
iput(inode);
-   if (tmp)
dput(tmp);
-   return res;
+   return res;
+   } else {
+   /* attach a disconnected dentry */
+   spin_lock(tmp-d_lock);
+   tmp-d_sb = inode-i_sb;
+   tmp-d_parent = tmp;
+   tmp-d_inode = inode;
+   tmp-d_flags |= DCACHE_DISCONNECTED;
+   tmp-d_flags = ~DCACHE_UNHASHED;
+   list_add(tmp-d_alias, inode-i_dentry);
+   hlist_add_head(tmp-d_hash, inode-i_sb-s_anon);
+   spin_unlock(tmp-d_lock);
+
+   spin_unlock(dcache_lock);
+   return tmp;
+   }
 }
 
 
-- 
1.5.3.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] vfs: use the predefined d_unhashed inline function instead

2007-09-23 Thread Denis Cheng
Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 fs/dcache.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index 678d39d..62e1800 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1546,7 +1546,7 @@ static void d_move_locked(struct dentry * dentry, struct 
dentry * target)
}
 
/* Move the dentry to the target hash queue, if on different bucket */
-   if (dentry->d_flags & DCACHE_UNHASHED)
+   if (d_unhashed(dentry))
goto already_unhashed;
 
hlist_del_rcu(>d_hash);
-- 
1.5.3

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] vfs: use the predefined d_unhashed inline function instead

2007-09-23 Thread Denis Cheng
Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 fs/dcache.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index 678d39d..62e1800 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1546,7 +1546,7 @@ static void d_move_locked(struct dentry * dentry, struct 
dentry * target)
}
 
/* Move the dentry to the target hash queue, if on different bucket */
-   if (dentry-d_flags  DCACHE_UNHASHED)
+   if (d_unhashed(dentry))
goto already_unhashed;
 
hlist_del_rcu(dentry-d_hash);
-- 
1.5.3

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] drivers/net/: all drivers/net/ cleanup with ARRAY_SIZE

2007-09-02 Thread Denis Cheng
Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 drivers/net/apne.c |2 +-
 drivers/net/arm/am79c961a.c|2 +-
 drivers/net/atarilance.c   |2 +-
 drivers/net/atl1/atl1_hw.c |2 +-
 drivers/net/bnx2.c |2 +-
 drivers/net/cs89x0.c   |6 +++---
 drivers/net/e1000/e1000_ethtool.c  |3 +--
 drivers/net/fec_8xx/fec_mii.c  |5 ++---
 drivers/net/ibm_emac/ibm_emac_debug.c  |8 
 drivers/net/irda/actisys-sir.c |2 +-
 drivers/net/ixgb/ixgb_ethtool.c|3 +--
 drivers/net/lp486e.c   |4 +---
 drivers/net/mv643xx_eth.c  |3 +--
 drivers/net/ne-h8300.c |2 +-
 drivers/net/ne.c   |2 +-
 drivers/net/ne2.c  |2 +-
 drivers/net/ne2k-pci.c |2 +-
 drivers/net/netxen/netxen_nic.h|2 +-
 drivers/net/netxen/netxen_nic_hw.c |2 +-
 drivers/net/pcmcia/axnet_cs.c  |2 +-
 drivers/net/pcmcia/pcnet_cs.c  |4 ++--
 drivers/net/phy/phy.c  |2 +-
 drivers/net/skfp/smt.c |2 +-
 drivers/net/skfp/srf.c |4 ++--
 drivers/net/tulip/de4x5.c  |6 +++---
 drivers/net/wireless/airo.c|6 +++---
 drivers/net/wireless/hostap/hostap_ioctl.c |6 +++---
 drivers/net/wireless/ipw2100.c |7 +++
 drivers/net/wireless/libertas/fw.c |3 +--
 drivers/net/wireless/libertas/main.c   |   14 +++---
 drivers/net/wireless/libertas/wext.c   |4 ++--
 drivers/net/wireless/netwave_cs.c  |6 +++---
 drivers/net/wireless/prism54/isl_ioctl.c   |7 +++
 drivers/net/wireless/ray_cs.c  |6 +++---
 drivers/net/wireless/wavelan.c |6 +++---
 drivers/net/wireless/wavelan_cs.c  |6 +++---
 drivers/net/wireless/wl3501_cs.c   |2 +-
 drivers/net/zorro8390.c|2 +-
 38 files changed, 71 insertions(+), 80 deletions(-)

diff --git a/drivers/net/apne.c b/drivers/net/apne.c
index 9541911..8806151 100644
--- a/drivers/net/apne.c
+++ b/drivers/net/apne.c
@@ -247,7 +247,7 @@ static int __init apne_probe1(struct net_device *dev, int 
ioaddr)
{0x00,  NE_EN0_RSARHI},
{E8390_RREAD+E8390_START, NE_CMD},
};
-   for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++) {
+   for (i = 0; i < ARRAY_SIZE(program_seq); i++) {
outb(program_seq[i].value, ioaddr + program_seq[i].offset);
}
 
diff --git a/drivers/net/arm/am79c961a.c b/drivers/net/arm/am79c961a.c
index 2143eeb..7796455 100644
--- a/drivers/net/arm/am79c961a.c
+++ b/drivers/net/arm/am79c961a.c
@@ -414,7 +414,7 @@ static void am79c961_setmulticastlist (struct net_device 
*dev)
/*
 * Update the multicast hash table
 */
-   for (i = 0; i < sizeof(multi_hash) / sizeof(multi_hash[0]); i++)
+   for (i = 0; i < ARRAY_SIZE(multi_hash); i++)
write_rreg(dev->base_addr, i + LADRL, multi_hash[i]);
 
/*
diff --git a/drivers/net/atarilance.c b/drivers/net/atarilance.c
index dfa8b9b..a5c20d2 100644
--- a/drivers/net/atarilance.c
+++ b/drivers/net/atarilance.c
@@ -263,7 +263,7 @@ struct lance_addr {
   
(highest byte stripped) */
 };
 
-#defineN_LANCE_ADDR
(sizeof(lance_addr_list)/sizeof(*lance_addr_list))
+#defineN_LANCE_ADDRARRAY_SIZE(lance_addr_list)
 
 
 /* Definitions for the Lance */
diff --git a/drivers/net/atl1/atl1_hw.c b/drivers/net/atl1/atl1_hw.c
index ef886bd..9d3bd22 100644
--- a/drivers/net/atl1/atl1_hw.c
+++ b/drivers/net/atl1/atl1_hw.c
@@ -603,7 +603,7 @@ static struct atl1_spi_flash_dev flash_table[] = {
 
 static void atl1_init_flash_opcode(struct atl1_hw *hw)
 {
-   if (hw->flash_vendor >= sizeof(flash_table) / sizeof(flash_table[0]))
+   if (hw->flash_vendor >= ARRAY_SIZE(flash_table))
hw->flash_vendor = 0;   /* ATMEL */
 
/* Init OP table */
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 854d80c..aa9e636 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -3500,7 +3500,7 @@ bnx2_init_nvram(struct bnx2 *bp)
/* Determine the selected interface. */
val = REG_RD(bp, BNX2_NVM_CFG1);
 
-   entry_count = sizeof(flash_table) / sizeof(struct flash_spec);
+   entry_count = ARRAY_SIZE(flash_table);
 
if (val & 0x4000) {
 
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
index 9774bb1..d0f4a1a 100644
--- a/drivers/net/cs89x0.c
+++ b/drivers/net/cs89x0.c
@@ -806,7 +806,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int 
modular)

[PATCH 1/2] net/: all net/ cleanup with ARRAY_SIZE

2007-09-02 Thread Denis Cheng
Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 net/atm/proc.c  |2 +-
 net/decnet/dn_dev.c |2 +-
 net/ipv4/af_inet.c  |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/atm/proc.c b/net/atm/proc.c
index 99fc1fe..a3e52ff 100644
--- a/net/atm/proc.c
+++ b/net/atm/proc.c
@@ -175,7 +175,7 @@ static void pvc_info(struct seq_file *seq, struct atm_vcc 
*vcc)
 
seq_printf(seq, "%3d %3d %5d %-3s %7d %-5s %7d %-6s",
vcc->dev->number,vcc->vpi,vcc->vci,
-   vcc->qos.aal >= sizeof(aal_name)/sizeof(aal_name[0]) ? "err" :
+   vcc->qos.aal >= ARRAY_SIZE(aal_name) ? "err" :
aal_name[vcc->qos.aal],vcc->qos.rxtp.min_pcr,
class_name[vcc->qos.rxtp.traffic_class],vcc->qos.txtp.min_pcr,
class_name[vcc->qos.txtp.traffic_class]);
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index fa6604f..9470cb9 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -149,7 +149,7 @@ static struct dn_dev_parms dn_dev_list[] =  {
 }
 };
 
-#define DN_DEV_LIST_SIZE (sizeof(dn_dev_list)/sizeof(struct dn_dev_parms))
+#define DN_DEV_LIST_SIZE ARRAY_SIZE(dn_dev_list)
 
 #define DN_DEV_PARMS_OFFSET(x) ((int) ((char *) &((struct dn_dev_parms 
*)0)->x))
 
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index e681034..d5e8b67 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -939,7 +939,7 @@ static struct inet_protosw inetsw_array[] =
}
 };
 
-#define INETSW_ARRAY_LEN (sizeof(inetsw_array) / sizeof(struct inet_protosw))
+#define INETSW_ARRAY_LEN ARRAY_SIZE(inetsw_array)
 
 void inet_register_protosw(struct inet_protosw *p)
 {
-- 
1.5.3.rc7

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


  1   2   >