Re: [greybus-dev] [PATCH v2] Staging: greybus: Cleanup in greybus driver

2019-04-16 Thread Viresh Kumar
On 16-04-19, 17:13, Madhumitha Prabakaran wrote:
> Fix a blank line after structure declarations. Also, convert
> macros into inline functions in order to maintain Linux kernel
> coding style based on which the inline function is
> preferable over the macro.
> 
> Blank line fixes are suggested by checkpatch.pl

This was all intentional and we use such macros everywhere in kernel. No need
for such a patch, sorry.

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


[PATCH] staging: wilc1000: Avoid GFP_KERNEL allocation from atomic context

2019-04-16 Thread Adham.Abozaeid
From: Adham Abozaeid 

txq_add_mgmt_pkt allocates memory while being called from atomic context
so needs to use GFP_ATOMIC

Signed-off-by: Adham Abozaeid 
---
 drivers/staging/wilc1000/wilc_wlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index 2b309c8a8fb2..0a713409ea98 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -316,7 +316,7 @@ int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void 
*priv, u8 *buffer,
if (wilc->quit)
return 0;
 
-   tqe = kmalloc(sizeof(*tqe), GFP_KERNEL);
+   tqe = kmalloc(sizeof(*tqe), GFP_ATOMIC);
 
if (!tqe)
return 0;
-- 
2.17.1

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


Re: [PATCH v3 00/26] compat_ioctl: cleanups

2019-04-16 Thread Douglas Gilbert

On 2019-04-16 4:19 p.m., Arnd Bergmann wrote:

Hi Al,

It took me way longer than I had hoped to revisit this series, see
https://lore.kernel.org/lkml/20180912150142.157913-1-a...@arndb.de/
for the previously posted version.

I've come to the point where all conversion handlers and most
COMPATIBLE_IOCTL() entries are gone from this file, but for
now, this series only has the parts that have either been reviewed
previously, or that are simple enough to include.

The main missing piece is the SG_IO/SG_GET_REQUEST_TABLE conversion.
I'll post the patches I made for that later, as they need more
testing and review from the scsi maintainers.


Perhaps you could look at the document in this url:
http://sg.danny.cz/sg/sg_v40.html

It is work-in-progress to modernize the SCSI generic driver. It
extends ioctl(sg_fd, SG_IO, _obj) to additionally accept the sg v4
interface as defined in include/uapi/linux/bsg.h . Currently only the
bsg driver uses the sg v4 interface. Since struct sg_io_v4 is all
explicitly sized integers, I'm guessing it is immune "compat" problems.
[I can see no reference to bsg nor struct sg_io_v4 in the current
fs/compat_ioctl.c file.]

Other additions described in the that document are these new ioctls:
  - SG_IOSUBMITultimately to replace write(sg_fd, ...)
  - SG_IORECEIVE  to replace read(sg_fd, ...)
  - SG_IOABORT abort SCSI cmd in progress; new functionality
  - SG_SET_GET_EXTENDED   has associated struct sg_extended_info

The first three take a pointer to a struct sg_io_hdr (v3 interface) or
a struct sg_io_v4 object. Both objects start with a 32 bit integer:
'S' identifies the v3 interface while 'Q' identifies the v4 interface.

The SG_SET_GET_EXTENDED ioctl takes a pointer to a struct
sg_extended_info object which contains explicitly sized integers so it
may also be immune from "compat" problems. The ioctls section (13) of
that document referenced above has a table showing how many "sets and
gets" are hiding in the SG_SET_GET_EXTENDED ioctl.

BTW No change is proposed for this case:
ioctl(normal_block_device, SG_IO, _v3_obj)
which is handled by block/scsi_ioctl.c


This would be a good time for me to address any "compat" concerns in the
proposed sg driver update.

Doug Gilbert



I hope you can still take these for the coming merge window, unless
new problems come up.

   Arnd

Arnd Bergmann (26):
   compat_ioctl: pppoe: fix PPPOEIOCSFWD handling
   compat_ioctl: move simple ppp command handling into driver
   compat_ioctl: avoid unused function warning for do_ioctl
   compat_ioctl: move PPPIOCSCOMPRESS32 to ppp-generic.c
   compat_ioctl: move PPPIOCSPASS32/PPPIOCSACTIVE32 to ppp_generic.c
   compat_ioctl: handle PPPIOCGIDLE for 64-bit time_t
   compat_ioctl: move rtc handling into rtc-dev.c
   compat_ioctl: add compat_ptr_ioctl()
   compat_ioctl: move drivers to compat_ptr_ioctl
   compat_ioctl: use correct compat_ptr() translation in drivers
   ceph: fix compat_ioctl for ceph_dir_operations
   compat_ioctl: move more drivers to compat_ptr_ioctl
   compat_ioctl: move tape handling into drivers
   compat_ioctl: move ATYFB_CLK handling to atyfb driver
   compat_ioctl: move isdn/capi ioctl translation into driver
   compat_ioctl: move rfcomm handlers into driver
   compat_ioctl: move hci_sock handlers into driver
   compat_ioctl: remove HCIUART handling
   compat_ioctl: remove HIDIO translation
   compat_ioctl: remove translation for sound ioctls
   compat_ioctl: remove IGNORE_IOCTL()
   compat_ioctl: remove /dev/random commands
   compat_ioctl: remove joystick ioctl translation
   compat_ioctl: remove PCI ioctl translation
   compat_ioctl: remove /dev/raw ioctl translation
   compat_ioctl: remove last RAID handling code

  Documentation/networking/ppp_generic.txt|   2 +
  arch/um/drivers/hostaudio_kern.c|   1 +
  drivers/android/binder.c|   2 +-
  drivers/char/ppdev.c|  12 +-
  drivers/char/random.c   |   1 +
  drivers/char/tpm/tpm_vtpm_proxy.c   |  12 +-
  drivers/crypto/qat/qat_common/adf_ctl_drv.c |   2 +-
  drivers/dma-buf/dma-buf.c   |   4 +-
  drivers/dma-buf/sw_sync.c   |   2 +-
  drivers/dma-buf/sync_file.c |   2 +-
  drivers/firewire/core-cdev.c|  12 +-
  drivers/gpu/drm/amd/amdkfd/kfd_chardev.c|   2 +-
  drivers/hid/hidraw.c|   4 +-
  drivers/hid/usbhid/hiddev.c |  11 +-
  drivers/hwtracing/stm/core.c|  12 +-
  drivers/ide/ide-tape.c  |  31 +-
  drivers/iio/industrialio-core.c |   2 +-
  drivers/infiniband/core/uverbs_main.c   |   4 +-
  drivers/isdn/capi/capi.c|  31 +
  drivers/isdn/i4l/isdn_ppp.c |  14 +-
  drivers/media/rc/lirc_dev.c |   4 +-
  drivers/mfd/cros_ec_dev.c   |   4 +-
  drivers/misc/cxl/flash.c|   8 +-
 

[PATCH v2] Staging: greybus: Cleanup in greybus driver

2019-04-16 Thread Madhumitha Prabakaran
Fix a blank line after structure declarations. Also, convert
macros into inline functions in order to maintain Linux kernel
coding style based on which the inline function is
preferable over the macro.

Blank line fixes are suggested by checkpatch.pl

Signed-off-by: Madhumitha Prabakaran 

Changes in v2:
- To maintain consistency in driver greybus, all the instances of macro
with container_of are fixed in a single patch.
---
 drivers/staging/greybus/bundle.h|  6 +-
 drivers/staging/greybus/control.h   |  6 +-
 drivers/staging/greybus/gbphy.h | 12 ++--
 drivers/staging/greybus/greybus.h   |  6 +-
 drivers/staging/greybus/hd.h|  6 +-
 drivers/staging/greybus/interface.h |  6 +-
 drivers/staging/greybus/module.h|  6 +-
 drivers/staging/greybus/svc.h   |  6 +-
 8 files changed, 45 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/greybus/bundle.h b/drivers/staging/greybus/bundle.h
index 8734d2055657..84956eedb1c4 100644
--- a/drivers/staging/greybus/bundle.h
+++ b/drivers/staging/greybus/bundle.h
@@ -31,7 +31,11 @@ struct gb_bundle {
 
struct list_headlinks;  /* interface->bundles */
 };
-#define to_gb_bundle(d) container_of(d, struct gb_bundle, dev)
+
+static inline struct gb_bundle *to_gb_bundle(struct device *d)
+{
+   return container_of(d, struct gb_bundle, dev);
+}
 
 /* Greybus "private" definitions" */
 struct gb_bundle *gb_bundle_create(struct gb_interface *intf, u8 bundle_id,
diff --git a/drivers/staging/greybus/control.h 
b/drivers/staging/greybus/control.h
index 3a29ec05f631..a681ef74e7fe 100644
--- a/drivers/staging/greybus/control.h
+++ b/drivers/staging/greybus/control.h
@@ -24,7 +24,11 @@ struct gb_control {
char *vendor_string;
char *product_string;
 };
-#define to_gb_control(d) container_of(d, struct gb_control, dev)
+
+static inline struct gb_control *to_gb_control(struct device *d)
+{
+   return container_of(d, struct gb_control, dev);
+}
 
 struct gb_control *gb_control_create(struct gb_interface *intf);
 int gb_control_enable(struct gb_control *control);
diff --git a/drivers/staging/greybus/gbphy.h b/drivers/staging/greybus/gbphy.h
index 99463489d7d6..20307f6dfcb9 100644
--- a/drivers/staging/greybus/gbphy.h
+++ b/drivers/staging/greybus/gbphy.h
@@ -15,7 +15,11 @@ struct gbphy_device {
struct list_head list;
struct device dev;
 };
-#define to_gbphy_dev(d) container_of(d, struct gbphy_device, dev)
+
+static inline struct gbphy_device *to_gbphy_dev(struct device *d)
+{
+   return container_of(d, struct gbphy_device, dev);
+}
 
 static inline void *gb_gbphy_get_data(struct gbphy_device *gdev)
 {
@@ -43,7 +47,11 @@ struct gbphy_driver {
 
struct device_driver driver;
 };
-#define to_gbphy_driver(d) container_of(d, struct gbphy_driver, driver)
+
+static inline struct gbphy_driver *to_gbphy_driver(struct device_driver *d)
+{
+   return container_of(d, struct gbphy_driver, driver);
+}
 
 int gb_gbphy_register_driver(struct gbphy_driver *driver,
 struct module *owner, const char *mod_name);
diff --git a/drivers/staging/greybus/greybus.h 
b/drivers/staging/greybus/greybus.h
index d03ddb7c9df0..a82d5002b4d5 100644
--- a/drivers/staging/greybus/greybus.h
+++ b/drivers/staging/greybus/greybus.h
@@ -64,7 +64,11 @@ struct greybus_driver {
 
struct device_driver driver;
 };
-#define to_greybus_driver(d) container_of(d, struct greybus_driver, driver)
+
+static inline struct greybus_driver *to_greybus_driver(struct device_driver *d)
+{
+   return container_of(d, struct greybus_driver, driver);
+}
 
 static inline void greybus_set_drvdata(struct gb_bundle *bundle, void *data)
 {
diff --git a/drivers/staging/greybus/hd.h b/drivers/staging/greybus/hd.h
index 6cf024a20a58..de7c49d05266 100644
--- a/drivers/staging/greybus/hd.h
+++ b/drivers/staging/greybus/hd.h
@@ -57,7 +57,11 @@ struct gb_host_device {
/* Private data for the host driver */
unsigned long hd_priv[0] __aligned(sizeof(s64));
 };
-#define to_gb_host_device(d) container_of(d, struct gb_host_device, dev)
+
+static inline struct gb_host_device *to_gb_host_device(struct device *d)
+{
+   return container_of(d, struct gb_host_device, dev);
+}
 
 int gb_hd_cport_reserve(struct gb_host_device *hd, u16 cport_id);
 void gb_hd_cport_release_reserved(struct gb_host_device *hd, u16 cport_id);
diff --git a/drivers/staging/greybus/interface.h 
b/drivers/staging/greybus/interface.h
index 1c00c5bb3ec9..f86c0d596dbe 100644
--- a/drivers/staging/greybus/interface.h
+++ b/drivers/staging/greybus/interface.h
@@ -63,7 +63,11 @@ struct gb_interface {
struct work_struct mode_switch_work;
struct completion mode_switch_completion;
 };
-#define to_gb_interface(d) container_of(d, struct gb_interface, dev)
+
+static inline struct gb_interface *to_gb_interface(struct device *d)
+{
+   return container_of(d, struct gb_interface, dev);
+}
 
 struct 

Re: [PATCH v3 09/26] compat_ioctl: move drivers to compat_ptr_ioctl

2019-04-16 Thread Jiri Kosina
On Tue, 16 Apr 2019, Arnd Bergmann wrote:

> Each of these drivers has a copy of the same trivial helper function to
> convert the pointer argument and then call the native ioctl handler.
> 
> We now have a generic implementation of that, so use it.
> 
> Acked-by: Greg Kroah-Hartman 
> Reviewed-by: Jarkko Sakkinen 
> Reviewed-by: Jason Gunthorpe 
> Signed-off-by: Arnd Bergmann 
> ---
>  drivers/char/ppdev.c  | 12 +-
>  drivers/char/tpm/tpm_vtpm_proxy.c | 12 +-
>  drivers/firewire/core-cdev.c  | 12 +-
>  drivers/hid/usbhid/hiddev.c   | 11 +

For hiddev.c:

Reviewed-by: Jiri Kosina  

-- 
Jiri Kosina
SUSE Labs

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


[PATCH v3 12/26] compat_ioctl: move more drivers to compat_ptr_ioctl

2019-04-16 Thread Arnd Bergmann
The .ioctl and .compat_ioctl file operations have the same prototype so
they can both point to the same function, which works great almost all
the time when all the commands are compatible.

One exception is the s390 architecture, where a compat pointer is only
31 bit wide, and converting it into a 64-bit pointer requires calling
compat_ptr(). Most drivers here will ever run in s390, but since we now
have a generic helper for it, it's easy enough to use it consistently.

I double-checked all these drivers to ensure that all ioctl arguments
are used as pointers or are ignored, but are not interpreted as integer
values.

Acked-by: Jason Gunthorpe 
Acked-by: Daniel Vetter 
Acked-by: Mauro Carvalho Chehab 
Acked-by: Greg Kroah-Hartman 
Acked-by: David Sterba 
Acked-by: Darren Hart (VMware) 
Acked-by: Jonathan Cameron 
Acked-by: Bjorn Andersson 
Signed-off-by: Arnd Bergmann 
---
 drivers/android/binder.c| 2 +-
 drivers/crypto/qat/qat_common/adf_ctl_drv.c | 2 +-
 drivers/dma-buf/dma-buf.c   | 4 +---
 drivers/dma-buf/sw_sync.c   | 2 +-
 drivers/dma-buf/sync_file.c | 2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c| 2 +-
 drivers/hid/hidraw.c| 4 +---
 drivers/iio/industrialio-core.c | 2 +-
 drivers/infiniband/core/uverbs_main.c   | 4 ++--
 drivers/media/rc/lirc_dev.c | 4 +---
 drivers/mfd/cros_ec_dev.c   | 4 +---
 drivers/misc/vmw_vmci/vmci_host.c   | 2 +-
 drivers/nvdimm/bus.c| 4 ++--
 drivers/nvme/host/core.c| 2 +-
 drivers/pci/switch/switchtec.c  | 2 +-
 drivers/platform/x86/wmi.c  | 2 +-
 drivers/rpmsg/rpmsg_char.c  | 4 ++--
 drivers/sbus/char/display7seg.c | 2 +-
 drivers/sbus/char/envctrl.c | 4 +---
 drivers/scsi/3w-.c  | 4 +---
 drivers/scsi/cxlflash/main.c| 2 +-
 drivers/scsi/esas2r/esas2r_main.c   | 2 +-
 drivers/scsi/pmcraid.c  | 4 +---
 drivers/staging/android/ion/ion.c   | 4 +---
 drivers/staging/vme/devices/vme_user.c  | 2 +-
 drivers/tee/tee_core.c  | 2 +-
 drivers/usb/class/cdc-wdm.c | 2 +-
 drivers/usb/class/usbtmc.c  | 4 +---
 drivers/virt/fsl_hypervisor.c   | 2 +-
 fs/btrfs/super.c| 2 +-
 fs/ceph/dir.c   | 2 +-
 fs/ceph/file.c  | 2 +-
 fs/fuse/dev.c   | 2 +-
 fs/notify/fanotify/fanotify_user.c  | 2 +-
 fs/userfaultfd.c| 2 +-
 net/rfkill/core.c   | 2 +-
 36 files changed, 39 insertions(+), 57 deletions(-)

diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index 4b9c7ca492e6..48109ade7234 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -5998,7 +5998,7 @@ const struct file_operations binder_fops = {
.owner = THIS_MODULE,
.poll = binder_poll,
.unlocked_ioctl = binder_ioctl,
-   .compat_ioctl = binder_ioctl,
+   .compat_ioctl = compat_ptr_ioctl,
.mmap = binder_mmap,
.open = binder_open,
.flush = binder_flush,
diff --git a/drivers/crypto/qat/qat_common/adf_ctl_drv.c 
b/drivers/crypto/qat/qat_common/adf_ctl_drv.c
index abc7a7f64d64..ef0e482ee04f 100644
--- a/drivers/crypto/qat/qat_common/adf_ctl_drv.c
+++ b/drivers/crypto/qat/qat_common/adf_ctl_drv.c
@@ -68,7 +68,7 @@ static long adf_ctl_ioctl(struct file *fp, unsigned int cmd, 
unsigned long arg);
 static const struct file_operations adf_ctl_ops = {
.owner = THIS_MODULE,
.unlocked_ioctl = adf_ctl_ioctl,
-   .compat_ioctl = adf_ctl_ioctl,
+   .compat_ioctl = compat_ptr_ioctl,
 };
 
 struct adf_ctl_drv_info {
diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index 7c858020d14b..0cb336fe6324 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -325,9 +325,7 @@ static const struct file_operations dma_buf_fops = {
.llseek = dma_buf_llseek,
.poll   = dma_buf_poll,
.unlocked_ioctl = dma_buf_ioctl,
-#ifdef CONFIG_COMPAT
-   .compat_ioctl   = dma_buf_ioctl,
-#endif
+   .compat_ioctl   = compat_ptr_ioctl,
 };
 
 /*
diff --git a/drivers/dma-buf/sw_sync.c b/drivers/dma-buf/sw_sync.c
index 32dcf7b4c935..411de6a8a0ad 100644
--- a/drivers/dma-buf/sw_sync.c
+++ b/drivers/dma-buf/sw_sync.c
@@ -419,5 +419,5 @@ const struct file_operations sw_sync_debugfs_fops = {
.open   = sw_sync_debugfs_open,
.release= sw_sync_debugfs_release,
.unlocked_ioctl = sw_sync_ioctl,
-   .compat_ioctl   = sw_sync_ioctl,
+   .compat_ioctl   = compat_ptr_ioctl,
 };
diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c
index 4f6305ca52c8..0949f91eb85f 100644

[PATCH v3 09/26] compat_ioctl: move drivers to compat_ptr_ioctl

2019-04-16 Thread Arnd Bergmann
Each of these drivers has a copy of the same trivial helper function to
convert the pointer argument and then call the native ioctl handler.

We now have a generic implementation of that, so use it.

Acked-by: Greg Kroah-Hartman 
Reviewed-by: Jarkko Sakkinen 
Reviewed-by: Jason Gunthorpe 
Signed-off-by: Arnd Bergmann 
---
 drivers/char/ppdev.c  | 12 +-
 drivers/char/tpm/tpm_vtpm_proxy.c | 12 +-
 drivers/firewire/core-cdev.c  | 12 +-
 drivers/hid/usbhid/hiddev.c   | 11 +
 drivers/hwtracing/stm/core.c  | 12 +-
 drivers/misc/mei/main.c   | 22 +
 drivers/mtd/ubi/cdev.c| 36 +++-
 drivers/net/tap.c | 12 +-
 drivers/staging/pi433/pi433_if.c  | 12 +-
 drivers/usb/core/devio.c  | 16 +
 drivers/vfio/vfio.c   | 39 +++
 drivers/vhost/net.c   | 12 +-
 drivers/vhost/scsi.c  | 12 +-
 drivers/vhost/test.c  | 12 +-
 drivers/vhost/vsock.c | 12 +-
 fs/fat/file.c | 13 +--
 16 files changed, 20 insertions(+), 237 deletions(-)

diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c
index 1ae77b41050a..e96c8d9623e0 100644
--- a/drivers/char/ppdev.c
+++ b/drivers/char/ppdev.c
@@ -674,14 +674,6 @@ static long pp_ioctl(struct file *file, unsigned int cmd, 
unsigned long arg)
return ret;
 }
 
-#ifdef CONFIG_COMPAT
-static long pp_compat_ioctl(struct file *file, unsigned int cmd,
-   unsigned long arg)
-{
-   return pp_ioctl(file, cmd, (unsigned long)compat_ptr(arg));
-}
-#endif
-
 static int pp_open(struct inode *inode, struct file *file)
 {
unsigned int minor = iminor(inode);
@@ -790,9 +782,7 @@ static const struct file_operations pp_fops = {
.write  = pp_write,
.poll   = pp_poll,
.unlocked_ioctl = pp_ioctl,
-#ifdef CONFIG_COMPAT
-   .compat_ioctl   = pp_compat_ioctl,
-#endif
+   .compat_ioctl   = compat_ptr_ioctl,
.open   = pp_open,
.release= pp_release,
 };
diff --git a/drivers/char/tpm/tpm_vtpm_proxy.c 
b/drivers/char/tpm/tpm_vtpm_proxy.c
index d74f3de74ae6..fb845f0a430b 100644
--- a/drivers/char/tpm/tpm_vtpm_proxy.c
+++ b/drivers/char/tpm/tpm_vtpm_proxy.c
@@ -675,20 +675,10 @@ static long vtpmx_fops_ioctl(struct file *f, unsigned int 
ioctl,
}
 }
 
-#ifdef CONFIG_COMPAT
-static long vtpmx_fops_compat_ioctl(struct file *f, unsigned int ioctl,
- unsigned long arg)
-{
-   return vtpmx_fops_ioctl(f, ioctl, (unsigned long)compat_ptr(arg));
-}
-#endif
-
 static const struct file_operations vtpmx_fops = {
.owner = THIS_MODULE,
.unlocked_ioctl = vtpmx_fops_ioctl,
-#ifdef CONFIG_COMPAT
-   .compat_ioctl = vtpmx_fops_compat_ioctl,
-#endif
+   .compat_ioctl = compat_ptr_ioctl,
.llseek = noop_llseek,
 };
 
diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c
index 16a7045736a9..fb934680fdd3 100644
--- a/drivers/firewire/core-cdev.c
+++ b/drivers/firewire/core-cdev.c
@@ -1659,14 +1659,6 @@ static long fw_device_op_ioctl(struct file *file,
return dispatch_ioctl(file->private_data, cmd, (void __user *)arg);
 }
 
-#ifdef CONFIG_COMPAT
-static long fw_device_op_compat_ioctl(struct file *file,
- unsigned int cmd, unsigned long arg)
-{
-   return dispatch_ioctl(file->private_data, cmd, compat_ptr(arg));
-}
-#endif
-
 static int fw_device_op_mmap(struct file *file, struct vm_area_struct *vma)
 {
struct client *client = file->private_data;
@@ -1808,7 +1800,5 @@ const struct file_operations fw_device_ops = {
.mmap   = fw_device_op_mmap,
.release= fw_device_op_release,
.poll   = fw_device_op_poll,
-#ifdef CONFIG_COMPAT
-   .compat_ioctl   = fw_device_op_compat_ioctl,
-#endif
+   .compat_ioctl   = compat_ptr_ioctl,
 };
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
index a746017fac17..ef4a1cd389d6 100644
--- a/drivers/hid/usbhid/hiddev.c
+++ b/drivers/hid/usbhid/hiddev.c
@@ -855,13 +855,6 @@ static long hiddev_ioctl(struct file *file, unsigned int 
cmd, unsigned long arg)
return r;
 }
 
-#ifdef CONFIG_COMPAT
-static long hiddev_compat_ioctl(struct file *file, unsigned int cmd, unsigned 
long arg)
-{
-   return hiddev_ioctl(file, cmd, (unsigned long)compat_ptr(arg));
-}
-#endif
-
 static const struct file_operations hiddev_fops = {
.owner =THIS_MODULE,
.read = hiddev_read,
@@ -871,9 +864,7 @@ static const struct file_operations hiddev_fops = {
.release =  hiddev_release,
.unlocked_ioctl =   hiddev_ioctl,
.fasync =   hiddev_fasync,
-#ifdef CONFIG_COMPAT
-   .compat_ioctl   = 

[PATCH v3 00/26] compat_ioctl: cleanups

2019-04-16 Thread Arnd Bergmann
Hi Al,

It took me way longer than I had hoped to revisit this series, see
https://lore.kernel.org/lkml/20180912150142.157913-1-a...@arndb.de/
for the previously posted version.

I've come to the point where all conversion handlers and most
COMPATIBLE_IOCTL() entries are gone from this file, but for
now, this series only has the parts that have either been reviewed
previously, or that are simple enough to include.

The main missing piece is the SG_IO/SG_GET_REQUEST_TABLE conversion.
I'll post the patches I made for that later, as they need more
testing and review from the scsi maintainers.

I hope you can still take these for the coming merge window, unless
new problems come up.

  Arnd

Arnd Bergmann (26):
  compat_ioctl: pppoe: fix PPPOEIOCSFWD handling
  compat_ioctl: move simple ppp command handling into driver
  compat_ioctl: avoid unused function warning for do_ioctl
  compat_ioctl: move PPPIOCSCOMPRESS32 to ppp-generic.c
  compat_ioctl: move PPPIOCSPASS32/PPPIOCSACTIVE32 to ppp_generic.c
  compat_ioctl: handle PPPIOCGIDLE for 64-bit time_t
  compat_ioctl: move rtc handling into rtc-dev.c
  compat_ioctl: add compat_ptr_ioctl()
  compat_ioctl: move drivers to compat_ptr_ioctl
  compat_ioctl: use correct compat_ptr() translation in drivers
  ceph: fix compat_ioctl for ceph_dir_operations
  compat_ioctl: move more drivers to compat_ptr_ioctl
  compat_ioctl: move tape handling into drivers
  compat_ioctl: move ATYFB_CLK handling to atyfb driver
  compat_ioctl: move isdn/capi ioctl translation into driver
  compat_ioctl: move rfcomm handlers into driver
  compat_ioctl: move hci_sock handlers into driver
  compat_ioctl: remove HCIUART handling
  compat_ioctl: remove HIDIO translation
  compat_ioctl: remove translation for sound ioctls
  compat_ioctl: remove IGNORE_IOCTL()
  compat_ioctl: remove /dev/random commands
  compat_ioctl: remove joystick ioctl translation
  compat_ioctl: remove PCI ioctl translation
  compat_ioctl: remove /dev/raw ioctl translation
  compat_ioctl: remove last RAID handling code

 Documentation/networking/ppp_generic.txt|   2 +
 arch/um/drivers/hostaudio_kern.c|   1 +
 drivers/android/binder.c|   2 +-
 drivers/char/ppdev.c|  12 +-
 drivers/char/random.c   |   1 +
 drivers/char/tpm/tpm_vtpm_proxy.c   |  12 +-
 drivers/crypto/qat/qat_common/adf_ctl_drv.c |   2 +-
 drivers/dma-buf/dma-buf.c   |   4 +-
 drivers/dma-buf/sw_sync.c   |   2 +-
 drivers/dma-buf/sync_file.c |   2 +-
 drivers/firewire/core-cdev.c|  12 +-
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c|   2 +-
 drivers/hid/hidraw.c|   4 +-
 drivers/hid/usbhid/hiddev.c |  11 +-
 drivers/hwtracing/stm/core.c|  12 +-
 drivers/ide/ide-tape.c  |  31 +-
 drivers/iio/industrialio-core.c |   2 +-
 drivers/infiniband/core/uverbs_main.c   |   4 +-
 drivers/isdn/capi/capi.c|  31 +
 drivers/isdn/i4l/isdn_ppp.c |  14 +-
 drivers/media/rc/lirc_dev.c |   4 +-
 drivers/mfd/cros_ec_dev.c   |   4 +-
 drivers/misc/cxl/flash.c|   8 +-
 drivers/misc/genwqe/card_dev.c  |  23 +-
 drivers/misc/mei/main.c |  22 +-
 drivers/misc/vmw_vmci/vmci_host.c   |   2 +-
 drivers/mtd/ubi/cdev.c  |  36 +-
 drivers/net/ppp/ppp_generic.c   |  99 +++-
 drivers/net/ppp/pppoe.c |   7 +
 drivers/net/ppp/pptp.c  |   3 +
 drivers/net/tap.c   |  12 +-
 drivers/nvdimm/bus.c|   4 +-
 drivers/nvme/host/core.c|   2 +-
 drivers/pci/switch/switchtec.c  |   2 +-
 drivers/platform/x86/wmi.c  |   2 +-
 drivers/rpmsg/rpmsg_char.c  |   4 +-
 drivers/rtc/dev.c   |  13 +-
 drivers/rtc/rtc-vr41xx.c|  10 +
 drivers/s390/char/tape_char.c   |  41 +-
 drivers/sbus/char/display7seg.c |   2 +-
 drivers/sbus/char/envctrl.c |   4 +-
 drivers/scsi/3w-.c  |   4 +-
 drivers/scsi/cxlflash/main.c|   2 +-
 drivers/scsi/esas2r/esas2r_main.c   |   2 +-
 drivers/scsi/megaraid/megaraid_mm.c |  28 +-
 drivers/scsi/osst.c |  34 +-
 drivers/scsi/pmcraid.c  |   4 +-
 drivers/scsi/st.c   |  35 +-
 drivers/staging/android/ion/ion.c   |   4 +-
 drivers/staging/pi433/pi433_if.c|  12 +-
 drivers/staging/vme/devices/vme_user.c  |   2 +-
 drivers/tee/tee_core.c  |   2 +-
 drivers/usb/class/cdc-wdm.c |   2 +-
 drivers/usb/class/usbtmc.c  |   4 +-
 drivers/usb/core/devio.c   

[PATCH] staging: comedi: use help instead of ---help--- in Kconfig

2019-04-16 Thread Moses Christopher
  - Resolve the following warning from the Kconfig,
"WARNING: prefer 'help' over '---help---' for new help texts"

Signed-off-by: Moses Christopher 
---
 drivers/staging/comedi/Kconfig | 254 -
 1 file changed, 127 insertions(+), 127 deletions(-)

diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig
index 9ab1ee7d36bf..0f63870adc04 100644
--- a/drivers/staging/comedi/Kconfig
+++ b/drivers/staging/comedi/Kconfig
@@ -1,6 +1,6 @@
 config COMEDI
tristate "Data acquisition support (comedi)"
-   ---help---
+   help
  Enable support for a wide range of data acquisition devices
  for Linux.
 
@@ -8,14 +8,14 @@ if COMEDI
 
 config COMEDI_DEBUG
bool "Comedi debugging"
-   ---help---
+   help
  This is an option for use by developers; most people should
  say N here. This enables comedi core and driver debugging.
 
 config COMEDI_DEFAULT_BUF_SIZE_KB
int "Comedi default initial asynchronous buffer size in KiB"
default "2048"
-   ---help---
+   help
  This is the default asynchronous buffer size which is used for
  commands running in the background in kernel space.  This
  defaults to 2048 KiB of memory so that a 16 channel card
@@ -24,7 +24,7 @@ config COMEDI_DEFAULT_BUF_SIZE_KB
 config COMEDI_DEFAULT_BUF_MAXSIZE_KB
int "Comedi default maximum asynchronous buffer size in KiB"
default "20480"
-   ---help---
+   help
  This is the default maximum asynchronous buffer size which can
  be requested by a userspace program without root privileges.
  This is set to 20480 KiB so that a fast I/O card with 16
@@ -32,7 +32,7 @@ config COMEDI_DEFAULT_BUF_MAXSIZE_KB
 
 menuconfig COMEDI_MISC_DRIVERS
bool "Comedi misc drivers"
-   ---help---
+   help
  Enable comedi misc drivers to be built
 
  Note that the answer to this question won't directly affect the
@@ -44,7 +44,7 @@ if COMEDI_MISC_DRIVERS
 config COMEDI_BOND
tristate "Comedi device bonding support"
select COMEDI_KCOMEDILIB
-   ---help---
+   help
  Enable support for a driver to 'bond' (merge) multiple subdevices
  from multiple devices together as one.
 
@@ -55,7 +55,7 @@ config COMEDI_BOND
 
 config COMEDI_TEST
tristate "Fake waveform generator support"
-   ---help---
+   help
  Enable support for the fake waveform generator.
  This driver is mainly for testing purposes, but can also be used to
  generate sample waveforms on systems that don't have data acquisition
@@ -66,7 +66,7 @@ config COMEDI_TEST
 
 config COMEDI_PARPORT
tristate "Parallel port support"
-   ---help---
+   help
  Enable support for the standard parallel port.
  A cheap and easy way to get a few more digital I/O lines. Steal
  additional parallel ports from old computers or your neighbors'
@@ -78,7 +78,7 @@ config COMEDI_PARPORT
 config COMEDI_SSV_DNP
tristate "SSV Embedded Systems DIL/Net-PC support"
depends on X86_32 || COMPILE_TEST
-   ---help---
+   help
  Enable support for SSV Embedded Systems DIL/Net-PC
 
  To compile this driver as a module, choose M here: the module will be
@@ -88,7 +88,7 @@ endif # COMEDI_MISC_DRIVERS
 
 menuconfig COMEDI_ISA_DRIVERS
bool "Comedi ISA and PC/104 drivers"
-   ---help---
+   help
  Enable comedi ISA and PC/104 drivers to be built
 
  Note that the answer to this question won't directly affect the
@@ -100,7 +100,7 @@ if COMEDI_ISA_DRIVERS
 config COMEDI_PCL711
tristate "Advantech PCL-711/711b and ADlink ACL-8112 ISA card support"
select COMEDI_8254
-   ---help---
+   help
  Enable support for Advantech PCL-711 and 711b, ADlink ACL-8112
 
  To compile this driver as a module, choose M here: the module will be
@@ -109,7 +109,7 @@ config COMEDI_PCL711
 config COMEDI_PCL724
tristate "Advantech PCL-722/724/731 and ADlink ACL-7122/7124/PET-48DIO"
select COMEDI_8255
-   ---help---
+   help
  Enable support for ISA and PC/104 based 8255 digital i/o boards. This
  driver provides a legacy comedi driver wrapper for the generic 8255
  support driver.
@@ -129,7 +129,7 @@ config COMEDI_PCL724
 
 config COMEDI_PCL726
tristate "Advantech PCL-726 and compatible ISA card support"
-   ---help---
+   help
  Enable support for Advantech PCL-726 and compatible ISA cards.
 
  To compile this driver as a module, choose M here: the module will be
@@ -137,7 +137,7 @@ config COMEDI_PCL726
 
 config COMEDI_PCL730
tristate "Simple Digital I/O board support (8-bit ports)"
-   ---help---
+   help
  Enable support for various simple ISA or PC/104 Digital I/O boards.
  These boards all use 8-bit I/O ports.
 

[PATCH 2/2] staging: comedi: dyna_pci10xx: Set number of AO channels to 1

2019-04-16 Thread Ian Abbott
The "dyna_pci10xx" driver supports the Dynalog India PCI-1050.  There
seems to be very little online information available about this card,
but as far as I can tell[*], it only has 1 AO (analog output) channel,
not 16 AO channels as reported in the Comedi subdevice information.
Besides, the Comedi "insn_write" handler for the AO subdevice takes no
account of channel numbers.  Change the `n_chans` member of the AO
subdevice structure to 1 to reflect this.

[*] The card is no longer mentioned on the manufacturer's web-site and I
couldn't find any archived page for the site on archive.org.  I found
part of a scientific paper which describes the card as having a single
channel D/A converter:
.

Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/drivers/dyna_pci10xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/dyna_pci10xx.c 
b/drivers/staging/comedi/drivers/dyna_pci10xx.c
index 08c7e8eba285..c224422bb126 100644
--- a/drivers/staging/comedi/drivers/dyna_pci10xx.c
+++ b/drivers/staging/comedi/drivers/dyna_pci10xx.c
@@ -196,7 +196,7 @@ static int dyna_pci10xx_auto_attach(struct comedi_device 
*dev,
s = >subdevices[1];
s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITABLE;
-   s->n_chan = 16;
+   s->n_chan = 1;
s->maxdata = 0x0FFF;
s->range_table = _unipolar10;
s->insn_write = dyna_pci10xx_insn_write_ao;
-- 
2.20.1

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


[PATCH 1/2] staging: comedi: dyna_pci10xx: Don't bother configuring len_chanlist

2019-04-16 Thread Ian Abbott
In the Comedi "attach" and "auto_attach" handlers that set up the Comedi
subdevices, there is no need to initialize the `len_chanlist` member of
Comedi subdevices that do not support Comedi asynchronous streaming
commands.  They can be left set to the initial zeroed out value and
the Comedi core will change the `len_chanlist` member to 1 afterwards in
that case.  The "dyna_pci10xx" driver currently sets the `len_chanlist`
members to the same value as the `n_chan` ("number of channels") member,
but this is unnecessary as none of them support asynchronous streaming.
Remove the initialization of `len_chanlist` from all the subdevices.
This will affect the information reported by the COMEDI_SUBDINFO ioctl
slightly.

Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/drivers/dyna_pci10xx.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dyna_pci10xx.c 
b/drivers/staging/comedi/drivers/dyna_pci10xx.c
index d38bfc6113e8..08c7e8eba285 100644
--- a/drivers/staging/comedi/drivers/dyna_pci10xx.c
+++ b/drivers/staging/comedi/drivers/dyna_pci10xx.c
@@ -190,7 +190,6 @@ static int dyna_pci10xx_auto_attach(struct comedi_device 
*dev,
s->n_chan = 16;
s->maxdata = 0x0FFF;
s->range_table = _pci1050_ai;
-   s->len_chanlist = 16;
s->insn_read = dyna_pci10xx_insn_read_ai;
 
/* analog output */
@@ -200,7 +199,6 @@ static int dyna_pci10xx_auto_attach(struct comedi_device 
*dev,
s->n_chan = 16;
s->maxdata = 0x0FFF;
s->range_table = _unipolar10;
-   s->len_chanlist = 16;
s->insn_write = dyna_pci10xx_insn_write_ao;
 
/* digital input */
@@ -210,7 +208,6 @@ static int dyna_pci10xx_auto_attach(struct comedi_device 
*dev,
s->n_chan = 16;
s->maxdata = 1;
s->range_table = _digital;
-   s->len_chanlist = 16;
s->insn_bits = dyna_pci10xx_di_insn_bits;
 
/* digital output */
@@ -220,7 +217,6 @@ static int dyna_pci10xx_auto_attach(struct comedi_device 
*dev,
s->n_chan = 16;
s->maxdata = 1;
s->range_table = _digital;
-   s->len_chanlist = 16;
s->state = 0;
s->insn_bits = dyna_pci10xx_do_insn_bits;
 
-- 
2.20.1

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


[PATCH 0/2] staging: comedi: dyna_pci10xx: Correct subdevice information

2019-04-16 Thread Ian Abbott
The dyna_pci10xx driver reports the wrong number of channels on its
analog output subdevice, but that is mostly harmless as the Comedi
"insn_write" instruction handler does nothing with the requested channel
number, but let's fix it.  Also, don't bother configuring the maximum
length of channel list (`len_chanlist`) explicitly, as that is only
needed for subdevices that support streaming acquisition (which none
of them do).

1) staging: comedi: dyna_pci10xx: Don't bother configuring len_chanlist
2) staging: comedi: dyna_pci10xx: Set number of AO channels to 1

 drivers/staging/comedi/drivers/dyna_pci10xx.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

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


Re: [PATCH] Staging: mt7621-mmc: Use DIV_ROUND_UP in function msdc_set_mclk

2019-04-16 Thread Greg KH
On Wed, Apr 03, 2019 at 10:16:08AM -0500, Madhumitha Prabakaran wrote:
> Use DIV_ROUND_UP to make code simple and more understandable.
> 
> Signed-off-by: Madhumitha Prabakaran 
> ---
>  drivers/staging/mt7621-mmc/sd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c
> index 4b26ec896a96..b12ed2c988fd 100644
> --- a/drivers/staging/mt7621-mmc/sd.c
> +++ b/drivers/staging/mt7621-mmc/sd.c
> @@ -240,7 +240,7 @@ static void msdc_set_mclk(struct msdc_host *host, int 
> ddr, unsigned int hz)
>   div  = 1; /* mean div = 1/4 */
>   sclk = hclk >> 2; /* sclk = clk / 4 */
>   } else {
> - div  = (hclk + ((hz << 2) - 1)) / (hz << 2);
> + div  = DIV_ROUND_UP(hclk, (hz << 2));
>   sclk = (hclk >> 2) / div;
>   }
>   } else if (hz >= hclk) { /* bug fix */
> @@ -253,7 +253,7 @@ static void msdc_set_mclk(struct msdc_host *host, int 
> ddr, unsigned int hz)
>   div  = 0; /* mean div = 1/2 */
>   sclk = hclk >> 1; /* sclk = clk / 2 */
>   } else {
> - div  = (hclk + ((hz << 2) - 1)) / (hz << 2);
> + div  = DIV_ROUND_UP(hclk, (hz << 2));
>   sclk = (hclk >> 2) / div;
>   }
>   }

This file is no longer in the kernel tree :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: olpc_dcon: Use WARN_ON() instead of BUG_ON()

2019-04-16 Thread Greg KH
On Fri, Apr 05, 2019 at 02:28:36PM -0500, Madhumitha Prabakaran wrote:
> Use WARN_ON() instead of BUG_ON(), as the WARN_ON() produces a backtrace
> without crashing the kernel.
> 
> Issue found by checkpatch.pl.
> 
> Signed-off-by: Madhumitha Prabakaran 
> ---
>  drivers/staging/olpc_dcon/olpc_dcon.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c 
> b/drivers/staging/olpc_dcon/olpc_dcon.c
> index 6b714f740ac3..900baab70691 100644
> --- a/drivers/staging/olpc_dcon/olpc_dcon.c
> +++ b/drivers/staging/olpc_dcon/olpc_dcon.c
> @@ -138,7 +138,7 @@ static int dcon_bus_stabilize(struct dcon_priv *dcon, int 
> is_powered_down)
>   }
>   if (x < 0) {
>   pr_err("unable to stabilize dcon's smbus, reasserting power and 
> praying.\n");
> - BUG_ON(olpc_board_at_least(olpc_board(0xc2)));
> + WARN_ON(olpc_board_at_least(olpc_board(0xc2)));

If this change was as simple as this, we would have done it already :(

You have to properly handle this error that used to crash the system, by
properly correctly for it and continuing on.  You can't just log it and
keep on going, right?

thanks,

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


Re: [PATCH 1/2] vt: selection: allow functions to be called from inside kernel

2019-04-16 Thread Greg Kroah-Hartman
On Thu, Apr 04, 2019 at 08:45:29PM +0100, Okash Khawaja wrote:
> This patch breaks set_selection() into two functions so that when
> called from kernel, copy_from_user() can be avoided. It also exports
> set_selection() and paste_selection().
> 
> These changes are used the following patch where speakup's selection
> functionality calls into the above functions, thereby doing away with
> parallel implementation.
> 
> Signed-off-by: Okash Khawaja 
> Reviewed-by: Samuel Thibault 
> Tested-by: Gregory Nowak 
> ---
>  drivers/tty/vt/selection.c | 37 -
>  include/linux/selection.h  |  3 +--
>  2 files changed, 25 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/tty/vt/selection.c b/drivers/tty/vt/selection.c
> index 07496c711d7d..a43f9cd9bdd6 100644
> --- a/drivers/tty/vt/selection.c
> +++ b/drivers/tty/vt/selection.c
> @@ -80,6 +80,7 @@ void clear_selection(void)
>   sel_start = -1;
>   }
>  }
> +EXPORT_SYMBOL_GPL(clear_selection);
>  
>  /*
>   * User settable table: what characters are to be considered alphabetic?
> @@ -164,34 +165,42 @@ static int store_utf8(u32 c, char *p)
>   *a lot under the lock but its hardly a performance path
>   */
>  int set_selection(const struct tiocl_selection __user *sel, struct 
> tty_struct *tty)
> +{
> + struct tiocl_selection v;
> +
> + if (copy_from_user(, sel, sizeof(*sel)))
> + return -EFAULT;
> +
> + return do_set_selection(, tty);
> +}
> +
> +int do_set_selection(struct tiocl_selection *v, struct tty_struct *tty)

I have no idea what the difference is between set_selection() and
do_set_selection() is now.  Naming is hard, I know :(

How about set_selection_kernel()?  set_selection_tiocl()?

Something to show that one takes a userspace pointer, and the other a
kernel pointer, how about:
set_selection_user()
set_selection_kernel()
making it more obvious?

thanks,

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


Re: [PATCH v2] staging: rtl8192u: ieee80211: fix checkpatch space errors

2019-04-16 Thread Greg KH
On Sat, Apr 06, 2019 at 07:02:23PM -0300, Caio Salvador Rohwedder wrote:
> Fix checkpatch space coding style errors, warnings and checks on 
> rtl819x_TSProc.c
> 
> Signed-off-by: Caio Salvador Rohwedder 
> ---
> Changes in v2:
>   - change commit message
>   - fix remaining space errors
> ---
>  .../rtl8192u/ieee80211/rtl819x_TSProc.c   | 112 +-
>  1 file changed, 56 insertions(+), 56 deletions(-)

This patch did not apply at all to my tree :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: gasket: replace symbolic permissions with octal permissions

2019-04-16 Thread Greg KH
On Wed, Apr 10, 2019 at 03:58:48PM +0530, Himadri Pandya wrote:
> Resolve checkpatch warning for using symbolic permissions by replacing
> them with octal permissions.
> 
> Signed-off-by: Himadri Pandya 
> ---
>  drivers/staging/gasket/gasket_sysfs.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/gasket/gasket_sysfs.h 
> b/drivers/staging/gasket/gasket_sysfs.h
> index 1d0eed66a7f4..28dc422d388c 100644
> --- a/drivers/staging/gasket/gasket_sysfs.h
> +++ b/drivers/staging/gasket/gasket_sysfs.h
> @@ -75,7 +75,7 @@ struct gasket_sysfs_attribute {
>  
>  #define GASKET_SYSFS_RO(_name, _show_function, _attr_type)   
>   \
>   {  \
> - .attr = __ATTR(_name, S_IRUGO, _show_function, NULL),  \
> + .attr = __ATTR(_name, 0444, _show_function, NULL),  \
>   .data.attr_type = _attr_type   \
>   }

This has been rejected many times in the past as the real solution is to
use __ATTR_RO here.

thanks,

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


Re: [PATCH] staging: gdm724x: Add parenthesis to Macro arguments

2019-04-16 Thread Greg KH
On Mon, Apr 08, 2019 at 02:37:58PM -0300, Andre wrote:
> Hi Greg, thanks for replying.
> 
> On 03/04/2019 01:26, Greg KH wrote:
> > On Tue, Apr 02, 2019 at 10:04:05PM -0300, Andre Dainez wrote:
> >> Fix checkpatch errors:
> >>
> >> CHECK: Macro argument 'len' may be better as '(len)' to avoid precedence 
> >> issues
> >> CHECK: Macro argument 'nlh' may be better as '(nlh)' to avoid precedence 
> >> issues
> >>
> >> Signed-off-by: Andre Dainez 
> >> ---
> >>  drivers/staging/gdm724x/netlink_k.c | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/staging/gdm724x/netlink_k.c 
> >> b/drivers/staging/gdm724x/netlink_k.c
> >> index 92440c3..36d88f4 100644
> >> --- a/drivers/staging/gdm724x/netlink_k.c
> >> +++ b/drivers/staging/gdm724x/netlink_k.c
> >> @@ -19,8 +19,8 @@ static DEFINE_MUTEX(netlink_mutex);
> >>  #define ND_NLMSG_SPACE(len)   (NLMSG_SPACE(len) + ND_IFINDEX_LEN)
> >>  #define ND_NLMSG_DATA(nlh)((void *)((char *)NLMSG_DATA(nlh) + \
> >>  ND_IFINDEX_LEN))
> >> -#define ND_NLMSG_S_LEN(len)   (len + ND_IFINDEX_LEN)
> >> -#define ND_NLMSG_R_LEN(nlh)   (nlh->nlmsg_len - ND_IFINDEX_LEN)
> >> +#define ND_NLMSG_S_LEN(len)   ((len) + ND_IFINDEX_LEN)
> > 
> > This makes sense, but:
> > 
> >> +#define ND_NLMSG_R_LEN(nlh)   ((nlh)->nlmsg_len - ND_IFINDEX_LEN)
> > 
> > That does not, correct?
> > 
> Could you please clarify why this doesn't make sense?
> If, for some reason I calculate by hand the pointer address and call this 
> macro like: 
> ND_NLMSG_R_LEN(nlh + sizeof(*nlh)), 
> then it would expand like nlh + sizeof(*nlh)->nlmsg_len - ND_IFINDEX_LEN
> which looks wrong in my pov, no?

Why would anyone ever do such a thing?  :)

That's the issue here, this is not needed as if someone were to want to
do something crazy like you are suggesting, it will properly blow up, so
no need to change anything here.

thanks,

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


Re: [PATCH] staging: comedi: adv_pci1710: fix spelling mistake: "droput" -> "dropout"

2019-04-16 Thread Ian Abbott

On 15/04/2019 18:49, Colin King wrote:

From: Colin Ian King 

There is a spelling mistake in a dev_error message. Fix it.

Signed-off-by: Colin Ian King 


Looks good, thanks!

Reviewed-by: Ian Abbott 


---
  drivers/staging/comedi/drivers/adv_pci1710.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/adv_pci1710.c 
b/drivers/staging/comedi/drivers/adv_pci1710.c
index 6a93b04f1fdf..dbff0f7e7cf5 100644
--- a/drivers/staging/comedi/drivers/adv_pci1710.c
+++ b/drivers/staging/comedi/drivers/adv_pci1710.c
@@ -317,7 +317,7 @@ static int pci1710_ai_read_sample(struct comedi_device *dev,
chan = sample >> 12;
if (chan != devpriv->act_chanlist[cur_chan]) {
dev_err(dev->class_dev,
-   "A/D data droput: received from channel %d, expected 
%d\n",
+   "A/D data dropout: received from channel %d, 
expected %d\n",
chan, devpriv->act_chanlist[cur_chan]);
return -ENODATA;
}




--
-=( Ian Abbott  || Web: www.mev.co.uk )=-
-=( MEV Ltd. is a company registered in England & Wales. )=-
-=( Registered number: 02862268.  Registered address:)=-
-=( 15 West Park Road, Bramhall, STOCKPORT, SK7 3JZ, UK. )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: comedi: adv_pci1710: fix spelling mistake: "droput" -> "dropout"

2019-04-16 Thread Mukesh Ojha



On 4/15/2019 11:19 PM, Colin King wrote:

From: Colin Ian King 

There is a spelling mistake in a dev_error message. Fix it.

Signed-off-by: Colin Ian King 

Reviewed-by: Mukesh Ojha 

Cheers,
-Mukesh


---
  drivers/staging/comedi/drivers/adv_pci1710.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/adv_pci1710.c 
b/drivers/staging/comedi/drivers/adv_pci1710.c
index 6a93b04f1fdf..dbff0f7e7cf5 100644
--- a/drivers/staging/comedi/drivers/adv_pci1710.c
+++ b/drivers/staging/comedi/drivers/adv_pci1710.c
@@ -317,7 +317,7 @@ static int pci1710_ai_read_sample(struct comedi_device *dev,
chan = sample >> 12;
if (chan != devpriv->act_chanlist[cur_chan]) {
dev_err(dev->class_dev,
-   "A/D data droput: received from channel %d, expected 
%d\n",
+   "A/D data dropout: received from channel %d, 
expected %d\n",
chan, devpriv->act_chanlist[cur_chan]);
return -ENODATA;
}

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


Re: [PATCH] staging: wilc1000: fix spelling mistake "dissconect" -> "disconnect"

2019-04-16 Thread Mukesh Ojha



On 4/15/2019 10:03 PM, Colin King wrote:

From: Colin Ian King 

There is a spelling mistake in a netdev_err error message, fix it.

Signed-off-by: Colin Ian King 

Reviewed-by: Mukesh Ojha 

Cheers,
-Mukesh


---
  drivers/staging/wilc1000/host_interface.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index e1a35bb426f9..ed15bd1bcd56 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -774,7 +774,7 @@ int wilc_disconnect(struct wilc_vif *vif)
result = wilc_send_config_pkt(vif, WILC_SET_CFG, , 1,
  wilc_get_vif_idx(vif));
if (result) {
-   netdev_err(vif->ndev, "Failed to send dissconect\n");
+   netdev_err(vif->ndev, "Failed to send disconnect\n");
return result;
}
  

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