[PATCH] staging: rtl8192u: make r8192_wx_handlers_def structure const

2017-09-30 Thread Bhumika Goyal
Make this const as it is only stored in a const field of a pci_dev
structure. Make the declaration in the header const too.

Structure found using Coccinelle and changes done by hand.

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 2 +-
 drivers/staging/rtl8192u/r8192U_wx.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index a954538..e4e6c97 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -964,7 +964,7 @@ struct iw_statistics *r8192_get_wireless_stats(struct 
net_device *dev)
return wstats;
 }
 
-struct iw_handler_def  r8192_wx_handlers_def = {
+const struct iw_handler_def  r8192_wx_handlers_def = {
.standard = r8192_wx_handlers,
.num_standard = ARRAY_SIZE(r8192_wx_handlers),
.private = r8192_private_handler,
diff --git a/drivers/staging/rtl8192u/r8192U_wx.h 
b/drivers/staging/rtl8192u/r8192U_wx.h
index fb5f808..a6c2b95 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.h
+++ b/drivers/staging/rtl8192u/r8192U_wx.h
@@ -17,7 +17,7 @@
 #ifndef R8180_WX_H
 #define R8180_WX_H
 
-extern struct iw_handler_def r8192_wx_handlers_def;
+extern const struct iw_handler_def r8192_wx_handlers_def;
 /* Enable  the rtl819x_core.c to share this function, david 2008.9.22 */
 struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev);
 
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] [media] Staging: media: radio-bcm2048: make video_device const

2017-08-26 Thread Bhumika Goyal
Make this const as it is only used in a copy operation.

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/media/bcm2048/radio-bcm2048.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c 
b/drivers/staging/media/bcm2048/radio-bcm2048.c
index 86d7fc2..58adaea 100644
--- a/drivers/staging/media/bcm2048/radio-bcm2048.c
+++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
@@ -2564,7 +2564,7 @@ static int bcm2048_vidioc_s_hw_freq_seek(struct file 
*file, void *priv,
 /*
  * bcm2048_viddev_template - video device interface
  */
-static struct video_device bcm2048_viddev_template = {
+static const struct video_device bcm2048_viddev_template = {
.fops   = &bcm2048_fops,
.name   = BCM2048_DRIVER_NAME,
.release= video_device_release_empty,
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: bcm2835-camera: make video_device const

2017-08-26 Thread Bhumika Goyal
Make this const as it is only used in a copy operation.

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c 
b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
index 5af758a..be936b8 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
@@ -1456,7 +1456,7 @@ static int vidioc_s_parm(struct file *file, void *priv,
.mmap = vb2_fop_mmap,
 };
 
-static struct video_device vdev_template = {
+static const struct video_device vdev_template = {
.name = "camera0",
.fops = &camera0_fops,
.ioctl_ops = &camera0_ioctl_ops,
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] [media] staging: omap4iss: make v4l2_file_operations const

2017-08-25 Thread Bhumika Goyal
Make this const as it is only stored in a const field of a
video_device structure.

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/media/omap4iss/iss_video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/omap4iss/iss_video.c 
b/drivers/staging/media/omap4iss/iss_video.c
index 0bac582..9e2f042 100644
--- a/drivers/staging/media/omap4iss/iss_video.c
+++ b/drivers/staging/media/omap4iss/iss_video.c
@@ -1199,7 +1199,7 @@ static int iss_video_mmap(struct file *file, struct 
vm_area_struct *vma)
return vb2_mmap(&vfh->queue, vma);
 }
 
-static struct v4l2_file_operations iss_video_fops = {
+static const struct v4l2_file_operations iss_video_fops = {
.owner = THIS_MODULE,
.unlocked_ioctl = video_ioctl2,
.open = iss_video_open,
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 14/15] staging: greybus: make device_type const

2017-08-19 Thread Bhumika Goyal
Make this const as it is only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/greybus/gbphy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/gbphy.c b/drivers/staging/greybus/gbphy.c
index 603de6f..80c1da8 100644
--- a/drivers/staging/greybus/gbphy.c
+++ b/drivers/staging/greybus/gbphy.c
@@ -66,7 +66,7 @@ static int gb_gbphy_idle(struct device *dev)
   gb_gbphy_idle)
 };
 
-static struct device_type greybus_gbphy_dev_type = {
+static const struct device_type greybus_gbphy_dev_type = {
.name=  "gbphy_device",
.release =  gbphy_dev_release,
.pm =   &gb_gbphy_pm_ops,
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 15/15] usb: make device_type const

2017-08-19 Thread Bhumika Goyal
Make this const as it is only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/usb/common/ulpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/common/ulpi.c b/drivers/usb/common/ulpi.c
index 930e8f3..4aa5195 100644
--- a/drivers/usb/common/ulpi.c
+++ b/drivers/usb/common/ulpi.c
@@ -135,7 +135,7 @@ static void ulpi_dev_release(struct device *dev)
kfree(to_ulpi_dev(dev));
 }
 
-static struct device_type ulpi_dev_type = {
+static const struct device_type ulpi_dev_type = {
.name = "ulpi_device",
.groups = ulpi_dev_attr_groups,
.release = ulpi_dev_release,
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 13/15] scsi: make device_type const

2017-08-19 Thread Bhumika Goyal
Make these const as they are only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/scsi/fcoe/fcoe_sysfs.c  | 4 ++--
 drivers/scsi/scsi_transport_iscsi.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/fcoe/fcoe_sysfs.c b/drivers/scsi/fcoe/fcoe_sysfs.c
index 9cf3d56..5c8310b 100644
--- a/drivers/scsi/fcoe/fcoe_sysfs.c
+++ b/drivers/scsi/fcoe/fcoe_sysfs.c
@@ -659,13 +659,13 @@ static void fcoe_fcf_device_release(struct device *dev)
kfree(fcf);
 }
 
-static struct device_type fcoe_ctlr_device_type = {
+static const struct device_type fcoe_ctlr_device_type = {
.name = "fcoe_ctlr",
.groups = fcoe_ctlr_attr_groups,
.release = fcoe_ctlr_device_release,
 };
 
-static struct device_type fcoe_fcf_device_type = {
+static const struct device_type fcoe_fcf_device_type = {
.name = "fcoe_fcf",
.groups = fcoe_fcf_attr_groups,
.release = fcoe_fcf_device_release,
diff --git a/drivers/scsi/scsi_transport_iscsi.c 
b/drivers/scsi/scsi_transport_iscsi.c
index a424eae..b9513f8 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -1009,7 +1009,7 @@ static void iscsi_flashnode_sess_release(struct device 
*dev)
kfree(fnode_sess);
 }
 
-static struct device_type iscsi_flashnode_sess_dev_type = {
+static const struct device_type iscsi_flashnode_sess_dev_type = {
.name = "iscsi_flashnode_sess_dev_type",
.groups = iscsi_flashnode_sess_attr_groups,
.release = iscsi_flashnode_sess_release,
@@ -1195,7 +1195,7 @@ static void iscsi_flashnode_conn_release(struct device 
*dev)
kfree(fnode_conn);
 }
 
-static struct device_type iscsi_flashnode_conn_dev_type = {
+static const struct device_type iscsi_flashnode_conn_dev_type = {
.name = "iscsi_flashnode_conn_dev_type",
.groups = iscsi_flashnode_conn_attr_groups,
.release = iscsi_flashnode_conn_release,
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 11/15] remoteproc: make device_type const

2017-08-19 Thread Bhumika Goyal
Make this const as it is only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/remoteproc/remoteproc_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/remoteproc/remoteproc_core.c 
b/drivers/remoteproc/remoteproc_core.c
index 364ef28..48b2c5d 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -1360,7 +1360,7 @@ static void rproc_type_release(struct device *dev)
kfree(rproc);
 }
 
-static struct device_type rproc_type = {
+static const struct device_type rproc_type = {
.name   = "remoteproc",
.release= rproc_type_release,
 };
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 12/15] s390/zcrypt: make device_type const

2017-08-19 Thread Bhumika Goyal
Make these const as they are only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/s390/crypto/ap_card.c  | 2 +-
 drivers/s390/crypto/ap_queue.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/s390/crypto/ap_card.c b/drivers/s390/crypto/ap_card.c
index 836efac9..0329148 100644
--- a/drivers/s390/crypto/ap_card.c
+++ b/drivers/s390/crypto/ap_card.c
@@ -153,7 +153,7 @@ static ssize_t ap_modalias_show(struct device *dev,
NULL
 };
 
-static struct device_type ap_card_type = {
+static const struct device_type ap_card_type = {
.name = "ap_card",
.groups = ap_card_dev_attr_groups,
 };
diff --git a/drivers/s390/crypto/ap_queue.c b/drivers/s390/crypto/ap_queue.c
index 0f1a5d0..e2a85c26 100644
--- a/drivers/s390/crypto/ap_queue.c
+++ b/drivers/s390/crypto/ap_queue.c
@@ -577,7 +577,7 @@ static ssize_t ap_interrupt_show(struct device *dev,
NULL
 };
 
-static struct device_type ap_queue_type = {
+static const struct device_type ap_queue_type = {
.name = "ap_queue",
.groups = ap_queue_dev_attr_groups,
 };
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 10/15] platform/x86: wmi: make device_type const

2017-08-19 Thread Bhumika Goyal
Make these const as they are only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/platform/x86/wmi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index e32ba57..a37c253 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -810,19 +810,19 @@ static int wmi_dev_remove(struct device *dev)
.remove = wmi_dev_remove,
 };
 
-static struct device_type wmi_type_event = {
+static const struct device_type wmi_type_event = {
.name = "event",
.groups = wmi_event_groups,
.release = wmi_dev_release,
 };
 
-static struct device_type wmi_type_method = {
+static const struct device_type wmi_type_method = {
.name = "method",
.groups = wmi_method_groups,
.release = wmi_dev_release,
 };
 
-static struct device_type wmi_type_data = {
+static const struct device_type wmi_type_data = {
.name = "data",
.groups = wmi_data_groups,
.release = wmi_dev_release,
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 08/15] PCI: make device_type const

2017-08-19 Thread Bhumika Goyal
Make this const as it is only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/pci/endpoint/pci-epf-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/endpoint/pci-epf-core.c 
b/drivers/pci/endpoint/pci-epf-core.c
index 6877d6a..9d0de12 100644
--- a/drivers/pci/endpoint/pci-epf-core.c
+++ b/drivers/pci/endpoint/pci-epf-core.c
@@ -27,7 +27,7 @@
 #include 
 
 static struct bus_type pci_epf_bus_type;
-static struct device_type pci_epf_type;
+static const struct device_type pci_epf_type;
 
 /**
  * pci_epf_linkup() - Notify the function driver that EPC device has
@@ -275,7 +275,7 @@ static void pci_epf_dev_release(struct device *dev)
kfree(epf);
 }
 
-static struct device_type pci_epf_type = {
+static const struct device_type pci_epf_type = {
.release= pci_epf_dev_release,
 };
 
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/15] mux: make device_type const

2017-08-19 Thread Bhumika Goyal
Make this const as it is only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/mux/mux-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mux/mux-core.c b/drivers/mux/mux-core.c
index 2fe96c4..68bd16d 100644
--- a/drivers/mux/mux-core.c
+++ b/drivers/mux/mux-core.c
@@ -58,7 +58,7 @@ static void mux_chip_release(struct device *dev)
kfree(mux_chip);
 }
 
-static struct device_type mux_type = {
+static const struct device_type mux_type = {
.name = "mux-chip",
.release = mux_chip_release,
 };
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 09/15] phy: tegra: make device_type const

2017-08-19 Thread Bhumika Goyal
Make these const as they are only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/phy/tegra/xusb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
index 3cbcb25..bd3f1b6 100644
--- a/drivers/phy/tegra/xusb.c
+++ b/drivers/phy/tegra/xusb.c
@@ -155,7 +155,7 @@ static void tegra_xusb_pad_release(struct device *dev)
pad->soc->ops->remove(pad);
 }
 
-static struct device_type tegra_xusb_pad_type = {
+static const struct device_type tegra_xusb_pad_type = {
.release = tegra_xusb_pad_release,
 };
 
@@ -512,7 +512,7 @@ static void tegra_xusb_port_release(struct device *dev)
 {
 }
 
-static struct device_type tegra_xusb_port_type = {
+static const struct device_type tegra_xusb_port_type = {
.release = tegra_xusb_port_release,
 };
 
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 05/15] mei: make device_type const

2017-08-19 Thread Bhumika Goyal
Make this const as it is only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/misc/mei/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
index 40c7908..1ac10cb 100644
--- a/drivers/misc/mei/bus.c
+++ b/drivers/misc/mei/bus.c
@@ -845,7 +845,7 @@ static void mei_cl_bus_dev_release(struct device *dev)
kfree(cldev);
 }
 
-static struct device_type mei_cl_device_type = {
+static const struct device_type mei_cl_device_type = {
.release= mei_cl_bus_dev_release,
 };
 
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 04/15] [media] rc: make device_type const

2017-08-19 Thread Bhumika Goyal
Make this const as it is only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/media/rc/rc-main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index a9eba00..ea3da3e 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -1532,7 +1532,7 @@ static RC_FILTER_ATTR(wakeup_filter_mask, S_IRUGO|S_IWUSR,
.attrs  = rc_dev_wakeup_filter_attrs,
 };
 
-static struct device_type rc_dev_type = {
+static const struct device_type rc_dev_type = {
.release= rc_dev_release,
.uevent = rc_dev_uevent,
 };
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 06/15] mtd: make device_type const

2017-08-19 Thread Bhumika Goyal
Make this const as it is only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/mtd/mtdcore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index f872a99..e7ea842 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -340,7 +340,7 @@ static ssize_t mtd_bbtblocks_show(struct device *dev,
 };
 ATTRIBUTE_GROUPS(mtd);
 
-static struct device_type mtd_devtype = {
+static const struct device_type mtd_devtype = {
.name   = "mtd",
.groups = mtd_groups,
.release= mtd_release,
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 03/15] [media] i2c: make device_type const

2017-08-19 Thread Bhumika Goyal
Make this const as it is only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/media/i2c/soc_camera/mt9t031.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/soc_camera/mt9t031.c 
b/drivers/media/i2c/soc_camera/mt9t031.c
index 714fb35..4802d30 100644
--- a/drivers/media/i2c/soc_camera/mt9t031.c
+++ b/drivers/media/i2c/soc_camera/mt9t031.c
@@ -592,7 +592,7 @@ static int mt9t031_runtime_resume(struct device *dev)
.runtime_resume = mt9t031_runtime_resume,
 };
 
-static struct device_type mt9t031_dev_type = {
+static const struct device_type mt9t031_dev_type = {
.name   = "MT9T031",
.pm = &mt9t031_dev_pm_ops,
 };
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 00/15] drivers: make device_type const

2017-08-19 Thread Bhumika Goyal
Make device_type const. Done using Coccinelle.

Bhumika Goyal (15):
  EDAC: make device_type const
  drm: make device_type const
  [media] i2c: make device_type const
  [media] rc: make device_type const
  mei: make device_type const
  mtd:  make device_type const
  mux: make device_type const
  PCI: make device_type const
  phy: tegra: make device_type const
  platform/x86: wmi: make device_type const
  remoteproc: make device_type const
  s390/zcrypt: make device_type const
  scsi: make device_type const
  staging: greybus: make device_type const
  usb: make device_type const

 drivers/edac/edac_mc_sysfs.c   | 8 
 drivers/edac/i7core_edac.c | 4 ++--
 drivers/gpu/drm/drm_sysfs.c| 2 +-
 drivers/gpu/drm/ttm/ttm_module.c   | 2 +-
 drivers/media/i2c/soc_camera/mt9t031.c | 2 +-
 drivers/media/rc/rc-main.c | 2 +-
 drivers/misc/mei/bus.c | 2 +-
 drivers/mtd/mtdcore.c  | 2 +-
 drivers/mux/mux-core.c | 2 +-
 drivers/pci/endpoint/pci-epf-core.c| 4 ++--
 drivers/phy/tegra/xusb.c   | 4 ++--
 drivers/platform/x86/wmi.c | 6 +++---
 drivers/remoteproc/remoteproc_core.c   | 2 +-
 drivers/s390/crypto/ap_card.c  | 2 +-
 drivers/s390/crypto/ap_queue.c | 2 +-
 drivers/scsi/fcoe/fcoe_sysfs.c | 4 ++--
 drivers/scsi/scsi_transport_iscsi.c| 4 ++--
 drivers/staging/greybus/gbphy.c| 2 +-
 drivers/usb/common/ulpi.c  | 2 +-
 19 files changed, 29 insertions(+), 29 deletions(-)

-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 02/15] drm: make device_type const

2017-08-19 Thread Bhumika Goyal
Make these const as they are only stored in the type field of a device
structure, which is const.
Done using Coccinelle.
---
 drivers/gpu/drm/drm_sysfs.c  | 2 +-
 drivers/gpu/drm/ttm/ttm_module.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index 1c5b5ce..84e4ebe 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -39,7 +39,7 @@
  * drm_connector_unregister().
  */
 
-static struct device_type drm_sysfs_device_minor = {
+static const struct device_type drm_sysfs_device_minor = {
.name = "drm_minor"
 };
 
diff --git a/drivers/gpu/drm/ttm/ttm_module.c b/drivers/gpu/drm/ttm/ttm_module.c
index 66fc639..e6604e0 100644
--- a/drivers/gpu/drm/ttm/ttm_module.c
+++ b/drivers/gpu/drm/ttm/ttm_module.c
@@ -37,7 +37,7 @@
 static DECLARE_WAIT_QUEUE_HEAD(exit_q);
 static atomic_t device_released;
 
-static struct device_type ttm_drm_class_type = {
+static const struct device_type ttm_drm_class_type = {
.name = "ttm",
/**
 * Add pm ops here.
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/15] EDAC: make device_type const

2017-08-19 Thread Bhumika Goyal
Make these const as they are only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/edac/edac_mc_sysfs.c | 8 
 drivers/edac/i7core_edac.c   | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
index dbc6446..e4fcfa8 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -304,7 +304,7 @@ static void csrow_attr_release(struct device *dev)
kfree(csrow);
 }
 
-static struct device_type csrow_attr_type = {
+static const struct device_type csrow_attr_type = {
.groups = csrow_attr_groups,
.release= csrow_attr_release,
 };
@@ -644,7 +644,7 @@ static void dimm_attr_release(struct device *dev)
kfree(dimm);
 }
 
-static struct device_type dimm_attr_type = {
+static const struct device_type dimm_attr_type = {
.groups = dimm_attr_groups,
.release= dimm_attr_release,
 };
@@ -920,7 +920,7 @@ static void mci_attr_release(struct device *dev)
kfree(mci);
 }
 
-static struct device_type mci_attr_type = {
+static const struct device_type mci_attr_type = {
.groups = mci_attr_groups,
.release= mci_attr_release,
 };
@@ -1074,7 +1074,7 @@ static void mc_attr_release(struct device *dev)
kfree(dev);
 }
 
-static struct device_type mc_attr_type = {
+static const struct device_type mc_attr_type = {
.release= mc_attr_release,
 };
 /*
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
index d36cc84..c16c3b9 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
@@ -1094,7 +1094,7 @@ static void addrmatch_release(struct device *device)
kfree(device);
 }
 
-static struct device_type addrmatch_type = {
+static const struct device_type addrmatch_type = {
.groups = addrmatch_groups,
.release= addrmatch_release,
 };
@@ -1125,7 +1125,7 @@ static void all_channel_counts_release(struct device 
*device)
kfree(device);
 }
 
-static struct device_type all_channel_counts_type = {
+static const struct device_type all_channel_counts_type = {
.groups = all_channel_counts_groups,
.release= all_channel_counts_release,
 };
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: vboxvideo: make drm_fb_helper_funcs const

2017-08-17 Thread Bhumika Goyal
On Thu, Aug 17, 2017 at 10:33 PM, Greg KH  wrote:
> On Tue, Aug 08, 2017 at 09:15:42PM +0530, Bhumika Goyal wrote:
>> Make the structure const as it is only passed to the function
>> drm_fb_helper_prepare and the corresponding argument is of type
>> const.
>> Done using Coccinelle.
>>
>> Signed-off-by: Bhumika Goyal 
>> ---
>>  drivers/staging/vboxvideo/vbox_fb.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Does not apply to my tree at all :(

Okay, I will resend it.

Thanks,
Bhumika
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 6/6] [media] tuners: make snd_pcm_hardware const

2017-08-13 Thread Bhumika Goyal
Make these const as they are only used during a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/media/tuners/tda18271-maps.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/tuners/tda18271-maps.c 
b/drivers/media/tuners/tda18271-maps.c
index 7d11467..9679804 100644
--- a/drivers/media/tuners/tda18271-maps.c
+++ b/drivers/media/tuners/tda18271-maps.c
@@ -1182,7 +1182,7 @@ int tda18271_lookup_map(struct dvb_frontend *fe,
 
 /*-*/
 
-static struct tda18271_std_map tda18271c1_std_map = {
+static const struct tda18271_std_map tda18271c1_std_map = {
.fm_radio = { .if_freq = 1250, .fm_rfn = 1, .agc_mode = 3, .std = 0,
  .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x18 */
.atv_b= { .if_freq = 6750, .fm_rfn = 0, .agc_mode = 1, .std = 6,
@@ -1215,7 +1215,7 @@ int tda18271_lookup_map(struct dvb_frontend *fe,
  .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1f */
 };
 
-static struct tda18271_std_map tda18271c2_std_map = {
+static const struct tda18271_std_map tda18271c2_std_map = {
.fm_radio = { .if_freq = 1250, .fm_rfn = 1, .agc_mode = 3, .std = 0,
  .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x18 */
.atv_b= { .if_freq = 6000, .fm_rfn = 0, .agc_mode = 1, .std = 5,
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 5/6] staging: bcm2835-audio: make snd_pcm_hardware const

2017-08-13 Thread Bhumika Goyal
Make these const as they are only used during a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c 
b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
index 1bf34ce..94654c0 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
@@ -20,7 +20,7 @@
 #include "bcm2835.h"
 
 /* hardware definition */
-static struct snd_pcm_hardware snd_bcm2835_playback_hw = {
+static const struct snd_pcm_hardware snd_bcm2835_playback_hw = {
.info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID),
.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
@@ -36,7 +36,7 @@
.periods_max = 128,
 };
 
-static struct snd_pcm_hardware snd_bcm2835_playback_spdif_hw = {
+static const struct snd_pcm_hardware snd_bcm2835_playback_spdif_hw = {
.info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID),
.formats = SNDRV_PCM_FMTBIT_S16_LE,
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/6] drivers: make snd_pcm_hardware const

2017-08-13 Thread Bhumika Goyal
Make snd_pcm_hardware structures const.

Bhumika Goyal (6):
  [media] usb: make snd_pcm_hardware const
  [media] pci: make snd_pcm_hardware const
  drm: bridge: dw-hdmi: make snd_pcm_hardware const
  usb: gadget: make snd_pcm_hardware const
  staging: bcm2835-audio:  make snd_pcm_hardware const
  [media] tuners: make snd_pcm_hardware const

 drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c   | 2 +-
 drivers/media/pci/cobalt/cobalt-alsa-pcm.c| 4 ++--
 drivers/media/pci/cx18/cx18-alsa-pcm.c| 2 +-
 drivers/media/pci/cx23885/cx23885-alsa.c  | 2 +-
 drivers/media/pci/cx25821/cx25821-alsa.c  | 2 +-
 drivers/media/pci/ivtv/ivtv-alsa-pcm.c| 2 +-
 drivers/media/pci/saa7134/saa7134-alsa.c  | 2 +-
 drivers/media/tuners/tda18271-maps.c  | 4 ++--
 drivers/media/usb/cx231xx/cx231xx-audio.c | 2 +-
 drivers/media/usb/em28xx/em28xx-audio.c   | 2 +-
 drivers/media/usb/go7007/snd-go7007.c | 2 +-
 drivers/media/usb/tm6000/tm6000-alsa.c| 2 +-
 drivers/media/usb/usbtv/usbtv-audio.c | 2 +-
 drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c | 4 ++--
 drivers/usb/gadget/function/u_audio.c | 2 +-
 15 files changed, 18 insertions(+), 18 deletions(-)

-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/6] drm: bridge: dw-hdmi: make snd_pcm_hardware const

2017-08-13 Thread Bhumika Goyal
Make this const as it is only used during a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c 
b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c
index cf3f0ca..b161439 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c
@@ -298,7 +298,7 @@ static irqreturn_t snd_dw_hdmi_irq(int irq, void *data)
return IRQ_HANDLED;
 }
 
-static struct snd_pcm_hardware dw_hdmi_hw = {
+static const struct snd_pcm_hardware dw_hdmi_hw = {
.info = SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP |
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/6] [media] pci: make snd_pcm_hardware const

2017-08-13 Thread Bhumika Goyal
Make these const as they are only used during a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/media/pci/cobalt/cobalt-alsa-pcm.c | 4 ++--
 drivers/media/pci/cx18/cx18-alsa-pcm.c | 2 +-
 drivers/media/pci/cx23885/cx23885-alsa.c   | 2 +-
 drivers/media/pci/cx25821/cx25821-alsa.c   | 2 +-
 drivers/media/pci/ivtv/ivtv-alsa-pcm.c | 2 +-
 drivers/media/pci/saa7134/saa7134-alsa.c   | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/media/pci/cobalt/cobalt-alsa-pcm.c 
b/drivers/media/pci/cobalt/cobalt-alsa-pcm.c
index 49013c6..b69b258 100644
--- a/drivers/media/pci/cobalt/cobalt-alsa-pcm.c
+++ b/drivers/media/pci/cobalt/cobalt-alsa-pcm.c
@@ -43,7 +43,7 @@
pr_info("cobalt-alsa-pcm %s: " fmt, __func__, ##arg); \
} while (0)
 
-static struct snd_pcm_hardware snd_cobalt_hdmi_capture = {
+static const struct snd_pcm_hardware snd_cobalt_hdmi_capture = {
.info = SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP   |
SNDRV_PCM_INFO_INTERLEAVED|
@@ -64,7 +64,7 @@
.periods_max = 4,
 };
 
-static struct snd_pcm_hardware snd_cobalt_playback = {
+static const struct snd_pcm_hardware snd_cobalt_playback = {
.info = SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP   |
SNDRV_PCM_INFO_INTERLEAVED|
diff --git a/drivers/media/pci/cx18/cx18-alsa-pcm.c 
b/drivers/media/pci/cx18/cx18-alsa-pcm.c
index f68ee57..aadd764 100644
--- a/drivers/media/pci/cx18/cx18-alsa-pcm.c
+++ b/drivers/media/pci/cx18/cx18-alsa-pcm.c
@@ -44,7 +44,7 @@
  __func__, ##arg); \
} while (0)
 
-static struct snd_pcm_hardware snd_cx18_hw_capture = {
+static const struct snd_pcm_hardware snd_cx18_hw_capture = {
.info = SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP   |
SNDRV_PCM_INFO_INTERLEAVED|
diff --git a/drivers/media/pci/cx23885/cx23885-alsa.c 
b/drivers/media/pci/cx23885/cx23885-alsa.c
index c148f9a..d8c3637 100644
--- a/drivers/media/pci/cx23885/cx23885-alsa.c
+++ b/drivers/media/pci/cx23885/cx23885-alsa.c
@@ -293,7 +293,7 @@ static int dsp_buffer_free(struct cx23885_audio_dev *chip)
  */
 #define DEFAULT_FIFO_SIZE  4096
 
-static struct snd_pcm_hardware snd_cx23885_digital_hw = {
+static const struct snd_pcm_hardware snd_cx23885_digital_hw = {
.info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
diff --git a/drivers/media/pci/cx25821/cx25821-alsa.c 
b/drivers/media/pci/cx25821/cx25821-alsa.c
index 519b81c..2b34990 100644
--- a/drivers/media/pci/cx25821/cx25821-alsa.c
+++ b/drivers/media/pci/cx25821/cx25821-alsa.c
@@ -428,7 +428,7 @@ static int dsp_buffer_free(struct cx25821_audio_dev *chip)
  * Digital hardware definition
  */
 #define DEFAULT_FIFO_SIZE  384
-static struct snd_pcm_hardware snd_cx25821_digital_hw = {
+static const struct snd_pcm_hardware snd_cx25821_digital_hw = {
.info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP_VALID,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
diff --git a/drivers/media/pci/ivtv/ivtv-alsa-pcm.c 
b/drivers/media/pci/ivtv/ivtv-alsa-pcm.c
index 417d03d..5326d86 100644
--- a/drivers/media/pci/ivtv/ivtv-alsa-pcm.c
+++ b/drivers/media/pci/ivtv/ivtv-alsa-pcm.c
@@ -41,7 +41,7 @@
pr_info("ivtv-alsa-pcm %s: " fmt, __func__, ##arg); \
} while (0)
 
-static struct snd_pcm_hardware snd_ivtv_hw_capture = {
+static const struct snd_pcm_hardware snd_ivtv_hw_capture = {
.info = SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP   |
SNDRV_PCM_INFO_INTERLEAVED|
diff --git a/drivers/media/pci/saa7134/saa7134-alsa.c 
b/drivers/media/pci/saa7134/saa7134-alsa.c
index bf358ec..c59b69f 100644
--- a/drivers/media/pci/saa7134/saa7134-alsa.c
+++ b/drivers/media/pci/saa7134/saa7134-alsa.c
@@ -627,7 +627,7 @@ static int snd_card_saa7134_capture_prepare(struct 
snd_pcm_substream * substream
  *switching to 32kHz without any frequency translation
  */
 
-static struct snd_pcm_hardware snd_card_saa7134_capture =
+static const struct snd_pcm_hardware snd_card_saa7134_capture =
 {
.info = (SNDRV_PCM_INFO_MMAP | 
SNDRV_PCM_INFO_INTERLEAVED |
 SNDRV_PCM_INFO_BLOCK_TRANSFER |
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/6] usb: gadget: make snd_pcm_hardware const

2017-08-13 Thread Bhumika Goyal
Make this const as it is only used during a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/usb/gadget/function/u_audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/function/u_audio.c 
b/drivers/usb/gadget/function/u_audio.c
index d4caa21..3971bba 100644
--- a/drivers/usb/gadget/function/u_audio.c
+++ b/drivers/usb/gadget/function/u_audio.c
@@ -79,7 +79,7 @@ struct snd_uac_chip {
unsigned int p_framesize;
 };
 
-static struct snd_pcm_hardware uac_pcm_hardware = {
+static const struct snd_pcm_hardware uac_pcm_hardware = {
.info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER
 | SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID
 | SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME,
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/6] [media] usb: make snd_pcm_hardware const

2017-08-13 Thread Bhumika Goyal
Make these const as they are only used during a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/media/usb/cx231xx/cx231xx-audio.c | 2 +-
 drivers/media/usb/em28xx/em28xx-audio.c   | 2 +-
 drivers/media/usb/go7007/snd-go7007.c | 2 +-
 drivers/media/usb/tm6000/tm6000-alsa.c| 2 +-
 drivers/media/usb/usbtv/usbtv-audio.c | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/media/usb/cx231xx/cx231xx-audio.c 
b/drivers/media/usb/cx231xx/cx231xx-audio.c
index a050d12..06f10d7 100644
--- a/drivers/media/usb/cx231xx/cx231xx-audio.c
+++ b/drivers/media/usb/cx231xx/cx231xx-audio.c
@@ -403,7 +403,7 @@ static int snd_pcm_alloc_vmalloc_buffer(struct 
snd_pcm_substream *subs,
return 0;
 }
 
-static struct snd_pcm_hardware snd_cx231xx_hw_capture = {
+static const struct snd_pcm_hardware snd_cx231xx_hw_capture = {
.info = SNDRV_PCM_INFO_BLOCK_TRANSFER   |
SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED  |
diff --git a/drivers/media/usb/em28xx/em28xx-audio.c 
b/drivers/media/usb/em28xx/em28xx-audio.c
index ffad7f1..261620a 100644
--- a/drivers/media/usb/em28xx/em28xx-audio.c
+++ b/drivers/media/usb/em28xx/em28xx-audio.c
@@ -216,7 +216,7 @@ static int snd_pcm_alloc_vmalloc_buffer(struct 
snd_pcm_substream *subs,
return 0;
 }
 
-static struct snd_pcm_hardware snd_em28xx_hw_capture = {
+static const struct snd_pcm_hardware snd_em28xx_hw_capture = {
.info = SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP   |
SNDRV_PCM_INFO_INTERLEAVED|
diff --git a/drivers/media/usb/go7007/snd-go7007.c 
b/drivers/media/usb/go7007/snd-go7007.c
index 070871f..c618764 100644
--- a/drivers/media/usb/go7007/snd-go7007.c
+++ b/drivers/media/usb/go7007/snd-go7007.c
@@ -52,7 +52,7 @@ struct go7007_snd {
int capturing;
 };
 
-static struct snd_pcm_hardware go7007_snd_capture_hw = {
+static const struct snd_pcm_hardware go7007_snd_capture_hw = {
.info   = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
diff --git a/drivers/media/usb/tm6000/tm6000-alsa.c 
b/drivers/media/usb/tm6000/tm6000-alsa.c
index 4223225..3717a68 100644
--- a/drivers/media/usb/tm6000/tm6000-alsa.c
+++ b/drivers/media/usb/tm6000/tm6000-alsa.c
@@ -143,7 +143,7 @@ static int dsp_buffer_alloc(struct snd_pcm_substream 
*substream, int size)
  */
 #define DEFAULT_FIFO_SIZE  4096
 
-static struct snd_pcm_hardware snd_tm6000_digital_hw = {
+static const struct snd_pcm_hardware snd_tm6000_digital_hw = {
.info = SNDRV_PCM_INFO_BATCH |
SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
diff --git a/drivers/media/usb/usbtv/usbtv-audio.c 
b/drivers/media/usb/usbtv/usbtv-audio.c
index 9db31db..2c2ca77 100644
--- a/drivers/media/usb/usbtv/usbtv-audio.c
+++ b/drivers/media/usb/usbtv/usbtv-audio.c
@@ -43,7 +43,7 @@
 
 #include "usbtv.h"
 
-static struct snd_pcm_hardware snd_usbtv_digital_hw = {
+static const struct snd_pcm_hardware snd_usbtv_digital_hw = {
.info = SNDRV_PCM_INFO_BATCH |
SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: vboxvideo: make drm_fb_helper_funcs const

2017-08-08 Thread Bhumika Goyal
Make the structure const as it is only passed to the function
drm_fb_helper_prepare and the corresponding argument is of type
const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/vboxvideo/vbox_fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vboxvideo/vbox_fb.c 
b/drivers/staging/vboxvideo/vbox_fb.c
index bf66358..c386039 100644
--- a/drivers/staging/vboxvideo/vbox_fb.c
+++ b/drivers/staging/vboxvideo/vbox_fb.c
@@ -317,7 +317,7 @@ static int vboxfb_create(struct drm_fb_helper *helper,
return 0;
 }
 
-static struct drm_fb_helper_funcs vbox_fb_helper_funcs = {
+static const struct drm_fb_helper_funcs vbox_fb_helper_funcs = {
.fb_probe = vboxfb_create,
 };
 
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: obd: make echo_lock_ops const

2017-08-03 Thread Bhumika Goyal
Declare echo_lock_ops object of type cl_lock_operations as const as it
is only passed to the function cl_lock_slice_add. The corresponding
argument is of type const, so make the object const.

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/lustre/lustre/obdecho/echo_client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c 
b/drivers/staging/lustre/lustre/obdecho/echo_client.c
index 1c4a8fe..b3fbc3c 100644
--- a/drivers/staging/lustre/lustre/obdecho/echo_client.c
+++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c
@@ -319,7 +319,7 @@ static void echo_lock_fini(const struct lu_env *env,
kmem_cache_free(echo_lock_kmem, ecl);
 }
 
-static struct cl_lock_operations echo_lock_ops = {
+static const struct cl_lock_operations echo_lock_ops = {
.clo_fini  = echo_lock_fini,
 };
 
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [Outreachy kernel] [PATCH] Staging: rtl8188eu: Remove ternary operator

2016-09-12 Thread Bhumika Goyal
On Mon, Sep 12, 2016 at 8:14 PM, Jes Sorensen  wrote:
> On 09/12/16 09:58, Bhumika Goyal wrote:
>> Relational and logical operators evaluate to either true or false.
>> Explicit conversion is not needed so remove the ternary operator.
>> Done using coccinelle:
>>
>> @r@
>> expression A,B;
>> symbol true,false;
>> binary operator b = {==,!=,&&,||,>=,<=,>,<};
>> @@
>> - (A b B) ? true : false
>> + A b B
>>
>> Signed-off-by: Bhumika Goyal 
>> ---
>>  drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 8 
>>  drivers/staging/rtl8188eu/hal/phy.c   | 2 +-
>>  drivers/staging/rtl8188eu/hal/rtl8188e_dm.c   | 3 ++-
>>  3 files changed, 7 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c 
>> b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
>> index 9544e55..b43f57be 100644
>> --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
>> +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
>> @@ -705,7 +705,7 @@ static int issue_probereq_ex(struct adapter *padapter,
>>   unsigned long start = jiffies;
>>
>>   do {
>> - ret = issue_probereq(padapter, pssid, da, wait_ms > 0 ? true : 
>> false);
>> + ret = issue_probereq(padapter, pssid, da, wait_ms > 0);
>>
>>   i++;
>>
>> @@ -1293,7 +1293,7 @@ int issue_nulldata(struct adapter *padapter, unsigned 
>> char *da, unsigned int pow
>>   da = pnetwork->MacAddress;
>>
>>   do {
>> - ret = _issue_nulldata(padapter, da, power_mode, wait_ms > 0 ? 
>> true : false);
>> + ret = _issue_nulldata(padapter, da, power_mode, wait_ms > 0);
>>
>>   i++;
>>
>> @@ -1420,7 +1420,7 @@ int issue_qos_nulldata(struct adapter *padapter, 
>> unsigned char *da, u16 tid, int
>>   da = pnetwork->MacAddress;
>>
>>   do {
>> - ret = _issue_qos_nulldata(padapter, da, tid, wait_ms > 0 ? 
>> true : false);
>> + ret = _issue_qos_nulldata(padapter, da, tid, wait_ms > 0);
>>
>>   i++;
>>
>> @@ -1527,7 +1527,7 @@ static int issue_deauth_ex(struct adapter *padapter, 
>> u8 *da,
>>   unsigned long start = jiffies;
>>
>>   do {
>> - ret = _issue_deauth(padapter, da, reason, wait_ms > 0 ? true : 
>> false);
>> + ret = _issue_deauth(padapter, da, reason, wait_ms > 0);
>>
>>   i++;
>
> While this part of the patch is technically correct, I would argue it
> doesn't improve the code. It would make the code more readable to pass
> in the wait_ms value and then have the decision made based on that in
> the called function.
>

Ok, I will keep the wait_ms ternary operation as it is and send a v2.
Thanks for the input.

Thanks,
Bhumika

> Cheers,
> Jes
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rtl8188eu: Remove ternary operator

2016-09-12 Thread Bhumika Goyal
Relational and logical operators evaluate to either true or false.
Explicit conversion is not needed so remove the ternary operator.
Done using coccinelle:

@r@
expression A,B;
symbol true,false;
binary operator b = {==,!=,&&,||,>=,<=,>,<};
@@
- (A b B) ? true : false
+ A b B

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 8 
 drivers/staging/rtl8188eu/hal/phy.c   | 2 +-
 drivers/staging/rtl8188eu/hal/rtl8188e_dm.c   | 3 ++-
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 9544e55..b43f57be 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -705,7 +705,7 @@ static int issue_probereq_ex(struct adapter *padapter,
unsigned long start = jiffies;
 
do {
-   ret = issue_probereq(padapter, pssid, da, wait_ms > 0 ? true : 
false);
+   ret = issue_probereq(padapter, pssid, da, wait_ms > 0);
 
i++;
 
@@ -1293,7 +1293,7 @@ int issue_nulldata(struct adapter *padapter, unsigned 
char *da, unsigned int pow
da = pnetwork->MacAddress;
 
do {
-   ret = _issue_nulldata(padapter, da, power_mode, wait_ms > 0 ? 
true : false);
+   ret = _issue_nulldata(padapter, da, power_mode, wait_ms > 0);
 
i++;
 
@@ -1420,7 +1420,7 @@ int issue_qos_nulldata(struct adapter *padapter, unsigned 
char *da, u16 tid, int
da = pnetwork->MacAddress;
 
do {
-   ret = _issue_qos_nulldata(padapter, da, tid, wait_ms > 0 ? true 
: false);
+   ret = _issue_qos_nulldata(padapter, da, tid, wait_ms > 0);
 
i++;
 
@@ -1527,7 +1527,7 @@ static int issue_deauth_ex(struct adapter *padapter, u8 
*da,
unsigned long start = jiffies;
 
do {
-   ret = _issue_deauth(padapter, da, reason, wait_ms > 0 ? true : 
false);
+   ret = _issue_deauth(padapter, da, reason, wait_ms > 0);
 
i++;
 
diff --git a/drivers/staging/rtl8188eu/hal/phy.c 
b/drivers/staging/rtl8188eu/hal/phy.c
index 776e5b8..41e0cbc 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -1292,7 +1292,7 @@ void rtl88eu_phy_iq_calibrate(struct adapter *adapt, bool 
recovery)
rOFDM0_RxIQExtAnta};
bool is2t;
 
-   is2t = (dm_odm->RFType == ODM_2T2R) ? true : false;
+   is2t = dm_odm->RFType == ODM_2T2R;
 
if (!(dm_odm->SupportAbility & ODM_RF_CALIBRATION))
return;
diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c 
b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
index 11e7246..962102d 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
@@ -60,7 +60,8 @@ static void Init_ODM_ComInfo_88E(struct adapter *Adapter)
 
ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_CUT_VER, cut_ver);
 
-   ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_MP_TEST_CHIP, 
hal_data->VersionID.ChipType == NORMAL_CHIP ? true : false);
+   ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_MP_TEST_CHIP,
+   hal_data->VersionID.ChipType == NORMAL_CHIP);
 
ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_PATCH_ID, hal_data->CustomerID);
ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_BWIFI_TEST, 
Adapter->registrypriv.wifi_spec);
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rts5208: rtsx_card.c: Remove unused function

2016-03-26 Thread Bhumika Goyal
The functions double_depth, check_card_fail, check_card_ejected are not
used anywhere in the kernel. So, remove their prototype and definition.
Grepped to find occurences.

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/rts5208/rtsx_card.c | 21 -
 drivers/staging/rts5208/rtsx_card.h |  2 --
 2 files changed, 23 deletions(-)

diff --git a/drivers/staging/rts5208/rtsx_card.c 
b/drivers/staging/rts5208/rtsx_card.c
index 437436f..231833a 100644
--- a/drivers/staging/rts5208/rtsx_card.c
+++ b/drivers/staging/rts5208/rtsx_card.c
@@ -628,11 +628,6 @@ void rtsx_init_cards(struct rtsx_chip *chip)
}
 }
 
-static inline u8 double_depth(u8 depth)
-{
-   return (depth > 1) ? (depth - 1) : depth;
-}
-
 int switch_ssc_clock(struct rtsx_chip *chip, int clk)
 {
int retval;
@@ -1184,22 +1179,6 @@ int check_card_wp(struct rtsx_chip *chip, unsigned int 
lun)
return 0;
 }
 
-int check_card_fail(struct rtsx_chip *chip, unsigned int lun)
-{
-   if (chip->card_fail & chip->lun2card[lun])
-   return 1;
-
-   return 0;
-}
-
-int check_card_ejected(struct rtsx_chip *chip, unsigned int lun)
-{
-   if (chip->card_ejected & chip->lun2card[lun])
-   return 1;
-
-   return 0;
-}
-
 u8 get_lun_card(struct rtsx_chip *chip, unsigned int lun)
 {
if ((chip->card_ready & chip->lun2card[lun]) == XD_CARD)
diff --git a/drivers/staging/rts5208/rtsx_card.h 
b/drivers/staging/rts5208/rtsx_card.h
index 8f2cf9a4e..56df9a4 100644
--- a/drivers/staging/rts5208/rtsx_card.h
+++ b/drivers/staging/rts5208/rtsx_card.h
@@ -1024,8 +1024,6 @@ int detect_card_cd(struct rtsx_chip *chip, int card);
 int check_card_exist(struct rtsx_chip *chip, unsigned int lun);
 int check_card_ready(struct rtsx_chip *chip, unsigned int lun);
 int check_card_wp(struct rtsx_chip *chip, unsigned int lun);
-int check_card_fail(struct rtsx_chip *chip, unsigned int lun);
-int check_card_ejected(struct rtsx_chip *chip, unsigned int lun);
 void eject_card(struct rtsx_chip *chip, unsigned int lun);
 u8 get_lun_card(struct rtsx_chip *chip, unsigned int lun);
 
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rts5208: Remove unused functions

2016-03-26 Thread Bhumika Goyal
The functions rtsx_disable_card_int, rtsx_undo_delink,
rtsx_check_link_ready are not used anywhere in the kernel. So,remove
their definition and prototype.

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/rts5208/rtsx_chip.c | 35 ---
 drivers/staging/rts5208/rtsx_chip.h |  3 ---
 2 files changed, 38 deletions(-)

diff --git a/drivers/staging/rts5208/rtsx_chip.c 
b/drivers/staging/rts5208/rtsx_chip.c
index c0ce659..bcc4b66 100644
--- a/drivers/staging/rts5208/rtsx_chip.c
+++ b/drivers/staging/rts5208/rtsx_chip.c
@@ -43,14 +43,6 @@ static void rtsx_calibration(struct rtsx_chip *chip)
rtsx_write_phy_register(chip, 0x00, 0x0288);
 }
 
-void rtsx_disable_card_int(struct rtsx_chip *chip)
-{
-   u32 reg = rtsx_readl(chip, RTSX_BIER);
-
-   reg &= ~(XD_INT_EN | SD_INT_EN | MS_INT_EN);
-   rtsx_writel(chip, RTSX_BIER, reg);
-}
-
 void rtsx_enable_card_int(struct rtsx_chip *chip)
 {
u32 reg = rtsx_readl(chip, RTSX_BIER);
@@ -1447,12 +1439,6 @@ delink_stage:
rtsx_delink_stage(chip);
 }
 
-void rtsx_undo_delink(struct rtsx_chip *chip)
-{
-   chip->auto_delink_allowed = 0;
-   rtsx_write_register(chip, CHANGE_LINK_STATE, 0x0A, 0x00);
-}
-
 /**
  * rtsx_stop_cmd - stop command transfer and DMA transfer
  * @chip: Realtek's card reader chip
@@ -2000,27 +1986,6 @@ int rtsx_set_phy_reg_bit(struct rtsx_chip *chip, u8 reg, 
u8 bit)
return STATUS_SUCCESS;
 }
 
-int rtsx_check_link_ready(struct rtsx_chip *chip)
-{
-   int retval;
-   u8 val;
-
-   retval = rtsx_read_register(chip, IRQSTAT0, &val);
-   if (retval) {
-   rtsx_trace(chip);
-   return retval;
-   }
-
-   dev_dbg(rtsx_dev(chip), "IRQSTAT0: 0x%x\n", val);
-   if (val & LINK_RDY_INT) {
-   dev_dbg(rtsx_dev(chip), "Delinked!\n");
-   rtsx_write_register(chip, IRQSTAT0, LINK_RDY_INT, LINK_RDY_INT);
-   return STATUS_FAIL;
-   }
-
-   return STATUS_SUCCESS;
-}
-
 static void rtsx_handle_pm_dstate(struct rtsx_chip *chip, u8 dstate)
 {
u32 ultmp;
diff --git a/drivers/staging/rts5208/rtsx_chip.h 
b/drivers/staging/rts5208/rtsx_chip.h
index c295b1e..c08164f 100644
--- a/drivers/staging/rts5208/rtsx_chip.h
+++ b/drivers/staging/rts5208/rtsx_chip.h
@@ -950,7 +950,6 @@ do {
\
 int rtsx_force_power_on(struct rtsx_chip *chip, u8 ctl);
 int rtsx_force_power_down(struct rtsx_chip *chip, u8 ctl);
 
-void rtsx_disable_card_int(struct rtsx_chip *chip);
 void rtsx_enable_card_int(struct rtsx_chip *chip);
 void rtsx_enable_bus_int(struct rtsx_chip *chip);
 void rtsx_disable_bus_int(struct rtsx_chip *chip);
@@ -958,7 +957,6 @@ int rtsx_reset_chip(struct rtsx_chip *chip);
 int rtsx_init_chip(struct rtsx_chip *chip);
 void rtsx_release_chip(struct rtsx_chip *chip);
 void rtsx_polling_func(struct rtsx_chip *chip);
-void rtsx_undo_delink(struct rtsx_chip *chip);
 void rtsx_stop_cmd(struct rtsx_chip *chip, int card);
 int rtsx_write_register(struct rtsx_chip *chip, u16 addr, u8 mask, u8 data);
 int rtsx_read_register(struct rtsx_chip *chip, u16 addr, u8 *data);
@@ -975,7 +973,6 @@ int rtsx_read_efuse(struct rtsx_chip *chip, u8 addr, u8 
*val);
 int rtsx_write_efuse(struct rtsx_chip *chip, u8 addr, u8 val);
 int rtsx_clr_phy_reg_bit(struct rtsx_chip *chip, u8 reg, u8 bit);
 int rtsx_set_phy_reg_bit(struct rtsx_chip *chip, u8 reg, u8 bit);
-int rtsx_check_link_ready(struct rtsx_chip *chip);
 void rtsx_enter_ss(struct rtsx_chip *chip);
 void rtsx_exit_ss(struct rtsx_chip *chip);
 int rtsx_pre_handle_interrupt(struct rtsx_chip *chip);
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rtl8723au: Remove function rtw_enqueue_{recvbuf23a/recvbuf23a_to_head}

2016-03-25 Thread Bhumika Goyal
The functions rtw_enqueue_recvbuf23a and rtw_enqueue_recvbuf23a_to_head
are never used anywhere in the kernel. So, remove their definition and
prototype.
Grepped to find occurences.

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/rtl8723au/core/rtw_recv.c| 25 -
 drivers/staging/rtl8723au/include/rtw_recv.h |  2 --
 2 files changed, 27 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_recv.c 
b/drivers/staging/rtl8723au/core/rtw_recv.c
index 989ed07..150dabc 100644
--- a/drivers/staging/rtl8723au/core/rtw_recv.c
+++ b/drivers/staging/rtl8723au/core/rtw_recv.c
@@ -211,31 +211,6 @@ u32 rtw_free_uc_swdec_pending_queue23a(struct rtw_adapter 
*adapter)
return cnt;
 }
 
-int rtw_enqueue_recvbuf23a_to_head(struct recv_buf *precvbuf, struct rtw_queue 
*queue)
-{
-   spin_lock_bh(&queue->lock);
-
-   list_del_init(&precvbuf->list);
-   list_add(&precvbuf->list, get_list_head(queue));
-
-   spin_unlock_bh(&queue->lock);
-
-   return _SUCCESS;
-}
-
-int rtw_enqueue_recvbuf23a(struct recv_buf *precvbuf, struct rtw_queue *queue)
-{
-   unsigned long irqL;
-
-   spin_lock_irqsave(&queue->lock, irqL);
-
-   list_del_init(&precvbuf->list);
-
-   list_add_tail(&precvbuf->list, get_list_head(queue));
-   spin_unlock_irqrestore(&queue->lock, irqL);
-   return _SUCCESS;
-}
-
 struct recv_buf *rtw_dequeue_recvbuf23a (struct rtw_queue *queue)
 {
unsigned long irqL;
diff --git a/drivers/staging/rtl8723au/include/rtw_recv.h 
b/drivers/staging/rtl8723au/include/rtw_recv.h
index dc784be..85a5edb 100644
--- a/drivers/staging/rtl8723au/include/rtw_recv.h
+++ b/drivers/staging/rtl8723au/include/rtw_recv.h
@@ -279,8 +279,6 @@ int rtw_enqueue_recvframe23a(struct recv_frame *precvframe, 
struct rtw_queue *qu
 
 u32 rtw_free_uc_swdec_pending_queue23a(struct rtw_adapter *adapter);
 
-int rtw_enqueue_recvbuf23a_to_head(struct recv_buf *precvbuf, struct rtw_queue 
*queue);
-int rtw_enqueue_recvbuf23a(struct recv_buf *precvbuf, struct rtw_queue *queue);
 struct recv_buf *rtw_dequeue_recvbuf23a(struct rtw_queue *queue);
 
 void rtw_reordering_ctrl_timeout_handler23a(unsigned long pcontext);
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rtl8723au: Remove unused functions

2016-03-25 Thread Bhumika Goyal
The functions rtw_get_oper_bw23a and rtw_get_oper_ch23aoffset are never
used anywhere in the kernel. So, remove their definition and prototype.
Grepped to find occurences.

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/rtl8723au/core/rtw_wlan_util.c   | 10 --
 drivers/staging/rtl8723au/include/rtw_mlme_ext.h |  2 --
 2 files changed, 12 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_wlan_util.c 
b/drivers/staging/rtl8723au/core/rtw_wlan_util.c
index cc2b84b..694cf17 100644
--- a/drivers/staging/rtl8723au/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723au/core/rtw_wlan_util.c
@@ -304,21 +304,11 @@ inline void rtw_set_oper_ch23a(struct rtw_adapter 
*adapter, u8 ch)
adapter_to_dvobj(adapter)->oper_channel = ch;
 }
 
-inline u8 rtw_get_oper_bw23a(struct rtw_adapter *adapter)
-{
-   return adapter_to_dvobj(adapter)->oper_bwmode;
-}
-
 inline void rtw_set_oper_bw23a(struct rtw_adapter *adapter, u8 bw)
 {
adapter_to_dvobj(adapter)->oper_bwmode = bw;
 }
 
-inline u8 rtw_get_oper_ch23aoffset(struct rtw_adapter *adapter)
-{
-   return adapter_to_dvobj(adapter)->oper_ch_offset;
-}
-
 inline void rtw_set_oper_ch23aoffset23a(struct rtw_adapter *adapter, u8 offset)
 {
adapter_to_dvobj(adapter)->oper_ch_offset = offset;
diff --git a/drivers/staging/rtl8723au/include/rtw_mlme_ext.h 
b/drivers/staging/rtl8723au/include/rtw_mlme_ext.h
index ea2a6c9..0e7d3da 100644
--- a/drivers/staging/rtl8723au/include/rtw_mlme_ext.h
+++ b/drivers/staging/rtl8723au/include/rtw_mlme_ext.h
@@ -461,9 +461,7 @@ void Update23aTblForSoftAP(u8 *bssrateset, u32 bssratelen);
 
 u8 rtw_get_oper_ch23a(struct rtw_adapter *adapter);
 void rtw_set_oper_ch23a(struct rtw_adapter *adapter, u8 ch);
-u8 rtw_get_oper_bw23a(struct rtw_adapter *adapter);
 void rtw_set_oper_bw23a(struct rtw_adapter *adapter, u8 bw);
-u8 rtw_get_oper_ch23aoffset(struct rtw_adapter *adapter);
 void rtw_set_oper_ch23aoffset23a(struct rtw_adapter *adapter, u8 offset);
 
 void set_channel_bwmode23a(struct rtw_adapter *padapter, unsigned char channel,
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging:wlan-ng:Merged two lines into one

2016-02-08 Thread Bhumika Goyal
The last two lines of these functions are compressed into one.
Also removed the variable ret as it is now not used.
Found using coccinelle:
@@
expression e, ret;
@@

-ret =
+return
 e;
-return ret;

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/wlan-ng/hfa384x_usb.c | 20 
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c 
b/drivers/staging/wlan-ng/hfa384x_usb.c
index 682de77..fda8a95 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -1012,7 +1012,6 @@ int hfa384x_cmd_initialize(hfa384x_t *hw)
 */
 int hfa384x_cmd_disable(hfa384x_t *hw, u16 macport)
 {
-   int result = 0;
hfa384x_metacmd_t cmd;
 
cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_DISABLE) |
@@ -1021,9 +1020,7 @@ int hfa384x_cmd_disable(hfa384x_t *hw, u16 macport)
cmd.parm1 = 0;
cmd.parm2 = 0;
 
-   result = hfa384x_docmd_wait(hw, &cmd);
-
-   return result;
+   return hfa384x_docmd_wait(hw, &cmd);
 }
 
 /*
@@ -1048,7 +1045,6 @@ int hfa384x_cmd_disable(hfa384x_t *hw, u16 macport)
 */
 int hfa384x_cmd_enable(hfa384x_t *hw, u16 macport)
 {
-   int result = 0;
hfa384x_metacmd_t cmd;
 
cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_ENABLE) |
@@ -1057,9 +1053,7 @@ int hfa384x_cmd_enable(hfa384x_t *hw, u16 macport)
cmd.parm1 = 0;
cmd.parm2 = 0;
 
-   result = hfa384x_docmd_wait(hw, &cmd);
-
-   return result;
+   return hfa384x_docmd_wait(hw, &cmd);
 }
 
 /*
@@ -1093,7 +1087,6 @@ int hfa384x_cmd_enable(hfa384x_t *hw, u16 macport)
 */
 int hfa384x_cmd_monitor(hfa384x_t *hw, u16 enable)
 {
-   int result = 0;
hfa384x_metacmd_t cmd;
 
cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
@@ -1102,9 +1095,7 @@ int hfa384x_cmd_monitor(hfa384x_t *hw, u16 enable)
cmd.parm1 = 0;
cmd.parm2 = 0;
 
-   result = hfa384x_docmd_wait(hw, &cmd);
-
-   return result;
+   return hfa384x_docmd_wait(hw, &cmd);
 }
 
 /*
@@ -1148,7 +1139,6 @@ int hfa384x_cmd_monitor(hfa384x_t *hw, u16 enable)
 int hfa384x_cmd_download(hfa384x_t *hw, u16 mode, u16 lowaddr,
 u16 highaddr, u16 codelen)
 {
-   int result = 0;
hfa384x_metacmd_t cmd;
 
pr_debug("mode=%d, lowaddr=0x%04x, highaddr=0x%04x, codelen=%d\n",
@@ -1161,9 +1151,7 @@ int hfa384x_cmd_download(hfa384x_t *hw, u16 mode, u16 
lowaddr,
cmd.parm1 = highaddr;
cmd.parm2 = codelen;
 
-   result = hfa384x_docmd_wait(hw, &cmd);
-
-   return result;
+   return hfa384x_docmd_wait(hw, &cmd);
 }
 
 /*
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/2] Staging:iio:adc:Prefer using BIT macro

2016-02-07 Thread Bhumika Goyal
This patchset replaces bit shifting on 1 with the BIT(x) macro.
This was done with coccinelle:
@@ int g; @@ 
-(1 << g) 
+BIT(g)

Bhumika Goyal (2):
  Staging:iio:Prefer using BIT macro
  Staging: iio: adc: Prefer using the BIT macro

 drivers/staging/iio/adc/ad7280a.c | 4 ++--
 drivers/staging/iio/adc/ad7816.c  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] Staging:iio:Prefer using BIT macro

2016-02-07 Thread Bhumika Goyal
This patch replaces bit shifting on 1 with the BIT(x) macro.
This was done with coccinelle:
 @@ int g; @@
-(1 << g)
+BIT(g)

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/iio/adc/ad7816.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c
index 2226051..f631012 100644
--- a/drivers/staging/iio/adc/ad7816.c
+++ b/drivers/staging/iio/adc/ad7816.c
@@ -222,7 +222,7 @@ static ssize_t ad7816_show_value(struct device *dev,
value = (s8)((data >> AD7816_TEMP_FLOAT_OFFSET) - 103);
data &= AD7816_TEMP_FLOAT_MASK;
if (value < 0)
-   data = (1 << AD7816_TEMP_FLOAT_OFFSET) - data;
+   data = BIT(AD7816_TEMP_FLOAT_OFFSET) - data;
return sprintf(buf, "%d.%.2d\n", value, data * 25);
}
return sprintf(buf, "%u\n", data);
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/2] Staging: iio: adc: Prefer using the BIT macro

2016-02-07 Thread Bhumika Goyal
This patch replaces bit shifting on 1 with the BIT(x) macro.

This was done with coccinelle:

@@ int g; @@

-(1 << g)
+BIT(g)

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/iio/adc/ad7280a.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7280a.c 
b/drivers/staging/iio/adc/ad7280a.c
index 0c73bce..ccf3157 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -117,7 +117,7 @@
  */
 #define POLYNOM0x2F
 #define POLYNOM_ORDER  8
-#define HIGHBIT(1 << (POLYNOM_ORDER - 1))
+#define HIGHBITBIT((POLYNOM_ORDER - 1))
 
 struct ad7280_state {
struct spi_device   *spi;
@@ -388,7 +388,7 @@ static ssize_t ad7280_show_balance_sw(struct device *dev,
 
return sprintf(buf, "%d\n",
   !!(st->cb_mask[this_attr->address >> 8] &
-  (1 << ((this_attr->address & 0xFF) + 2;
+  BIT(((this_attr->address & 0xFF) + 2;
 }
 
 static ssize_t ad7280_store_balance_sw(struct device *dev,
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging:iio:Remove exceptional & on function name

2016-02-04 Thread Bhumika Goyal
In this file,function names are otherwise used as pointers without &.
Found using coccinelle.
// 
@r@
identifier f;
@@

f(...) { ... }
@@
identifier r.f;
@@

- &f
+ f
// 

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/iio/impedance-analyzer/ad5933.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c 
b/drivers/staging/iio/impedance-analyzer/ad5933.c
index 10c43dda..d1218d8 100644
--- a/drivers/staging/iio/impedance-analyzer/ad5933.c
+++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
@@ -558,7 +558,7 @@ out:
 }
 
 static const struct iio_info ad5933_info = {
-   .read_raw = &ad5933_read_raw,
+   .read_raw = ad5933_read_raw,
.attrs = &ad5933_attribute_group,
.driver_module = THIS_MODULE,
 };
@@ -616,9 +616,9 @@ static int ad5933_ring_postdisable(struct iio_dev 
*indio_dev)
 }
 
 static const struct iio_buffer_setup_ops ad5933_ring_setup_ops = {
-   .preenable = &ad5933_ring_preenable,
-   .postenable = &ad5933_ring_postenable,
-   .postdisable = &ad5933_ring_postdisable,
+   .preenable = ad5933_ring_preenable,
+   .postenable = ad5933_ring_postenable,
+   .postdisable = ad5933_ring_postdisable,
 };
 
 static int ad5933_register_ring_funcs_and_init(struct iio_dev *indio_dev)
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging:octeon:removed blank line after {

2016-02-02 Thread Bhumika Goyal
Removed blank line after curly braces.
Found using checkpatch.pl.

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/octeon/ethernet-rgmii.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/octeon/ethernet-rgmii.c 
b/drivers/staging/octeon/ethernet-rgmii.c
index 1055ee1..9353796 100644
--- a/drivers/staging/octeon/ethernet-rgmii.c
+++ b/drivers/staging/octeon/ethernet-rgmii.c
@@ -247,9 +247,7 @@ int cvm_oct_rgmii_init(struct net_device *dev)
if (((priv->imode == CVMX_HELPER_INTERFACE_MODE_GMII)
 && (priv->port == 0))
|| (priv->imode == CVMX_HELPER_INTERFACE_MODE_RGMII)) {
-
if (!octeon_is_simulation()) {
-
union cvmx_gmxx_rxx_int_en gmx_rx_int_en;
int interface = INTERFACE(priv->port);
int index = INDEX(priv->port);
@@ -283,9 +281,7 @@ void cvm_oct_rgmii_uninit(struct net_device *dev)
if (((priv->imode == CVMX_HELPER_INTERFACE_MODE_GMII)
 && (priv->port == 0))
|| (priv->imode == CVMX_HELPER_INTERFACE_MODE_RGMII)) {
-
if (!octeon_is_simulation()) {
-
union cvmx_gmxx_rxx_int_en gmx_rx_int_en;
int interface = INTERFACE(priv->port);
int index = INDEX(priv->port);
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[RESEND PATCH] Staging:speakup:add space around '|'

2016-02-01 Thread Bhumika Goyal
Fix checkpatch.pl check:CHECK: spaces preferred around that '|'.
Add spaces around operands to fix these warnings.

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/speakup/speakup_decext.c | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/speakup/speakup_decext.c 
b/drivers/staging/speakup/speakup_decext.c
index fdd7488..1a5cf3d 100644
--- a/drivers/staging/speakup/speakup_decext.c
+++ b/drivers/staging/speakup/speakup_decext.c
@@ -67,30 +67,30 @@ static struct var_t vars[] = {
  * These attributes will appear in /sys/accessibility/speakup/decext.
  */
 static struct kobj_attribute caps_start_attribute =
-   __ATTR(caps_start, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(caps_start, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute caps_stop_attribute =
-   __ATTR(caps_stop, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(caps_stop, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute pitch_attribute =
-   __ATTR(pitch, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(pitch, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute punct_attribute =
-   __ATTR(punct, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(punct, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute rate_attribute =
-   __ATTR(rate, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(rate, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute voice_attribute =
-   __ATTR(voice, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(voice, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute vol_attribute =
-   __ATTR(vol, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(vol, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 
 static struct kobj_attribute delay_time_attribute =
-   __ATTR(delay_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(delay_time, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute direct_attribute =
-   __ATTR(direct, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(direct, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute full_time_attribute =
-   __ATTR(full_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(full_time, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute jiffy_delta_attribute =
-   __ATTR(jiffy_delta, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(jiffy_delta, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute trigger_time_attribute =
-   __ATTR(trigger_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(trigger_time, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 
 /*
  * Create a group of attributes so that we can create and destroy them all
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging:lustre:lclient:Remove unused function

2016-01-29 Thread Bhumika Goyal
Discard the function ccc_vmpage_page_transient as it is not used
anywhere in the kernel.
Used grep to find occurences.
Problem found using sparse.

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/lustre/lustre/lclient/lcommon_cl.c | 11 ---
 1 file changed, 11 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c 
b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
index 34dde7d..4dfeb4e 100644
--- a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
+++ b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
@@ -986,17 +986,6 @@ struct inode *ccc_object_inode(const struct cl_object *obj)
 }
 
 /**
- * Returns a pointer to cl_page associated with \a vmpage, without acquiring
- * additional reference to the resulting page. This is an unsafe version of
- * cl_vmpage_page() that can only be used under vmpage lock.
- */
-struct cl_page *ccc_vmpage_page_transient(struct page *vmpage)
-{
-   KLASSERT(PageLocked(vmpage));
-   return (struct cl_page *)vmpage->private;
-}
-
-/**
  * Initialize or update CLIO structures for regular files when new
  * meta-data arrives from the server.
  *
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging:lustre:lustre:llite:Remove explicit NULL comparision

2016-01-23 Thread Bhumika Goyal
Replaced explicit NULL comparision with its simplier form.
Found using coccinelle:

@replace_rule@
expression e;
@@

-e == NULL
+ !e

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/lustre/lustre/llite/dcache.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dcache.c 
b/drivers/staging/lustre/lustre/llite/dcache.c
index 3d6745e..bc179e5 100644
--- a/drivers/staging/lustre/lustre/llite/dcache.c
+++ b/drivers/staging/lustre/lustre/llite/dcache.c
@@ -62,7 +62,7 @@ static void ll_release(struct dentry *de)
 
LASSERT(de != NULL);
lld = ll_d2d(de);
-   if (lld == NULL) /* NFS copies the de->d_op methods (bug 4655) */
+   if (!lld) /* NFS copies the de->d_op methods (bug 4655) */
return;
 
if (lld->lld_it) {
@@ -131,7 +131,7 @@ static int find_cbdata(struct inode *inode)
return rc;
 
lsm = ccc_inode_lsm_get(inode);
-   if (lsm == NULL)
+   if (!lsm)
return rc;
 
rc = obd_find_cbdata(sbi->ll_dt_exp, lsm, return_if_equal, NULL);
@@ -184,13 +184,13 @@ int ll_d_init(struct dentry *de)
de, de, de->d_parent, d_inode(de),
d_count(de));
 
-   if (de->d_fsdata == NULL) {
+   if (!de->d_fsdata) {
struct ll_dentry_data *lld;
 
lld = kzalloc(sizeof(*lld), GFP_NOFS);
if (likely(lld)) {
spin_lock(&de->d_lock);
-   if (likely(de->d_fsdata == NULL)) {
+   if (likely(!de->d_fsdata)) {
de->d_fsdata = lld;
__d_lustre_invalidate(de);
} else {
@@ -328,7 +328,7 @@ static int ll_revalidate_dentry(struct dentry *dentry,
if (lookup_flags & LOOKUP_RCU)
return -ECHILD;
 
-   do_statahead_enter(dir, &dentry, d_inode(dentry) == NULL);
+   do_statahead_enter(dir, &dentry, !d_inode(dentry));
ll_statahead_mark(dir, dentry);
return 1;
 }
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging:lustre:obdclass:linux:convert &foo[0] to foo

2016-01-20 Thread Bhumika Goyal
Replace &foo[0] with foo,to follow Linux coding style.

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c 
b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
index 11fe6cb..ecc2897 100644
--- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
@@ -130,22 +130,22 @@ int obd_ioctl_getdata(char **buf, int *len, void *arg)
}
 
if (data->ioc_inllen1) {
-   data->ioc_inlbuf1 = &data->ioc_bulk[0];
+   data->ioc_inlbuf1 = data->ioc_bulk;
offset += cfs_size_round(data->ioc_inllen1);
}
 
if (data->ioc_inllen2) {
-   data->ioc_inlbuf2 = &data->ioc_bulk[0] + offset;
+   data->ioc_inlbuf2 = data->ioc_bulk + offset;
offset += cfs_size_round(data->ioc_inllen2);
}
 
if (data->ioc_inllen3) {
-   data->ioc_inlbuf3 = &data->ioc_bulk[0] + offset;
+   data->ioc_inlbuf3 = data->ioc_bulk + offset;
offset += cfs_size_round(data->ioc_inllen3);
}
 
if (data->ioc_inllen4)
-   data->ioc_inlbuf4 = &data->ioc_bulk[0] + offset;
+   data->ioc_inlbuf4 = data->ioc_bulk + offset;
 
return 0;
 
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/2] Staging:lustre:obdclass:linux:simplify NULL comparison

2016-01-20 Thread Bhumika Goyal
Remove explicit NULL comparision and replace it with a simpier form.
Detected using checkpatch.pl.

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c 
b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
index 9663ae3..11fe6cb 100644
--- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
@@ -239,7 +239,7 @@ static ssize_t health_show(struct kobject *kobj, struct 
attribute *attr,
struct obd_device *obd;
 
obd = class_num2obd(i);
-   if (obd == NULL || !obd->obd_attached || !obd->obd_set_up)
+   if (!obd || !obd->obd_attached || !obd->obd_set_up)
continue;
 
LASSERT(obd->obd_magic == OBD_DEVICE_MAGIC);
@@ -358,7 +358,7 @@ static int obd_device_list_seq_show(struct seq_file *p, 
void *v)
struct obd_device *obd = class_num2obd((int)index);
char *status;
 
-   if (obd == NULL)
+   if (!obd)
return 0;
 
LASSERT(obd->obd_magic == OBD_DEVICE_MAGIC);
@@ -422,7 +422,7 @@ int class_procfs_init(void)
struct dentry *file;
 
lustre_kobj = kobject_create_and_add("lustre", fs_kobj);
-   if (lustre_kobj == NULL)
+   if (!lustre_kobj)
goto out;
 
/* Create the files associated with this kobject */
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/2]Staging:lustre:obdclass:linux:fix checkpatch.pl warnings

2016-01-20 Thread Bhumika Goyal
This patch series addresses checkpatch.pl warnings in lustre driver.


Bhumika Goyal (2):
  Staging:lustre:obdclass:linux:remove unnecessary braces
  Staging:lustre:obdclass:linux:simplify NULL comparison

 drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] Staging:lustre:obdclass:linux:remove unnecessary braces

2016-01-20 Thread Bhumika Goyal
Fixed 'braces {} are not necessary for single statement blocks'
checkpatch.pl warning.

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c 
b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
index a055cbb..9663ae3 100644
--- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
@@ -144,9 +144,8 @@ int obd_ioctl_getdata(char **buf, int *len, void *arg)
offset += cfs_size_round(data->ioc_inllen3);
}
 
-   if (data->ioc_inllen4) {
+   if (data->ioc_inllen4)
data->ioc_inlbuf4 = &data->ioc_bulk[0] + offset;
-   }
 
return 0;
 
@@ -250,9 +249,8 @@ static ssize_t health_show(struct kobject *kobj, struct 
attribute *attr,
class_incref(obd, __func__, current);
read_unlock(&obd_dev_lock);
 
-   if (obd_health_check(NULL, obd)) {
+   if (obd_health_check(NULL, obd))
healthy = false;
-   }
class_decref(obd, __func__, current);
read_lock(&obd_dev_lock);
}
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging:speakup:add space around '|'

2016-01-16 Thread Bhumika Goyal
Fix checkpatch.pl check:CHECK: spaces preferred around that '|'.
Add spaces around operands to fix these warnings.

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/speakup/speakup_decext.c | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/speakup/speakup_decext.c 
b/drivers/staging/speakup/speakup_decext.c
index e0b5db9..196ead2 100644
--- a/drivers/staging/speakup/speakup_decext.c
+++ b/drivers/staging/speakup/speakup_decext.c
@@ -71,30 +71,30 @@ static struct var_t vars[] = {
  * These attributes will appear in /sys/accessibility/speakup/decext.
  */
 static struct kobj_attribute caps_start_attribute =
-   __ATTR(caps_start, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(caps_start, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute caps_stop_attribute =
-   __ATTR(caps_stop, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(caps_stop, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute pitch_attribute =
-   __ATTR(pitch, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(pitch, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute punct_attribute =
-   __ATTR(punct, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(punct, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute rate_attribute =
-   __ATTR(rate, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(rate, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute voice_attribute =
-   __ATTR(voice, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(voice, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute vol_attribute =
-   __ATTR(vol, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(vol, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 
 static struct kobj_attribute delay_time_attribute =
-   __ATTR(delay_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(delay_time, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute direct_attribute =
-   __ATTR(direct, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(direct, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute full_time_attribute =
-   __ATTR(full_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(full_time, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute jiffy_delta_attribute =
-   __ATTR(jiffy_delta, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(jiffy_delta, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute trigger_time_attribute =
-   __ATTR(trigger_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
+   __ATTR(trigger_time, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store);
 
 /*
  * Create a group of attributes so that we can create and destroy them all
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/2] staging:iio:adc:add space around '-'

2016-01-15 Thread Bhumika Goyal
This patch adds space around '-' operator.Found using checkpatch.pl

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/iio/adc/ad7192.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
index 9221103..54db0f0 100644
--- a/drivers/staging/iio/adc/ad7192.c
+++ b/drivers/staging/iio/adc/ad7192.c
@@ -376,7 +376,7 @@ ad7192_show_scale_available(struct device *dev,
 }
 
 static IIO_DEVICE_ATTR_NAMED(in_v_m_v_scale_available,
-in_voltage-voltage_scale_available,
+in_voltage - voltage_scale_available,
 S_IRUGO, ad7192_show_scale_available, NULL, 0);
 
 static IIO_DEVICE_ATTR(in_voltage_scale_available, S_IRUGO,
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] staging:iio:adc:added space around '-'

2016-01-15 Thread Bhumika Goyal
This patch adds apace around '-' operator.Found using checkpatch.pl

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/iio/adc/ad7280a.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7280a.c 
b/drivers/staging/iio/adc/ad7280a.c
index f45ebed..0c73bce 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -744,14 +744,14 @@ out:
 }
 
 static IIO_DEVICE_ATTR_NAMED(in_thresh_low_value,
-   in_voltage-voltage_thresh_low_value,
+   in_voltage - voltage_thresh_low_value,
S_IRUGO | S_IWUSR,
ad7280_read_channel_config,
ad7280_write_channel_config,
AD7280A_CELL_UNDERVOLTAGE);
 
 static IIO_DEVICE_ATTR_NAMED(in_thresh_high_value,
-   in_voltage-voltage_thresh_high_value,
+   in_voltage - voltage_thresh_high_value,
S_IRUGO | S_IWUSR,
ad7280_read_channel_config,
ad7280_write_channel_config,
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/2]Staging:iio:adc:add space around '-'

2016-01-15 Thread Bhumika Goyal
These patches adds space around '-' operator.Found using checkpatch.pl.


Bhumika Goyal (2):
  staging:iio:adc:added space around '-'
  staging:iio:adc:add space around '-'

 drivers/staging/iio/adc/ad7192.c  | 2 +-
 drivers/staging/iio/adc/ad7280a.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging:lustre:lustre:obdclass:Remove return from void function

2016-01-14 Thread Bhumika Goyal
This patch removes the return statement at the end of a void function as
it is not necessary.This was found by checkpatch.pl .

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/lustre/lustre/obdclass/llog_swab.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/llog_swab.c 
b/drivers/staging/lustre/lustre/obdclass/llog_swab.c
index 3aa7393..8f57a8e 100644
--- a/drivers/staging/lustre/lustre/obdclass/llog_swab.c
+++ b/drivers/staging/lustre/lustre/obdclass/llog_swab.c
@@ -406,7 +406,5 @@ void lustre_swab_cfg_marker(struct cfg_marker *marker, int 
swab, int size)
__swab64s(&marker->cm_createtime);
__swab64s(&marker->cm_canceltime);
}
-
-   return;
 }
 EXPORT_SYMBOL(lustre_swab_cfg_marker);
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel