Re: [PATCH] Documentation: process: Correct numbering

2020-12-15 Thread Sudip Mukherjee
Hi Milan,

On Tue, Dec 15, 2020 at 07:50:35PM +, Milan Lakhani wrote:
> Renumber the steps in submit-checklist.rst as some numbers were skipped.
> 
> Signed-off-by: Milan Lakhani 

Maybe you can also add:
Fixes: 72deb455b5ec ("block: remove CONFIG_LBDAF")

But I am confused about why you have added Greg and staging list instead
of 'linux-...@vger.kernel.org'.

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


[PATCH] staging: rtl8723bs: reduce stack usage of rtw_cfg80211_unlink_bss

2019-10-18 Thread Sudip Mukherjee
The build of xtensa allmodconfig gives warning of:
In function 'rtw_cfg80211_unlink_bss':
warning: the frame size of 1136 bytes is larger than 1024 bytes

Instead of having 'select_network' structure as a variable use it as a
pointer.

Signed-off-by: Sudip Mukherjee 
---
 drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c 
b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index 59ea4fce9a08..a25c535b6b4f 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
@@ -1410,16 +1410,17 @@ void rtw_cfg80211_unlink_bss(struct adapter *padapter, 
struct wlan_network *pnet
struct wireless_dev *pwdev = padapter->rtw_wdev;
struct wiphy *wiphy = pwdev->wiphy;
struct cfg80211_bss *bss = NULL;
-   struct wlan_bssid_ex select_network = pnetwork->network;
+   struct wlan_bssid_ex *select_network = >network;
 
bss = cfg80211_get_bss(wiphy, NULL/*notify_channel*/,
-   select_network.MacAddress, select_network.Ssid.Ssid,
-   select_network.Ssid.SsidLength, 0/*WLAN_CAPABILITY_ESS*/,
+   select_network->MacAddress, select_network->Ssid.Ssid,
+   select_network->Ssid.SsidLength, 0/*WLAN_CAPABILITY_ESS*/,
0/*WLAN_CAPABILITY_ESS*/);
 
if (bss) {
cfg80211_unlink_bss(wiphy, bss);
-   DBG_8192C("%s(): cfg80211_unlink %s!! () ", __func__, 
select_network.Ssid.Ssid);
+   DBG_8192C("%s(): cfg80211_unlink %s!! () ", __func__,
+ select_network->Ssid.Ssid);
cfg80211_put_bss(padapter->rtw_wdev->wiphy, bss);
}
 }
-- 
2.11.0

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


[PATCH] staging: sm750fb: add drm development branch details

2018-04-29 Thread Sudip Mukherjee
The sm750 driver in staging has no future as new framebuffer driver
will not be added to fbdev anymore. A drm driver is being prepared, and
the details added to the TODO file. This sm750fb driver will be removed
as soon as the drm driver is ready. Also, remove my old email.

Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Sudip Mukherjee <sudipm.mukher...@gmail.com>
---
 drivers/staging/sm750fb/TODO | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/sm750fb/TODO b/drivers/staging/sm750fb/TODO
index f710ab1..aeb2df3 100644
--- a/drivers/staging/sm750fb/TODO
+++ b/drivers/staging/sm750fb/TODO
@@ -9,8 +9,11 @@ TODO:
 - must be ported to the atomic kms framework in the drm subsystem (which will
   give you a basic fbdev driver for free)
 
+Note:
+- This driver will be removed from staging after the drm driver is ready
+- The drm driver is getting ready at https://gitlab.com/sudipm/sm750/tree/sm750
+
 Please send any patches to
Greg Kroah-Hartman <g...@kroah.com>
    Sudip Mukherjee <sudipm.mukher...@gmail.com>
Teddy Wang <teddy.w...@siliconmotion.com>
-   Sudip Mukherjee <su...@vectorindia.org>
-- 
1.9.1

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


Re: [PATCH RESEND] staging: sm750fb: avoid conflicting vesafb

2017-07-12 Thread Sudip Mukherjee
On Wed, Jul 12, 2017 at 08:06:24AM +0200, Greg Kroah-Hartman wrote:
> On Tue, Jul 11, 2017 at 10:03:01PM +0100, Sudip Mukherjee wrote:
> > Hi Greg,
> > 
> > On Fri, Jun 30, 2017 at 09:57:43PM +0100, Sudip Mukherjee wrote:
> > > From: Teddy Wang <teddy.w...@siliconmotion.com>
> > > 

> > 
> > A gentle ping.
> 
> It's in the middle of the merge window, I can't do anything with patches
> right now, you know better than this...

yes, sorry, my bad.
lost count of days.

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


Re: [PATCH RESEND] staging: sm750fb: avoid conflicting vesafb

2017-07-11 Thread Sudip Mukherjee
Hi Greg,

On Fri, Jun 30, 2017 at 09:57:43PM +0100, Sudip Mukherjee wrote:
> From: Teddy Wang <teddy.w...@siliconmotion.com>
> 
> If vesafb is enabled in the config then /dev/fb0 is created by vesa
> and this sm750 driver gets fb1, fb2. But we need to be fb0 and fb1 to
> effectively work with xorg.
> So if it has been alloted fb1, then try to remove the other fb0.
> 
> Cc: <sta...@vger.kernel.org> # v4.4+
> Signed-off-by: Teddy Wang <teddy.w...@siliconmotion.com>
> Signed-off-by: Sudip Mukherjee <sudipm.mukher...@gmail.com>
> ---
> 
> In the previous send, why #ifdef is used was asked.
> https://lkml.org/lkml/2017/6/25/57
> 
> Answered at: https://lkml.org/lkml/2017/6/25/69
> Also pasting here for reference.
> 
> 'Did a quick research into "why".
> The patch d8801e4df91e ("x86/PCI: Set IORESOURCE_ROM_SHADOW only for the
> default VGA device") has started setting IORESOURCE_ROM_SHADOW in flags
> for a default VGA device and that is being done only for x86.
> And so, we will need that #ifdef to check IORESOURCE_ROM_SHADOW as that
> needs to be checked only for a x86 and not for other arch.'

A gentle ping.

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


[PATCH RESEND] staging: sm750fb: avoid conflicting vesafb

2017-06-30 Thread Sudip Mukherjee
From: Teddy Wang <teddy.w...@siliconmotion.com>

If vesafb is enabled in the config then /dev/fb0 is created by vesa
and this sm750 driver gets fb1, fb2. But we need to be fb0 and fb1 to
effectively work with xorg.
So if it has been alloted fb1, then try to remove the other fb0.

Cc: <sta...@vger.kernel.org> # v4.4+
Signed-off-by: Teddy Wang <teddy.w...@siliconmotion.com>
Signed-off-by: Sudip Mukherjee <sudipm.mukher...@gmail.com>
---

In the previous send, why #ifdef is used was asked.
https://lkml.org/lkml/2017/6/25/57

Answered at: https://lkml.org/lkml/2017/6/25/69
Also pasting here for reference.

'Did a quick research into "why".
The patch d8801e4df91e ("x86/PCI: Set IORESOURCE_ROM_SHADOW only for the
default VGA device") has started setting IORESOURCE_ROM_SHADOW in flags
for a default VGA device and that is being done only for x86.
And so, we will need that #ifdef to check IORESOURCE_ROM_SHADOW as that
needs to be checked only for a x86 and not for other arch.'

 drivers/staging/sm750fb/sm750.c | 24 
 1 file changed, 24 insertions(+)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index d5934f3..8199dbe 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -1053,6 +1053,26 @@ static int sm750fb_frambuffer_alloc(struct sm750_dev 
*sm750_dev, int fbidx)
return err;
 }
 
+static int lynxfb_kick_out_firmware_fb(struct pci_dev *pdev)
+{
+   struct apertures_struct *ap;
+   bool primary = false;
+
+   ap = alloc_apertures(1);
+   if (!ap)
+   return -ENOMEM;
+
+   ap->ranges[0].base = pci_resource_start(pdev, 0);
+   ap->ranges[0].size = pci_resource_len(pdev, 0);
+#ifdef CONFIG_X86
+   primary = pdev->resource[PCI_ROM_RESOURCE].flags &
+   IORESOURCE_ROM_SHADOW;
+#endif
+   remove_conflicting_framebuffers(ap, "sm750_fb1", primary);
+   kfree(ap);
+   return 0;
+}
+
 static int lynxfb_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
 {
@@ -1061,6 +1081,10 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
int fbidx;
int err;
 
+   err = lynxfb_kick_out_firmware_fb(pdev);
+   if (err)
+   return err;
+
/* enable device */
err = pcim_enable_device(pdev);
if (err)
-- 
1.9.1

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


Re: [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb

2017-06-25 Thread Sudip Mukherjee
On Sun, Jun 25, 2017 at 04:27:23PM +0200, Greg Kroah-Hartman wrote:
> On Sun, Jun 25, 2017 at 02:54:29PM +0100, Sudip Mukherjee wrote:
> > On Sun, Jun 25, 2017 at 02:54:51PM +0200, Greg Kroah-Hartman wrote:
> > > On Sun, Jun 25, 2017 at 01:43:34PM +0100, Sudip Mukherjee wrote:
> > > > On Mon, Jun 19, 2017 at 09:32:57PM +0100, Sudip Mukherjee wrote:
> > > > > From: Teddy Wang <teddy.w...@siliconmotion.com>
> > > > > 
> > > > > If vesafb is enabled in the config then /dev/fb0 is created by vesa
> > > > > and this sm750 driver gets fb1, fb2. But we need to be fb0 and fb1 to
> > > > > effectively work with xorg.
> > > > > So if it has been alloted fb1, then try to remove the other fb0.
> > > > > 
> > > > > Signed-off-by: Teddy Wang <teddy.w...@siliconmotion.com>
> > > > > Signed-off-by: Sudip Mukherjee <sudipm.mukher...@gmail.com>
> > > > > ---
> > > > 
> > > > Hi Greg,
> > > > You applied the second patch but not this one. Did I miss any review
> > > > comments from you about this one?
> > > 
> > > All of the other complaints about this patch were not sufficient for me
> > > to justify ignoring it?  Why would I not listen to them?
> > 
> > This patch is doing what all the drm drivers are doing. So you want
> > us to do something completely new rather than following the established
> > practice of a drm driver?
> 
> I despise cargo-cult programming.  You could not answer the "why", so
> why would I accept such a patch?

Did a quick research into "why".
The patch d8801e4df91e ("x86/PCI: Set IORESOURCE_ROM_SHADOW only for the
default VGA device") has started setting IORESOURCE_ROM_SHADOW in flags
for a default VGA device and that is being done only for x86.
And so, we will need that #ifdef to check IORESOURCE_ROM_SHADOW as that
needs to be checked only for a x86 and not for other arch.

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


Re: [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb

2017-06-25 Thread Sudip Mukherjee
On Sun, Jun 25, 2017 at 02:54:51PM +0200, Greg Kroah-Hartman wrote:
> On Sun, Jun 25, 2017 at 01:43:34PM +0100, Sudip Mukherjee wrote:
> > On Mon, Jun 19, 2017 at 09:32:57PM +0100, Sudip Mukherjee wrote:
> > > From: Teddy Wang <teddy.w...@siliconmotion.com>
> > > 
> > > If vesafb is enabled in the config then /dev/fb0 is created by vesa
> > > and this sm750 driver gets fb1, fb2. But we need to be fb0 and fb1 to
> > > effectively work with xorg.
> > > So if it has been alloted fb1, then try to remove the other fb0.
> > > 
> > > Signed-off-by: Teddy Wang <teddy.w...@siliconmotion.com>
> > > Signed-off-by: Sudip Mukherjee <sudipm.mukher...@gmail.com>
> > > ---
> > 
> > Hi Greg,
> > You applied the second patch but not this one. Did I miss any review
> > comments from you about this one?
> 
> All of the other complaints about this patch were not sufficient for me
> to justify ignoring it?  Why would I not listen to them?

This patch is doing what all the drm drivers are doing. So you want
us to do something completely new rather than following the established
practice of a drm driver?

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


Re: [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb

2017-06-25 Thread Sudip Mukherjee
On Mon, Jun 19, 2017 at 09:32:57PM +0100, Sudip Mukherjee wrote:
> From: Teddy Wang <teddy.w...@siliconmotion.com>
> 
> If vesafb is enabled in the config then /dev/fb0 is created by vesa
> and this sm750 driver gets fb1, fb2. But we need to be fb0 and fb1 to
> effectively work with xorg.
> So if it has been alloted fb1, then try to remove the other fb0.
> 
> Signed-off-by: Teddy Wang <teddy.w...@siliconmotion.com>
> Signed-off-by: Sudip Mukherjee <sudipm.mukher...@gmail.com>
> ---

Hi Greg,
You applied the second patch but not this one. Did I miss any review
comments from you about this one?

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


Re: [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb

2017-06-20 Thread Sudip Mukherjee
On Tue, Jun 20, 2017 at 11:40:59PM +0300, Andy Shevchenko wrote:
> On Tue, Jun 20, 2017 at 11:20 PM, Dan Carpenter
>  wrote:
> > That's totally bogus.  Just say you don't know.  It's never a
> > reguirement that people fix AMD drivers before they can review code...
> 
> Agree. It's not a cargo cult.
> If there any real thing behind that #ifdef  I would like to hear.

I dont know the real thing behind that. You can hear the real thing if
you send that patch to drm. And that is the only reason I mentioned that.

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


Re: [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb

2017-06-20 Thread Sudip Mukherjee
Hi Dan,

On Tue, Jun 20, 2017 at 11:20:55PM +0300, Dan Carpenter wrote:
> That's totally bogus.  Just say you don't know.  It's never a
> reguirement that people fix AMD drivers before they can review code...

Yes, I don't know how drm drivers work, so I blindly follow what has
been done there. And since sm750 ultimately has to be converted to a drm
driver to be taken out of staging, so I will prefer to have similar
changes here.

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


Re: [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb

2017-06-20 Thread Sudip Mukherjee
On Mon, Jun 19, 2017 at 11:47:20PM +0300, Andy Shevchenko wrote:
> On Mon, Jun 19, 2017 at 11:32 PM, Sudip Mukherjee
> <sudipm.mukher...@gmail.com> wrote:
> 
> 
> > +#ifdef CONFIG_X86
> > +   primary = pdev->resource[PCI_ROM_RESOURCE].flags &
> > +   IORESOURCE_ROM_SHADOW;
> > +#endif
> 
> Why do we need #ifdef?

It has been done in exactly the same way it is done in drm drivers.
All the drm drivers I have checked uses #ifdef.

See for example:
http://elixir.free-electrons.com/linux/v4.12-rc6/source/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c#L470

If you think #ifdef is not required, please send patch for the drm
drivers, and we follow that change here also.

> 
> In any case you may introduce a temporary variable to have pointer to resource
> 
> struct resource *res = >resource[PCI_ROM_RESOURCE];

No, we will not want to do it in a different way than the way it is done
by drm drivers.

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


[PATCH 1/2] staging: sm750fb: avoid conflicting vesafb

2017-06-19 Thread Sudip Mukherjee
From: Teddy Wang <teddy.w...@siliconmotion.com>

If vesafb is enabled in the config then /dev/fb0 is created by vesa
and this sm750 driver gets fb1, fb2. But we need to be fb0 and fb1 to
effectively work with xorg.
So if it has been alloted fb1, then try to remove the other fb0.

Signed-off-by: Teddy Wang <teddy.w...@siliconmotion.com>
Signed-off-by: Sudip Mukherjee <sudipm.mukher...@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 24 
 1 file changed, 24 insertions(+)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index d5934f3..8199dbe 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -1053,6 +1053,26 @@ static int sm750fb_frambuffer_alloc(struct sm750_dev 
*sm750_dev, int fbidx)
return err;
 }
 
+static int lynxfb_kick_out_firmware_fb(struct pci_dev *pdev)
+{
+   struct apertures_struct *ap;
+   bool primary = false;
+
+   ap = alloc_apertures(1);
+   if (!ap)
+   return -ENOMEM;
+
+   ap->ranges[0].base = pci_resource_start(pdev, 0);
+   ap->ranges[0].size = pci_resource_len(pdev, 0);
+#ifdef CONFIG_X86
+   primary = pdev->resource[PCI_ROM_RESOURCE].flags &
+   IORESOURCE_ROM_SHADOW;
+#endif
+   remove_conflicting_framebuffers(ap, "sm750_fb1", primary);
+   kfree(ap);
+   return 0;
+}
+
 static int lynxfb_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
 {
@@ -1061,6 +1081,10 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
int fbidx;
int err;
 
+   err = lynxfb_kick_out_firmware_fb(pdev);
+   if (err)
+   return err;
+
/* enable device */
err = pcim_enable_device(pdev);
if (err)
-- 
1.9.1

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


[PATCH 2/2] staging: sm750fb: change default screen resolution

2017-06-19 Thread Sudip Mukherjee
The previous patch which updated screen resolution was tested under
wrong environment. sm750 driver does not support 24bpp. It only
supports 8bpp, 16bpp and 32bpp.
Lets update the default screen resolution to use 32bpp for a better
screen performance.

Fixes: ac669251087d ("staging: sm750fb: change default screen resolution")
Signed-off-by: Sudip Mukherjee <sudipm.mukher...@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 8199dbe..aa26280 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -33,7 +33,7 @@
 static int g_noaccel;
 static int g_nomtrr;
 static const char *g_fbmode[] = {NULL, NULL};
-static const char *g_def_fbmode = "1024x768-24@60";
+static const char *g_def_fbmode = "1024x768-32@60";
 static char *g_settings;
 static int g_dualview;
 static char *g_option;
-- 
1.9.1

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


[PATCH] staging: sm750fb: change default screen resolution

2017-06-04 Thread Sudip Mukherjee
Update the default screen resolution and also use 24bpp for a better
screen performance.

Tested-by: Teddy Wang <teddy.w...@siliconmotion.com>
Signed-off-by: Sudip Mukherjee <sudipm.mukher...@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index a7f722a..d5934f3 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -33,7 +33,7 @@
 static int g_noaccel;
 static int g_nomtrr;
 static const char *g_fbmode[] = {NULL, NULL};
-static const char *g_def_fbmode = "800x600-16@60";
+static const char *g_def_fbmode = "1024x768-24@60";
 static char *g_settings;
 static int g_dualview;
 static char *g_option;
-- 
1.9.1

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


[PATCH RESEND] staging: media: lirc: use new parport device model

2017-01-20 Thread Sudip Mukherjee
From: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>

Modify lirc_parallel driver to use the new parallel port device model.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---

Resending after more than one year.
Prevoius patch is at https://patchwork.kernel.org/patch/7883591/

 drivers/staging/media/lirc/lirc_parallel.c | 93 --
 1 file changed, 62 insertions(+), 31 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_parallel.c 
b/drivers/staging/media/lirc/lirc_parallel.c
index bfb76a4..0a43bac2b 100644
--- a/drivers/staging/media/lirc/lirc_parallel.c
+++ b/drivers/staging/media/lirc/lirc_parallel.c
@@ -626,41 +626,26 @@ static void kf(void *handle)
 
 /*** module initialization and cleanup ***/
 
-static int __init lirc_parallel_init(void)
+static void lirc_parallel_attach(struct parport *port)
 {
-   int result;
-
-   result = platform_driver_register(_parallel_driver);
-   if (result) {
-   pr_notice("platform_driver_register returned %d\n", result);
-   return result;
-   }
+   struct pardev_cb lirc_parallel_cb;
 
-   lirc_parallel_dev = platform_device_alloc(LIRC_DRIVER_NAME, 0);
-   if (!lirc_parallel_dev) {
-   result = -ENOMEM;
-   goto exit_driver_unregister;
-   }
+   if (port->base != io)
+   return;
 
-   result = platform_device_add(lirc_parallel_dev);
-   if (result)
-   goto exit_device_put;
+   pport = port;
+   memset(_parallel_cb, 0, sizeof(lirc_parallel_cb));
+   lirc_parallel_cb.preempt = pf;
+   lirc_parallel_cb.wakeup = kf;
+   lirc_parallel_cb.irq_func = lirc_lirc_irq_handler;
 
-   pport = parport_find_base(io);
-   if (!pport) {
-   pr_notice("no port at %x found\n", io);
-   result = -ENXIO;
-   goto exit_device_del;
-   }
-   ppdevice = parport_register_device(pport, LIRC_DRIVER_NAME,
-  pf, kf, lirc_lirc_irq_handler, 0,
-  NULL);
-   parport_put_port(pport);
+   ppdevice = parport_register_dev_model(port, LIRC_DRIVER_NAME,
+ _parallel_cb, 0);
if (!ppdevice) {
pr_notice("parport_register_device() failed\n");
-   result = -ENXIO;
-   goto exit_device_del;
+   return;
}
+
if (parport_claim(ppdevice) != 0)
goto skip_init;
is_claimed = 1;
@@ -688,18 +673,64 @@ static int __init lirc_parallel_init(void)
 
is_claimed = 0;
parport_release(ppdevice);
+
  skip_init:
+   return;
+}
+
+static void lirc_parallel_detach(struct parport *port)
+{
+   if (port->base != io)
+   return;
+
+   parport_unregister_device(ppdevice);
+}
+
+static struct parport_driver lirc_parport_driver = {
+   .name = LIRC_DRIVER_NAME,
+   .match_port = lirc_parallel_attach,
+   .detach = lirc_parallel_detach,
+   .devmodel = true,
+};
+
+static int __init lirc_parallel_init(void)
+{
+   int result;
+
+   result = platform_driver_register(_parallel_driver);
+   if (result) {
+   pr_notice("platform_driver_register returned %d\n", result);
+   return result;
+   }
+
+   lirc_parallel_dev = platform_device_alloc(LIRC_DRIVER_NAME, 0);
+   if (!lirc_parallel_dev) {
+   result = -ENOMEM;
+   goto exit_driver_unregister;
+   }
+
+   result = platform_device_add(lirc_parallel_dev);
+   if (result)
+   goto exit_device_put;
+
+   result = parport_register_driver(_parport_driver);
+   if (result) {
+   pr_notice("parport_register_driver returned %d\n", result);
+   goto exit_device_del;
+   }
+
driver.dev = _parallel_dev->dev;
driver.minor = lirc_register_driver();
if (driver.minor < 0) {
pr_notice("register_chrdev() failed\n");
-   parport_unregister_device(ppdevice);
result = -EIO;
-   goto exit_device_del;
+   goto exit_unregister;
}
pr_info("installed using port 0x%04x irq %d\n", io, irq);
return 0;
 
+exit_unregister:
+   parport_unregister_driver(_parport_driver);
 exit_device_del:
platform_device_del(lirc_parallel_dev);
 exit_device_put:
@@ -711,9 +742,9 @@ static int __init lirc_parallel_init(void)
 
 static void __exit lirc_parallel_exit(void)
 {
-   parport_unregister_device(ppdevice);
lirc_unregister_driver(driver.minor);
 
+   parport_unregister_driver(_parport_driver);
platform_device_unregister(lirc_parallel_dev);
platform_driver_unregister(_parallel_driver);
 }
-- 
1.9.1

__

Re: [PATCH] staging: sm750fb: update license

2016-12-08 Thread Sudip Mukherjee

On Saturday 26 November 2016 11:02 AM, Greg Kroah-Hartman wrote:

On Sat, Nov 26, 2016 at 09:07:42AM +, Sudip Mukherjee wrote:

The driver was actually released with BSD license. It also gained GPL
when it was submitted to be included in the kernel.

Cc: Teddy Wang <teddy.w...@siliconmotion.com>
Cc: gzhou1 <guojian.z...@windriver.com>
Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
  drivers/staging/sm750fb/sm750.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 2d22c51..e9632f1 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -1243,4 +1243,4 @@ static void __exit lynxfb_exit(void)
  MODULE_AUTHOR("monk liu <monk@siliconmotion.com>");
  MODULE_AUTHOR("Sudip Mukherjee <su...@vectorindia.org>");
  MODULE_DESCRIPTION("Frame buffer driver for SM750 chipset");
-MODULE_LICENSE("GPL v2");
+MODULE_LICENSE("Dual BSD/GPL");


Should you also update the top of the files that don't say anything
about licenses?

I'll take this patch, but an update for them would also be good.


Sure, I will update the pages with the license text that Teddy sent me 
and will send you the patch by this weekend.


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


[PATCH] staging: sm750fb: update license

2016-11-26 Thread Sudip Mukherjee
The driver was actually released with BSD license. It also gained GPL
when it was submitted to be included in the kernel.

Cc: Teddy Wang <teddy.w...@siliconmotion.com>
Cc: gzhou1 <guojian.z...@windriver.com> 
Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/sm750fb/sm750.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 2d22c51..e9632f1 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -1243,4 +1243,4 @@ static void __exit lynxfb_exit(void)
 MODULE_AUTHOR("monk liu <monk@siliconmotion.com>");
 MODULE_AUTHOR("Sudip Mukherjee <su...@vectorindia.org>");
 MODULE_DESCRIPTION("Frame buffer driver for SM750 chipset");
-MODULE_LICENSE("GPL v2");
+MODULE_LICENSE("Dual BSD/GPL");
-- 
1.9.1

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


Re: [PATCH] staging/android: mark sync_timeline_create() static

2016-09-04 Thread Sudip Mukherjee
On Sat, Sep 03, 2016 at 02:34:13PM +0800, Baoyou Xie wrote:
> We get 1 warning when building kernel with W=1:
> drivers/staging/android/sw_sync.c:56:23: warning: no previous prototype for 
> 'sync_timeline_create' [-Wmissing-prototypes]
> 
> In fact, this function is only used in the file in which it is
> declared and don't need a declaration, but can be made static.
> so this patch marks this function with 'static'.
> 
> Signed-off-by: Baoyou Xie 
> ---
>  drivers/staging/android/sw_sync.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

which tree are you using?

This file has been removed from staging by:
35538d7822e8 ("dma-buf/sw_sync: de-stage SW_SYNC")

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


Re: [PATCH] staging: rtl8712: fixed comment style and space indent

2016-09-04 Thread Sudip Mukherjee
On Fri, Sep 02, 2016 at 09:14:15PM +0800, Louie Lu wrote:
> fixed comment style and space indent report from checkpatch
> in rtl8712/rtl871x_ioctl_linux.c:
> 
> * WARNING: Statements should start on a tabstop
> * WARNING: Block comments use * on subsequent lines
> * WARNING: suspect code indent for conditional statements (16, 32)
> 
> Signed-off-by: Louie Lu 
> ---

That becomes 3 different changes in a single patch.
You should be doing a single type of change in a patch.
please break them into separate patches.

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


Re: [PATCH] staging:ks7010:Fix warning about coding style spacing issue around asterisk in ks_wlan_net.c

2016-09-04 Thread Sudip Mukherjee
On Wed, Aug 31, 2016 at 08:20:10PM -0400, Nicholas Krause wrote:
> This fixes warning around a asterisk used in ks_wlan_net.c
> for the define statement used for this driver's transmit
> queue timeout value as defined by the marco, TX_TIMEOUT.
> Signed-off-by: Nicholas Krause 
> ---

Please keep a blank line between your commit message and your
Signed-off-by line.

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


Re: [PATCH v2 1/1] drivers: staging: rtl8723au: hal: Remove pointless test

2016-09-04 Thread Sudip Mukherjee
On Sun, Sep 04, 2016 at 01:01:20PM +0200, Matthias Beyer wrote:
> This patch removes the pointless `else if` test.
> 
> Signed-off-by: Matthias Beyer 
> Reported-by: David Binderman 
> ---

looks like Greg has already applied your first patch.
db0c12744f8d ("drivers: staging: rtl8723au: hal: Remove pointless test")

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


[PATCH 2/2 RESEND] staging: ks7010: fix memory leak

2016-09-04 Thread Sudip Mukherjee
If the firmware request failed we were just returning but we missed
freeing the memory and releasing the MMC Host.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/ks7010/ks7010_sdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 7bcf1ea..86cdebe 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -791,7 +791,7 @@ static int ks7010_upload_firmware(struct ks_wlan_private 
*priv,
 
retval = request_firmware(_entry, ROM_FILE, 
>ks_wlan_hw.sdio_card->func->dev);
if (retval)
-   return retval;
+   goto error_out0;
 
length = fw_entry->size;
 
-- 
1.9.1

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


[PATCH 1/2 RESEND] staging: ks7010: return on failure

2016-09-04 Thread Sudip Mukherjee
On failure we were jumping to error_out0 where we were trying
sdio_release_host() but at this point of execution we still have not
done sdio_claim_host() and as a result host->claimed can still be 0.
And if host->claimed is 0 then WARN_ON(!host->claimed) will give
a warning.
Moreover, if it is still not claimed then mmc_host->claim_cnt will be 0
and mmc_release_host() will do "if (--host->claim_cnt)" and thus the
condition will become true.
Lets just return the value on allocation failure instead of trying to
release the host before claiming it.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---

resending both as GregKH asked to add the maintainers email. Though
MAINTAINERS is not having an entry for this.

 drivers/staging/ks7010/ks7010_sdio.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 47b69cb..7bcf1ea 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -776,10 +776,8 @@ static int ks7010_upload_firmware(struct ks_wlan_private 
*priv,
 
/* buffer allocate */
rom_buf = kmalloc(ROM_BUFF_SIZE, GFP_KERNEL);
-   if (!rom_buf) {
-   rc = 3;
-   goto error_out0;
-   }
+   if (!rom_buf)
+   return 3;
 
sdio_claim_host(card->func);
 
-- 
1.9.1

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


Re: [PATCH] staging: rts5208: rtsx.c: Fix checkpatch warnings.

2016-08-25 Thread Sudip Mukherjee
On Thu, Aug 25, 2016 at 09:59:46PM +0800, Ming-Chia Chung wrote:
> On Tue, Aug 23, 2016 at 12:01:36PM +0530, Sudip Mukherjee wrote:
> > On Tue, Aug 23, 2016 at 08:19:46AM +0800, Ming-Chia Chung wrote:
> > > On Mon, Aug 22, 2016 at 10:51:27PM +0530, Sudip Mukherjee wrote:
> > > > On Tue, Aug 23, 2016 at 12:54:17AM +0800, MingChia Chung wrote:
> > > > >   This patch fixes a minor checkpatch warnings:
> > > > > 
> > > > >   "WARNING: Block comments use a trailing */ on a separate line"
> > > > > 
> > > > >   Signed-off-by: Ming-Chia Chung <quex...@gmail.com>
> > > > > ---
> > > > >  drivers/staging/rts5208/rtsx.c | 42 
> > > > > --
> > > > >  1 file changed, 28 insertions(+), 14 deletions(-)
> > > > > 
> > > > > diff --git a/drivers/staging/rts5208/rtsx.c 
> > > > > b/drivers/staging/rts5208/rtsx.c
> > > > > index e992e03..a880411 100644
> > > > > --- a/drivers/staging/rts5208/rtsx.c
> > > > > +++ b/drivers/staging/rts5208/rtsx.c
> > > > > @@ -81,14 +81,16 @@ static int slave_alloc(struct scsi_device *sdev)
> > > > >  
> > > > >  static int slave_configure(struct scsi_device *sdev)
> > > > >  {
> > > > > - /* Scatter-gather buffers (all but the last) must have a length
> > > > > + /*
> > > > > +   * Scatter-gather buffers (all but the last) must have a length
> > > > 
> > > > The alignment doesnot look correct here. Also in some more places later
> > > > in this patch.
> > > > 
> > > > regards
> > > > Sudip
> > > 
> > > I sent this patch by following docs ([1] and [2]). The style for long
> > > comments needs the begining and ending almost-blank lines. There is no
> > > the begining almost-blank line only for the files in net/ and
> > > drivers/net/.
> > > Please let me know what I misunderstood.
> > 
> > After applying the patch the file was like:
> > /*
> >* Scatter-gather buffers (all but the last) must have a length
> >  * divisible by the bulk maxpacket size.  Otherwise a data packet
> >  * would end up being short, causing a premature end to the data
> >  * transfer.  Since high-speed bulk pipes have a maxpacket size
> > 
> > See the alignment of the second line. Please use tab instead of space. And 
> > also
> > checkpatch should have warned you not to use space before the Signed-off-by.
> > 
> 
> Thank you for detailed explanation. I enabled "expandtab" in vim so that
> I didn't realize the alignment is wrong. Now, I install 'linuxsty.vim'
> to view the code. But checkpatch.pl didn't show the warning of space.
> Here is my command:
> `kernels/staging$ perl scripts/checkpatch.pl -f 
> drivers/staging/rts5208/rtsx.c`

Please run checkpatch on your patch and it will show you the warning
about space before Signed-off-by. But it missed the place where space
was used inplace of tab. Maybe you can send a patch to fix checkpatch.

Added Cc: to Joe and Andy.

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


Re: [PATCH] staging: android: ion: ion.c fix parenthesis alignment

2016-08-24 Thread Sudip Mukherjee
On Wed, Aug 24, 2016 at 03:56:32AM +0700, Didik Setiawan wrote:
> Fix checkpatch.pl warning about "Alignment should match open parenthesis".
> ---

you missed the Signed-off-by: line.

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


[PATCH 2/2] staging: ks7010: fix memory leak

2016-08-23 Thread Sudip Mukherjee
If the firmware request failed we were just returning but we missed
freeing the memory and releasing the MMC Host.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/ks7010/ks7010_sdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 7bcf1ea..86cdebe 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -791,7 +791,7 @@ static int ks7010_upload_firmware(struct ks_wlan_private 
*priv,
 
retval = request_firmware(_entry, ROM_FILE, 
>ks_wlan_hw.sdio_card->func->dev);
if (retval)
-   return retval;
+   goto error_out0;
 
length = fw_entry->size;
 
-- 
1.9.1

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


[PATCH 1/2] staging: ks7010: return on failure

2016-08-23 Thread Sudip Mukherjee
On failure we were jumping to error_out0 where we were trying
sdio_release_host() but at this point of execution we still have not
done sdio_claim_host() and as a result host->claimed can still be 0.
And if host->claimed is 0 then WARN_ON(!host->claimed) will give
a warning.
Moreover, if it is still not claimed then mmc_host->claim_cnt will be 0
and mmc_release_host() will do "if (--host->claim_cnt)" and thus the
condition will become true.
Lets just return the value on allocation failure instead of trying to
release the host before claiming it.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/ks7010/ks7010_sdio.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 47b69cb..7bcf1ea 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -776,10 +776,8 @@ static int ks7010_upload_firmware(struct ks_wlan_private 
*priv,
 
/* buffer allocate */
rom_buf = kmalloc(ROM_BUFF_SIZE, GFP_KERNEL);
-   if (!rom_buf) {
-   rc = 3;
-   goto error_out0;
-   }
+   if (!rom_buf)
+   return 3;
 
sdio_claim_host(card->func);
 
-- 
1.9.1

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


Re: [PATCH -next] staging: comedi: dt2811: fix non static symbol warnings

2016-08-23 Thread Sudip Mukherjee
On Tue, Aug 23, 2016 at 03:02:21PM +, Wei Yongjun wrote:
> From: Wei Yongjun 
> 

>  drivers/staging/comedi/drivers/dt2811.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/comedi/drivers/dt2811.c 
> b/drivers/staging/comedi/drivers/dt2811.c
> index 8bbd938..fcd8547 100644
> --- a/drivers/staging/comedi/drivers/dt2811.c
> +++ b/drivers/staging/comedi/drivers/dt2811.c
> @@ -96,11 +96,11 @@
>   *6  6  100 kHz   6   100
>   *7 12   50 kHz   7   1000
>   */
> -const unsigned int dt2811_clk_dividers[] = {
> +static const unsigned int dt2811_clk_dividers[] = {
>   1, 10, 2, 3, 4, 5, 6, 12
>  };
>  
> -const unsigned int dt2811_clk_multipliers[] = {
> +static const unsigned int dt2811_clk_multipliers[] = {
>   1, 10, 100, 1000, 1, 10, 100, 1000
>  };

This has already been done by:
49c9d6ad68ae ("staging: comedi/drivers: Fixed sparse warnings")

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


[PATCH v2] staging: i4l: icn: use memdup_user

2016-08-23 Thread Sudip Mukherjee
Its better to use memdup_user which does the same thing which this
code has implemented. Also removed a related warning as we will be
warned if allocation fails.

Suggested-by: Fengguang Wu <fengguang...@intel.com>
Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---

v2: removed type change done in v1, and removed a warning.

 drivers/staging/i4l/icn/icn.c | 15 ---
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c
index b2f4055..415124f 100644
--- a/drivers/staging/i4l/icn/icn.c
+++ b/drivers/staging/i4l/icn/icn.c
@@ -810,16 +810,10 @@ icn_loadboot(u_char __user *buffer, icn_card *card)
 #ifdef BOOT_DEBUG
printk(KERN_DEBUG "icn_loadboot called, buffaddr=%08lx\n", (ulong) 
buffer);
 #endif
-   codebuf = kmalloc(ICN_CODE_STAGE1, GFP_KERNEL);
-   if (!codebuf) {
-   printk(KERN_WARNING "icn: Could not allocate code buffer\n");
-   ret = -ENOMEM;
-   goto out;
-   }
-   if (copy_from_user(codebuf, buffer, ICN_CODE_STAGE1)) {
-   ret = -EFAULT;
-   goto out_kfree;
-   }
+   codebuf = memdup_user(buffer, ICN_CODE_STAGE1);
+   if (IS_ERR(codebuf))
+   return PTR_ERR(codebuf);
+
if (!card->rvalid) {
if (!request_region(card->port, ICN_PORTLEN, card->regname)) {
printk(KERN_WARNING
@@ -902,7 +896,6 @@ icn_loadboot(u_char __user *buffer, icn_card *card)
 
 out_kfree:
kfree(codebuf);
-out:
return ret;
 }
 
-- 
1.9.1

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


Re: [PATCH] staging: i4l: icn: use memdup_user

2016-08-23 Thread Sudip Mukherjee
On Tue, Aug 23, 2016 at 06:50:30AM -0400, Greg Kroah-Hartman wrote:
> On Tue, Aug 23, 2016 at 03:57:34PM +0530, Sudip Mukherjee wrote:
> > Its better to use memdup_user which does the same thing which this
> > code has implemented.
> > 
> > Suggested-by: Fengguang Wu <fengguang...@intel.com>
> > Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
> > ---
> >  drivers/staging/i4l/icn/icn.c | 16 +---
> >  1 file changed, 5 insertions(+), 11 deletions(-)
> > 
> > diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c
> > index b2f4055..5312675 100644
> > --- a/drivers/staging/i4l/icn/icn.c
> > +++ b/drivers/staging/i4l/icn/icn.c
> > @@ -804,21 +804,16 @@ static int
> >  icn_loadboot(u_char __user *buffer, icn_card *card)
> >  {
> > int ret;
> > -   u_char *codebuf;
> > +   void *codebuf;
> 
> why did you change the type here?

type was changed as codebuf is only used with memdup_user() and
memcpy_toio() and both of them takes void. I should have mentioned
that in the commit message. Sending v2 with this change and after
removing the warning.

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


[PATCH] staging: i4l: icn: use memdup_user

2016-08-23 Thread Sudip Mukherjee
Its better to use memdup_user which does the same thing which this
code has implemented.

Suggested-by: Fengguang Wu <fengguang...@intel.com>
Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/i4l/icn/icn.c | 16 +---
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c
index b2f4055..5312675 100644
--- a/drivers/staging/i4l/icn/icn.c
+++ b/drivers/staging/i4l/icn/icn.c
@@ -804,21 +804,16 @@ static int
 icn_loadboot(u_char __user *buffer, icn_card *card)
 {
int ret;
-   u_char *codebuf;
+   void *codebuf;
unsigned long flags;
 
 #ifdef BOOT_DEBUG
printk(KERN_DEBUG "icn_loadboot called, buffaddr=%08lx\n", (ulong) 
buffer);
 #endif
-   codebuf = kmalloc(ICN_CODE_STAGE1, GFP_KERNEL);
-   if (!codebuf) {
-   printk(KERN_WARNING "icn: Could not allocate code buffer\n");
-   ret = -ENOMEM;
-   goto out;
-   }
-   if (copy_from_user(codebuf, buffer, ICN_CODE_STAGE1)) {
-   ret = -EFAULT;
-   goto out_kfree;
+   codebuf = memdup_user(buffer, ICN_CODE_STAGE1);
+   if (IS_ERR(codebuf)) {
+   pr_warn("icn: Could not allocate code buffer\n");
+   return PTR_ERR(codebuf);
}
if (!card->rvalid) {
if (!request_region(card->port, ICN_PORTLEN, card->regname)) {
@@ -902,7 +897,6 @@ icn_loadboot(u_char __user *buffer, icn_card *card)
 
 out_kfree:
kfree(codebuf);
-out:
return ret;
 }
 
-- 
1.9.1

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


Re: [PATCH resend] staging:xgifb:remove unused code

2016-08-23 Thread Sudip Mukherjee
On Tue, Aug 23, 2016 at 05:17:30PM +0800, Ding Xiang wrote:
> The variable data is assigned but never used in rest code.
> 
> Signed-off-by: Ding Xiang 
> ---

The subject should have been [Patch v2] not resend.

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


Re: [PATCH] staging:xgifb:remove unused code

2016-08-23 Thread Sudip Mukherjee
On Tue, Aug 23, 2016 at 03:26:50PM +0800, dingxiang wrote:
> The variable data is assigned but never used in rest code.
> 
> Signed-off-by: Ding Xiang 
> ---

Your name in Signed-off-by: and From: doesnot match.

>  drivers/staging/xgifb/vb_setmode.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/staging/xgifb/vb_setmode.c 
> b/drivers/staging/xgifb/vb_setmode.c
> index 50c8ea4..71bb9ca 100644
> --- a/drivers/staging/xgifb/vb_setmode.c
> +++ b/drivers/staging/xgifb/vb_setmode.c
> @@ -727,7 +727,6 @@ static void XGI_SetCRT1DE(unsigned short ModeIdIndex,
>   tempax |= 0x40;
>   xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x42, tempax);
> - data = xgifb_reg_get(pVBInfo->P3d4, 0x07);
>   tempax = 0;
>   if (tempbx & 0x04)

The patch will not apply. Its missing two blank lines which the original
code has.

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


Re: [PATCH] staging: i4l: icn: fix memdup_user.cocci warnings

2016-08-23 Thread Sudip Mukherjee
On Mon, Aug 22, 2016 at 09:19:36PM -0400, Greg Kroah-Hartman wrote:
> On Tue, Aug 23, 2016 at 08:36:58AM +0800, kbuild test robot wrote:
> > drivers/staging/i4l/icn/icn.c:813:11-18: WARNING opportunity for memdup_user
> > 
> >  Use memdup_user rather than duplicating its implementation
> >  This is a little bit restricted to reduce false positives
> > 
> > Generated by: scripts/coccinelle/api/memdup_user.cocci
> > 
> > CC: Sudip Mukherjee <sudipm.mukher...@gmail.com>
> > Signed-off-by: Fengguang Wu <fengguang...@intel.com>
> > ---
> > 

> 
> There's no patch here, did something go wrong?

No problem. I will make the patch for memdup_user and send today.

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


Re: [PATCH] staging: rts5208: rtsx.c: Fix checkpatch warnings.

2016-08-23 Thread Sudip Mukherjee
On Tue, Aug 23, 2016 at 08:19:46AM +0800, Ming-Chia Chung wrote:
> On Mon, Aug 22, 2016 at 10:51:27PM +0530, Sudip Mukherjee wrote:
> > On Tue, Aug 23, 2016 at 12:54:17AM +0800, MingChia Chung wrote:
> > >   This patch fixes a minor checkpatch warnings:
> > > 
> > >   "WARNING: Block comments use a trailing */ on a separate line"
> > > 
> > >   Signed-off-by: Ming-Chia Chung <quex...@gmail.com>
> > > ---
> > >  drivers/staging/rts5208/rtsx.c | 42 
> > > --
> > >  1 file changed, 28 insertions(+), 14 deletions(-)
> > > 
> > > diff --git a/drivers/staging/rts5208/rtsx.c 
> > > b/drivers/staging/rts5208/rtsx.c
> > > index e992e03..a880411 100644
> > > --- a/drivers/staging/rts5208/rtsx.c
> > > +++ b/drivers/staging/rts5208/rtsx.c
> > > @@ -81,14 +81,16 @@ static int slave_alloc(struct scsi_device *sdev)
> > >  
> > >  static int slave_configure(struct scsi_device *sdev)
> > >  {
> > > - /* Scatter-gather buffers (all but the last) must have a length
> > > + /*
> > > +   * Scatter-gather buffers (all but the last) must have a length
> > 
> > The alignment doesnot look correct here. Also in some more places later
> > in this patch.
> > 
> > regards
> > Sudip
> 
> I sent this patch by following docs ([1] and [2]). The style for long
> comments needs the begining and ending almost-blank lines. There is no
> the begining almost-blank line only for the files in net/ and
> drivers/net/.
> Please let me know what I misunderstood.

After applying the patch the file was like:
/*
   * Scatter-gather buffers (all but the last) must have a length
 * divisible by the bulk maxpacket size.  Otherwise a data packet
 * would end up being short, causing a premature end to the data
 * transfer.  Since high-speed bulk pipes have a maxpacket size

See the alignment of the second line. Please use tab instead of space. And also
checkpatch should have warned you not to use space before the Signed-off-by.

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


Re: [PATCH] staging: rts5208: rtsx.c: Fix checkpatch warnings.

2016-08-22 Thread Sudip Mukherjee
On Tue, Aug 23, 2016 at 12:54:17AM +0800, MingChia Chung wrote:
>   This patch fixes a minor checkpatch warnings:
> 
>   "WARNING: Block comments use a trailing */ on a separate line"
> 
>   Signed-off-by: Ming-Chia Chung 
> ---
>  drivers/staging/rts5208/rtsx.c | 42 
> --
>  1 file changed, 28 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c
> index e992e03..a880411 100644
> --- a/drivers/staging/rts5208/rtsx.c
> +++ b/drivers/staging/rts5208/rtsx.c
> @@ -81,14 +81,16 @@ static int slave_alloc(struct scsi_device *sdev)
>  
>  static int slave_configure(struct scsi_device *sdev)
>  {
> - /* Scatter-gather buffers (all but the last) must have a length
> + /*
> +   * Scatter-gather buffers (all but the last) must have a length

The alignment doesnot look correct here. Also in some more places later
in this patch.

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


[PATCH 5/5] staging: i4l: icn: fix incorrect type of arguments

2016-08-22 Thread Sudip Mukherjee
sparse was warning about incorrect type of argument:

drivers/staging/i4l/icn/icn.c:1048:49:
warning: incorrect type in argument 2 (different address spaces)
drivers/staging/i4l/icn/icn.c:1048:49:
expected void const [noderef] *from
drivers/staging/i4l/icn/icn.c:1048:49:
got unsigned char const [usertype] *buf
drivers/staging/i4l/icn/icn.c:1476:38:
warning: incorrect type in argument 1 (different address spaces)
drivers/staging/i4l/icn/icn.c:1476:38:
expected unsigned char const [usertype] *buf
drivers/staging/i4l/icn/icn.c:1476:38:
got unsigned char const [noderef] [usertype] *buf

The function icn_writecmd() was used to copy from userspace and also
from the kernelspace. Add another argument to the function to have two
separate pointers, one for the userspace and one for the kernelspace.
Based on the value of user as passed from the caller we use one of
the two pointers.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/i4l/icn/icn.c | 35 +--
 1 file changed, 21 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c
index 45623fa..fa705db 100644
--- a/drivers/staging/i4l/icn/icn.c
+++ b/drivers/staging/i4l/icn/icn.c
@@ -1022,7 +1022,8 @@ icn_readstatus(u_char __user *buf, int len, icn_card 
*card)
 
 /* Put command-strings into the command-queue of the Interface */
 static int
-icn_writecmd(const u_char *buf, int len, int user, icn_card *card)
+icn_writecmd(const u_char __user *ubuf, const u_char *kbuf, int len,
+int user, icn_card *card)
 {
int mch = card->secondhalf ? 2 : 0;
int pp;
@@ -1045,10 +1046,10 @@ icn_writecmd(const u_char *buf, int len, int user, 
icn_card *card)
if (count > len)
count = len;
if (user) {
-   if (copy_from_user(msg, buf, count))
+   if (copy_from_user(msg, ubuf, count))
return -EFAULT;
} else
-   memcpy(msg, buf, count);
+   memcpy(msg, kbuf, count);
 
spin_lock_irqsave(, flags);
lastmap_card = dev.mcard;
@@ -1274,7 +1275,9 @@ icn_command(isdn_ctrl *c, icn_card *card)
msleep_interruptible(ICN_BOOT_TIMEOUT1);
sprintf(cbuf, 
"00;FV2ON\n01;EAZ%c\n02;EAZ%c\n",
(a & 1) ? '1' : 'C', (a & 2) ? 
'2' : 'C');
-   i = icn_writecmd(cbuf, strlen(cbuf), 0, 
card);
+   i = icn_writecmd(NULL, cbuf,
+strlen(cbuf),
+0, card);
printk(KERN_INFO
   "icn: (%s) Leased-line mode 
enabled\n",
   CID);
@@ -1287,7 +1290,9 @@ icn_command(isdn_ctrl *c, icn_card *card)
if (card->leased) {
card->leased = 0;
sprintf(cbuf, "00;FV2OFF\n");
-   i = icn_writecmd(cbuf, strlen(cbuf), 0, 
card);
+   i = icn_writecmd(NULL, cbuf,
+strlen(cbuf),
+0, card);
printk(KERN_INFO
   "icn: (%s) Leased-line mode 
disabled\n",
   CID);
@@ -1324,7 +1329,7 @@ icn_command(isdn_ctrl *c, icn_card *card)
 "%02d;D%s_R%s,%02d,%02d,%s\n", (int)(a + 1),
 dcode, p, c->parm.setup.si1,
 c->parm.setup.si2, c->parm.setup.eazmsn);
-   i = icn_writecmd(cbuf, strlen(cbuf), 0, card);
+   i = icn_writecmd(NULL, cbuf, strlen(cbuf), 0, card);
}
break;
case ISDN_CMD_ACCEPTD:
@@ -1341,10 +1346,12 @@ icn_command(isdn_ctrl *c, icn_card *card)
sprintf(cbuf, "%02d;BTRA\n", (int)a);
break;
}
-   i = icn_writecmd(cbuf, strlen(cbuf), 0, card);
+   i = icn_writecmd(NULL, cbuf,
+strlen(cbuf), 0,
+card);
}
sprintf(cbuf, "%02d;DCON_R\n", (int)a);
-   i

[PATCH 4/5] staging: i4l: icn: remove blank lines

2016-08-22 Thread Sudip Mukherjee
Blank lines are not needed after starting brace or before a closing
brace.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/i4l/icn/icn.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c
index 1f72884..45623fa 100644
--- a/drivers/staging/i4l/icn/icn.c
+++ b/drivers/staging/i4l/icn/icn.c
@@ -82,7 +82,6 @@ icn_shiftout(unsigned short port,
 int firstbit,
 int bitcount)
 {
-
register u_char s;
register u_char c;
 
@@ -475,7 +474,6 @@ icn_parse_status(u_char *status, int channel, icn_card 
*card)
 
if (card->flags &
((channel) ? ICN_FLAGS_B2ACTIVE : ICN_FLAGS_B1ACTIVE)) {
-
isdn_ctrl ncmd;
 
card->flags &= ~((channel) ?
@@ -661,7 +659,6 @@ icn_polldchan(unsigned long data)
vstr[3] = '\0';
card->fw_rev = 
(int)simple_strtoul(vstr, NULL, 10);
continue;
-
}
}
} else {
-- 
1.9.1

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


[PATCH 3/5] staging: i4l: icn: space not needed after cast

2016-08-22 Thread Sudip Mukherjee
No need provide a space after a typecast.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/i4l/icn/icn.c | 66 +--
 1 file changed, 33 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c
index b2f4055..1f72884 100644
--- a/drivers/staging/i4l/icn/icn.c
+++ b/drivers/staging/i4l/icn/icn.c
@@ -87,7 +87,7 @@ icn_shiftout(unsigned short port,
register u_char c;
 
for (s = firstbit, c = bitcount; c > 0; s--, c--)
-   OUTB_P((u_char) ((val >> s) & 1) ? 0xff : 0, port);
+   OUTB_P((u_char)((val >> s) & 1) ? 0xff : 0, port);
 }
 
 /*
@@ -385,7 +385,7 @@ icn_pollbchan_send(int channel, icn_card *card)
 static void
 icn_pollbchan(unsigned long data)
 {
-   icn_card *card = (icn_card *) data;
+   icn_card *card = (icn_card *)data;
unsigned long flags;
 
if (card->flags & ICN_FLAGS_B1ACTIVE) {
@@ -547,7 +547,7 @@ icn_parse_status(u_char *status, int channel, icn_card 
*card)
break;
case 6:
snprintf(cmd.parm.num, sizeof(cmd.parm.num), "%d",
-(int) simple_strtoul(status + 7, NULL, 16));
+(int)simple_strtoul(status + 7, NULL, 16));
break;
case 7:
status += 3;
@@ -607,7 +607,7 @@ icn_putmsg(icn_card *card, unsigned char c)
 static void
 icn_polldchan(unsigned long data)
 {
-   icn_card *card = (icn_card *) data;
+   icn_card *card = (icn_card *)data;
int mch = card->secondhalf ? 2 : 0;
int avail = 0;
int left;
@@ -659,7 +659,7 @@ icn_polldchan(unsigned long data)
*q = '\0';
strcat(vstr, "000");
vstr[3] = '\0';
-   card->fw_rev = (int) 
simple_strtoul(vstr, NULL, 10);
+   card->fw_rev = 
(int)simple_strtoul(vstr, NULL, 10);
continue;
 
}
@@ -686,7 +686,7 @@ icn_polldchan(unsigned long data)
card->flags |= ICN_FLAGS_RBTIMER;
del_timer(>rb_timer);
card->rb_timer.function = icn_pollbchan;
-   card->rb_timer.data = (unsigned long) card;
+   card->rb_timer.data = (unsigned long)card;
card->rb_timer.expires = jiffies + ICN_TIMER_BCREAD;
add_timer(>rb_timer);
}
@@ -808,7 +808,7 @@ icn_loadboot(u_char __user *buffer, icn_card *card)
unsigned long flags;
 
 #ifdef BOOT_DEBUG
-   printk(KERN_DEBUG "icn_loadboot called, buffaddr=%08lx\n", (ulong) 
buffer);
+   printk(KERN_DEBUG "icn_loadboot called, buffaddr=%08lx\n", 
(ulong)buffer);
 #endif
codebuf = kmalloc(ICN_CODE_STAGE1, GFP_KERNEL);
if (!codebuf) {
@@ -1193,28 +1193,28 @@ icn_command(isdn_ctrl *c, icn_card *card)
}
break;
case ICN_IOCTL_GETMMIO:
-   return (long) dev.memaddr;
+   return (long)dev.memaddr;
case ICN_IOCTL_SETPORT:
if (a == 0x300 || a == 0x310 || a == 0x320 || a == 0x330
|| a == 0x340 || a == 0x350 || a == 0x360 ||
a == 0x308 || a == 0x318 || a == 0x328 || a == 0x338
|| a == 0x348 || a == 0x358 || a == 0x368) {
-   if (card->port != (unsigned short) a) {
-   if (!request_region((unsigned short) a, 
ICN_PORTLEN, "icn-isdn")) {
+   if (card->port != (unsigned short)a) {
+   if (!request_region((unsigned short)a, 
ICN_PORTLEN, "icn-isdn")) {
printk(KERN_WARNING
   "icn: (%s) ports 
0x%03x-0x%03x in use.\n",
-  CID, (int) a, (int) a + 
ICN_PORTLEN);
+  CID, (int)a, (int)a + 
ICN_PORTLEN);
return -EINVAL;
}
-   release_region((unsigned short) a, 
ICN_PORTLEN);
+   release_region((unsigned short)a, 
ICN_PORTLEN);
icn_stopcard(card);
spin_lock_irqsave(>lock, flags);

[PATCH 2/5] staging: i4l: act2000: remove unused macro

2016-08-22 Thread Sudip Mukherjee
The macro EVAL_PLCI and MAKE_PLCI are not being used. Remove them.
But keep the comment preceding them as it contains information
regarding message format.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/i4l/act2000/capi.h | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/i4l/act2000/capi.h 
b/drivers/staging/i4l/act2000/capi.h
index 7d0f52d..34884a5 100644
--- a/drivers/staging/i4l/act2000/capi.h
+++ b/drivers/staging/i4l/act2000/capi.h
@@ -127,13 +127,6 @@ typedef struct actcapi_ncpd {
  * Bit 5-7  = Controller
  * Bit 8-15 = reserved (must be 0)
  */
-#define MAKE_PLCI(plci, contr) \
-   ((plci & 0x1f) | ((contr & 0x7) << 5))
-
-#define EVAL_PLCI(fakeplci, plci, contr) { \
-   plci  = fakeplci & 0x1f;\
-   contr = (fakeplci >> 5) & 0x7;  \
-   }
 
 typedef struct actcapi_msg {
actcapi_msghdr hdr;
-- 
1.9.1

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


[PATCH 1/5] staging: i4l: act2000: remove unused argument

2016-08-22 Thread Sudip Mukherjee
The macro EVAL_NCCI was only being used in capi.c and the argument
controller was not used. Remove the argument and at the same time
remove the variable which now becomes unused.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/i4l/act2000/capi.c | 3 +--
 drivers/staging/i4l/act2000/capi.h | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/i4l/act2000/capi.c 
b/drivers/staging/i4l/act2000/capi.c
index 3f66ca2..41b4d19 100644
--- a/drivers/staging/i4l/act2000/capi.c
+++ b/drivers/staging/i4l/act2000/capi.c
@@ -547,12 +547,11 @@ static int
 actcapi_data_b3_ind(act2000_card *card, struct sk_buff *skb) {
__u16 plci;
__u16 ncci;
-   __u16 controller;
__u8  blocknr;
int chan;
actcapi_msg *msg = (actcapi_msg *)skb->data;
 
-   EVAL_NCCI(msg->msg.data_b3_ind.fakencci, plci, controller, ncci);
+   EVAL_NCCI(msg->msg.data_b3_ind.fakencci, plci, ncci);
chan = find_ncci(card, ncci);
if (chan < 0)
return 0;
diff --git a/drivers/staging/i4l/act2000/capi.h 
b/drivers/staging/i4l/act2000/capi.h
index 01ccdec..7d0f52d 100644
--- a/drivers/staging/i4l/act2000/capi.h
+++ b/drivers/staging/i4l/act2000/capi.h
@@ -114,9 +114,8 @@ typedef struct actcapi_ncpd {
 #define MAKE_NCCI(plci, contr, ncci)   \
((plci & 0x1f) | ((contr & 0x7) << 5) | ((ncci & 0xff) << 8))
 
-#define EVAL_NCCI(fakencci, plci, contr, ncci) {   \
+#define EVAL_NCCI(fakencci, plci, ncci) {  \
plci  = fakencci & 0x1f;\
-   contr = (fakencci >> 5) & 0x7;  \
ncci  = (fakencci >> 8) & 0xff; \
}
 
-- 
1.9.1

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


[PATCH 6/6 v2] staging: i4l: icn: fix incorrect type of arguments

2016-06-11 Thread Sudip Mukherjee
sparse was warning about incorrect type of argument:

drivers/staging/i4l/icn/icn.c:1048:49:
warning: incorrect type in argument 2 (different address spaces)
drivers/staging/i4l/icn/icn.c:1048:49:
expected void const [noderef] *from
drivers/staging/i4l/icn/icn.c:1048:49:
got unsigned char const [usertype] *buf
drivers/staging/i4l/icn/icn.c:1476:38:
warning: incorrect type in argument 1 (different address spaces)
drivers/staging/i4l/icn/icn.c:1476:38:
expected unsigned char const [usertype] *buf
drivers/staging/i4l/icn/icn.c:1476:38:
got unsigned char const [noderef] [usertype] *buf

The function icn_writecmd() was used to copy from userspace and also
from the kernelspace. Add another argument to the function to have two
separate pointers, one for the userspace and one for the kernelspace.
Based on the value of user as passed from the caller we use one of
the two pointers.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---

Wrong Signed-off in v1.

 drivers/staging/i4l/icn/icn.c | 35 +--
 1 file changed, 21 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c
index 6991259..5e3821b 100644
--- a/drivers/staging/i4l/icn/icn.c
+++ b/drivers/staging/i4l/icn/icn.c
@@ -1023,7 +1023,8 @@ icn_readstatus(u_char __user *buf, int len, icn_card 
*card)
 
 /* Put command-strings into the command-queue of the Interface */
 static int
-icn_writecmd(const u_char *buf, int len, int user, icn_card *card)
+icn_writecmd(const u_char __user *ubuf, const u_char *kbuf, int len,
+int user, icn_card *card)
 {
int mch = card->secondhalf ? 2 : 0;
int pp;
@@ -1046,10 +1047,10 @@ icn_writecmd(const u_char *buf, int len, int user, 
icn_card *card)
if (count > len)
count = len;
if (user) {
-   if (copy_from_user(msg, buf, count))
+   if (copy_from_user(msg, ubuf, count))
return -EFAULT;
} else
-   memcpy(msg, buf, count);
+   memcpy(msg, kbuf, count);
 
spin_lock_irqsave(, flags);
lastmap_card = dev.mcard;
@@ -1275,7 +1276,9 @@ icn_command(isdn_ctrl *c, icn_card *card)
msleep_interruptible(ICN_BOOT_TIMEOUT1);
sprintf(cbuf, 
"00;FV2ON\n01;EAZ%c\n02;EAZ%c\n",
(a & 1) ? '1' : 'C', (a & 2) ? 
'2' : 'C');
-   i = icn_writecmd(cbuf, strlen(cbuf), 0, 
card);
+   i = icn_writecmd(NULL, cbuf,
+strlen(cbuf),
+0, card);
printk(KERN_INFO
   "icn: (%s) Leased-line mode 
enabled\n",
   CID);
@@ -1288,7 +1291,9 @@ icn_command(isdn_ctrl *c, icn_card *card)
if (card->leased) {
card->leased = 0;
sprintf(cbuf, "00;FV2OFF\n");
-   i = icn_writecmd(cbuf, strlen(cbuf), 0, 
card);
+   i = icn_writecmd(NULL, cbuf,
+strlen(cbuf),
+0, card);
printk(KERN_INFO
   "icn: (%s) Leased-line mode 
disabled\n",
   CID);
@@ -1325,7 +1330,7 @@ icn_command(isdn_ctrl *c, icn_card *card)
 "%02d;D%s_R%s,%02d,%02d,%s\n", (int)(a + 1),
 dcode, p, c->parm.setup.si1,
 c->parm.setup.si2, c->parm.setup.eazmsn);
-   i = icn_writecmd(cbuf, strlen(cbuf), 0, card);
+   i = icn_writecmd(NULL, cbuf, strlen(cbuf), 0, card);
}
break;
case ISDN_CMD_ACCEPTD:
@@ -1342,10 +1347,12 @@ icn_command(isdn_ctrl *c, icn_card *card)
sprintf(cbuf, "%02d;BTRA\n", (int)a);
break;
}
-   i = icn_writecmd(cbuf, strlen(cbuf), 0, card);
+   i = icn_writecmd(NULL, cbuf,
+strlen(cbuf), 0,
+card);
}
sprintf(cbuf, "%02d;DCON_R\n", 

[PATCH 5/6] staging: i4l: icn: remove blank lines

2016-06-11 Thread Sudip Mukherjee
Blank lines are not needed after starting brace or before a closing
brace.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/i4l/icn/icn.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c
index ff0fb6c6..6991259 100644
--- a/drivers/staging/i4l/icn/icn.c
+++ b/drivers/staging/i4l/icn/icn.c
@@ -82,7 +82,6 @@ icn_shiftout(unsigned short port,
 int firstbit,
 int bitcount)
 {
-
register u_char s;
register u_char c;
 
@@ -475,7 +474,6 @@ icn_parse_status(u_char *status, int channel, icn_card 
*card)
 
if (card->flags &
((channel) ? ICN_FLAGS_B2ACTIVE : ICN_FLAGS_B1ACTIVE)) {
-
isdn_ctrl ncmd;
 
card->flags &= ~((channel) ?
@@ -661,7 +659,6 @@ icn_polldchan(unsigned long data)
vstr[3] = '\0';
card->fw_rev = 
(int)simple_strtoul(vstr, NULL, 10);
continue;
-
}
}
} else {
-- 
1.9.1

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


[PATCH 3/6] staging: i4l: icn: space not needed after cast

2016-06-11 Thread Sudip Mukherjee
No need provide a space after a typecast.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/i4l/icn/icn.c | 70 +--
 1 file changed, 35 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c
index c92f9cdf..abc6599 100644
--- a/drivers/staging/i4l/icn/icn.c
+++ b/drivers/staging/i4l/icn/icn.c
@@ -87,7 +87,7 @@ icn_shiftout(unsigned short port,
register u_char c;
 
for (s = firstbit, c = bitcount; c > 0; s--, c--)
-   OUTB_P((u_char) ((val >> s) & 1) ? 0xff : 0, port);
+   OUTB_P((u_char)((val >> s) & 1) ? 0xff : 0, port);
 }
 
 /*
@@ -385,7 +385,7 @@ icn_pollbchan_send(int channel, icn_card *card)
 static void
 icn_pollbchan(unsigned long data)
 {
-   icn_card *card = (icn_card *) data;
+   icn_card *card = (icn_card *)data;
unsigned long flags;
 
if (card->flags & ICN_FLAGS_B1ACTIVE) {
@@ -547,7 +547,7 @@ icn_parse_status(u_char *status, int channel, icn_card 
*card)
break;
case 6:
snprintf(cmd.parm.num, sizeof(cmd.parm.num), "%d",
-(int) simple_strtoul(status + 7, NULL, 16));
+(int)simple_strtoul(status + 7, NULL, 16));
break;
case 7:
status += 3;
@@ -607,7 +607,7 @@ icn_putmsg(icn_card *card, unsigned char c)
 static void
 icn_polldchan(unsigned long data)
 {
-   icn_card *card = (icn_card *) data;
+   icn_card *card = (icn_card *)data;
int mch = card->secondhalf ? 2 : 0;
int avail = 0;
int left;
@@ -659,7 +659,7 @@ icn_polldchan(unsigned long data)
*q = '\0';
strcat(vstr, "000");
vstr[3] = '\0';
-   card->fw_rev = (int) 
simple_strtoul(vstr, NULL, 10);
+   card->fw_rev = 
(int)simple_strtoul(vstr, NULL, 10);
continue;
 
}
@@ -686,7 +686,7 @@ icn_polldchan(unsigned long data)
card->flags |= ICN_FLAGS_RBTIMER;
del_timer(>rb_timer);
card->rb_timer.function = icn_pollbchan;
-   card->rb_timer.data = (unsigned long) card;
+   card->rb_timer.data = (unsigned long)card;
card->rb_timer.expires = jiffies + ICN_TIMER_BCREAD;
add_timer(>rb_timer);
}
@@ -808,7 +808,7 @@ icn_loadboot(u_char __user *buffer, icn_card *card)
unsigned long flags;
 
 #ifdef BOOT_DEBUG
-   printk(KERN_DEBUG "icn_loadboot called, buffaddr=%08lx\n", (ulong) 
buffer);
+   printk(KERN_DEBUG "icn_loadboot called, buffaddr=%08lx\n", 
(ulong)buffer);
 #endif
codebuf = kmalloc(ICN_CODE_STAGE1, GFP_KERNEL);
if (!codebuf) {
@@ -988,14 +988,14 @@ icn_loadproto(u_char __user *buffer, icn_card *card)
init_timer(>st_timer);
card->st_timer.expires = jiffies + 
ICN_TIMER_DCREAD;
card->st_timer.function = icn_polldchan;
-   card->st_timer.data = (unsigned long) card;
+   card->st_timer.data = (unsigned long)card;
add_timer(>st_timer);
card->flags |= ICN_FLAGS_RUNNING;
if (card->doubleS0) {
init_timer(>other->st_timer);
card->other->st_timer.expires = jiffies 
+ ICN_TIMER_DCREAD;
card->other->st_timer.function = 
icn_polldchan;
-   card->other->st_timer.data = (unsigned 
long) card->other;
+   card->other->st_timer.data = (unsigned 
long)card->other;
add_timer(>other->st_timer);
card->other->flags |= ICN_FLAGS_RUNNING;
}
@@ -1195,28 +1195,28 @@ icn_command(isdn_ctrl *c, icn_card *card)
}
break;
case ICN_IOCTL_GETMMIO:
-   return (long) dev.memaddr;
+   return (long)dev.memaddr;
case ICN_IOCTL_SETPORT:
if (a == 0x300 || a == 0x310 || a == 0x320 || a == 0x330
|| a == 0x340 || 

[PATCH 2/6] staging: i4l: icn: donot assign in if statement

2016-06-11 Thread Sudip Mukherjee
It is not the kernel coding style to make assignments in the if
statement and checkpatch was warning us about it.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/i4l/icn/icn.c | 33 ++---
 1 file changed, 22 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c
index c5dd572..c92f9cdf 100644
--- a/drivers/staging/i4l/icn/icn.c
+++ b/drivers/staging/i4l/icn/icn.c
@@ -62,7 +62,8 @@ icn_free_queue(icn_card *card, int channel)
skb_queue_purge(queue);
card->xlen[channel] = 0;
card->sndcount[channel] = 0;
-   if ((skb = card->xskb[channel])) {
+   skb = card->xskb[channel];
+   if (skb) {
card->xskb[channel] = NULL;
dev_kfree_skb(skb);
}
@@ -272,8 +273,10 @@ icn_pollbchan_receive(int channel, icn_card *card)
rbnext;
icn_maprelease_channel(card, mch & 2);
if (!eflag) {
-   if ((cnt = card->rcvidx[channel])) {
-   if (!(skb = dev_alloc_skb(cnt))) {
+   cnt = card->rcvidx[channel];
+   if (cnt) {
+   skb = dev_alloc_skb(cnt);
+   if (!skb) {
printk(KERN_WARNING "icn: 
receive out of memory\n");
break;
}
@@ -807,7 +810,8 @@ icn_loadboot(u_char __user *buffer, icn_card *card)
 #ifdef BOOT_DEBUG
printk(KERN_DEBUG "icn_loadboot called, buffaddr=%08lx\n", (ulong) 
buffer);
 #endif
-   if (!(codebuf = kmalloc(ICN_CODE_STAGE1, GFP_KERNEL))) {
+   codebuf = kmalloc(ICN_CODE_STAGE1, GFP_KERNEL);
+   if (!codebuf) {
printk(KERN_WARNING "icn: Could not allocate code buffer\n");
ret = -ENOMEM;
goto out;
@@ -878,7 +882,8 @@ icn_loadboot(u_char __user *buffer, icn_card *card)
}
SLEEP(1);
OUTB_P(0xff, ICN_RUN);  /* Start Boot-Code */
-   if ((ret = icn_check_loader(card->doubleS0 ? 2 : 1))) {
+   ret = icn_check_loader(card->doubleS0 ? 2 : 1);
+   if (ret) {
goto out_kfree;
}
if (!card->doubleS0) {
@@ -1249,7 +1254,8 @@ icn_command(isdn_ctrl *c, icn_card *card)
return icn_loadboot(arg, card);
case ICN_IOCTL_LOADPROTO:
icn_stopcard(card);
-   if ((i = (icn_loadproto(arg, card
+   i = (icn_loadproto(arg, card));
+   if (i)
return i;
if (card->doubleS0)
i = icn_loadproto(arg + ICN_CODE_STAGE2, 
card->other);
@@ -1520,7 +1526,8 @@ icn_initcard(int port, char *id)
icn_card *card;
int i;
 
-   if (!(card = kzalloc(sizeof(icn_card), GFP_KERNEL))) {
+   card = kzalloc(sizeof(icn_card), GFP_KERNEL);
+   if (!card) {
printk(KERN_WARNING
   "icn: (%s) Could not allocate card-struct.\n", id);
return (icn_card *) 0;
@@ -1568,7 +1575,8 @@ icn_addcard(int port, char *id1, char *id2)
icn_card *card;
icn_card *card2;
 
-   if (!(card = icn_initcard(port, id1))) {
+   card = icn_initcard(port, id1);
+   if (!card) {
return -EIO;
}
if (!strlen(id2)) {
@@ -1577,7 +1585,8 @@ icn_addcard(int port, char *id1, char *id2)
   card->interface.id, port);
return 0;
}
-   if (!(card2 = icn_initcard(port, id2))) {
+   card2 = icn_initcard(port, id2);
+   if (!card2) {
printk(KERN_INFO
   "icn: (%s) half ICN-4B, port 0x%x added\n", id2, port);
return 0;
@@ -1611,7 +1620,8 @@ icn_setup(char *line)
if (str && *str) {
strlcpy(sid, str, sizeof(sid));
icn_id = sid;
-   if ((p = strchr(sid, ','))) {
+   p = strchr(sid, ',');
+   if (p) {
*p++ = 0;
strcpy(sid2, p);
icn_id2 = sid2;
@@ -1634,7 +1644,8 @@ static int __init icn_init(void)
dev.firstload = 1;
spin_lock_init();
 
-   if ((p = strchr(revision, ':'))) {
+   p = strchr(revision, ':');
+   if (p) {
strncpy(rev, p + 1, 20);
rev[20] = '\0';
p = strchr(rev, '$');
-- 
1.9.1

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


[PATCH 6/6] staging: i4l: icn: fix incorrect type of arguments

2016-06-11 Thread Sudip Mukherjee
sparse was warning about incorrect type of argument:

drivers/staging/i4l/icn/icn.c:1048:49:
warning: incorrect type in argument 2 (different address spaces)
drivers/staging/i4l/icn/icn.c:1048:49:
expected void const [noderef] *from
drivers/staging/i4l/icn/icn.c:1048:49:
got unsigned char const [usertype] *buf
drivers/staging/i4l/icn/icn.c:1476:38:
warning: incorrect type in argument 1 (different address spaces)
drivers/staging/i4l/icn/icn.c:1476:38:
expected unsigned char const [usertype] *buf
drivers/staging/i4l/icn/icn.c:1476:38:
got unsigned char const [noderef] [usertype] *buf

The function icn_writecmd() was used to copy from userspace and also
from the kernelspace. Add another argument to the function to have two
separate pointers, one for the userspace and one for the kernelspace.
Based on the value of user as passed from the caller we use one of
the two pointers.

Signed-off-by: Sudip Mukherjee <sudipm.mukher...@gmail.com>
---
 drivers/staging/i4l/icn/icn.c | 35 +--
 1 file changed, 21 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c
index 6991259..5e3821b 100644
--- a/drivers/staging/i4l/icn/icn.c
+++ b/drivers/staging/i4l/icn/icn.c
@@ -1023,7 +1023,8 @@ icn_readstatus(u_char __user *buf, int len, icn_card 
*card)
 
 /* Put command-strings into the command-queue of the Interface */
 static int
-icn_writecmd(const u_char *buf, int len, int user, icn_card *card)
+icn_writecmd(const u_char __user *ubuf, const u_char *kbuf, int len,
+int user, icn_card *card)
 {
int mch = card->secondhalf ? 2 : 0;
int pp;
@@ -1046,10 +1047,10 @@ icn_writecmd(const u_char *buf, int len, int user, 
icn_card *card)
if (count > len)
count = len;
if (user) {
-   if (copy_from_user(msg, buf, count))
+   if (copy_from_user(msg, ubuf, count))
return -EFAULT;
} else
-   memcpy(msg, buf, count);
+   memcpy(msg, kbuf, count);
 
spin_lock_irqsave(, flags);
lastmap_card = dev.mcard;
@@ -1275,7 +1276,9 @@ icn_command(isdn_ctrl *c, icn_card *card)
msleep_interruptible(ICN_BOOT_TIMEOUT1);
sprintf(cbuf, 
"00;FV2ON\n01;EAZ%c\n02;EAZ%c\n",
(a & 1) ? '1' : 'C', (a & 2) ? 
'2' : 'C');
-   i = icn_writecmd(cbuf, strlen(cbuf), 0, 
card);
+   i = icn_writecmd(NULL, cbuf,
+strlen(cbuf),
+0, card);
printk(KERN_INFO
   "icn: (%s) Leased-line mode 
enabled\n",
   CID);
@@ -1288,7 +1291,9 @@ icn_command(isdn_ctrl *c, icn_card *card)
if (card->leased) {
card->leased = 0;
sprintf(cbuf, "00;FV2OFF\n");
-   i = icn_writecmd(cbuf, strlen(cbuf), 0, 
card);
+   i = icn_writecmd(NULL, cbuf,
+strlen(cbuf),
+0, card);
printk(KERN_INFO
   "icn: (%s) Leased-line mode 
disabled\n",
   CID);
@@ -1325,7 +1330,7 @@ icn_command(isdn_ctrl *c, icn_card *card)
 "%02d;D%s_R%s,%02d,%02d,%s\n", (int)(a + 1),
 dcode, p, c->parm.setup.si1,
 c->parm.setup.si2, c->parm.setup.eazmsn);
-   i = icn_writecmd(cbuf, strlen(cbuf), 0, card);
+   i = icn_writecmd(NULL, cbuf, strlen(cbuf), 0, card);
}
break;
case ISDN_CMD_ACCEPTD:
@@ -1342,10 +1347,12 @@ icn_command(isdn_ctrl *c, icn_card *card)
sprintf(cbuf, "%02d;BTRA\n", (int)a);
break;
}
-   i = icn_writecmd(cbuf, strlen(cbuf), 0, card);
+   i = icn_writecmd(NULL, cbuf,
+strlen(cbuf), 0,
+card);
}
sprintf(cbuf, "%02d;DCON_R\n", (int)a);
-   i = icn_wr

[PATCH 1/6] staging: i4l: icn: do not use return as a function

2016-06-11 Thread Sudip Mukherjee
return is not a function so no need to use the parenthesis.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/i4l/icn/icn.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c
index 46d957c..c5dd572 100644
--- a/drivers/staging/i4l/icn/icn.c
+++ b/drivers/staging/i4l/icn/icn.c
@@ -1246,7 +1246,7 @@ icn_command(isdn_ctrl *c, icn_card *card)
dev.firstload = 0;
}
icn_stopcard(card);
-   return (icn_loadboot(arg, card));
+   return icn_loadboot(arg, card);
case ICN_IOCTL_LOADPROTO:
icn_stopcard(card);
if ((i = (icn_loadproto(arg, card
@@ -1262,7 +1262,7 @@ icn_command(isdn_ctrl *c, icn_card *card)
   arg,
   sizeof(cdef)))
return -EFAULT;
-   return (icn_addcard(cdef.port, cdef.id1, cdef.id2));
+   return icn_addcard(cdef.port, cdef.id1, cdef.id2);
break;
case ICN_IOCTL_LEASEDCFG:
if (a) {
@@ -1458,7 +1458,7 @@ if_command(isdn_ctrl *c)
icn_card *card = icn_findcard(c->driver);
 
if (card)
-   return (icn_command(c, card));
+   return icn_command(c, card);
printk(KERN_ERR
   "icn: if_command %d called with invalid driverId %d!\n",
   c->command, c->driver);
@@ -1473,7 +1473,7 @@ if_writecmd(const u_char __user *buf, int len, int id, 
int channel)
if (card) {
if (!(card->flags & ICN_FLAGS_RUNNING))
return -ENODEV;
-   return (icn_writecmd(buf, len, 1, card));
+   return icn_writecmd(buf, len, 1, card);
}
printk(KERN_ERR
   "icn: if_writecmd called with invalid driverId!\n");
@@ -1488,7 +1488,7 @@ if_readstatus(u_char __user *buf, int len, int id, int 
channel)
if (card) {
if (!(card->flags & ICN_FLAGS_RUNNING))
return -ENODEV;
-   return (icn_readstatus(buf, len, card));
+   return icn_readstatus(buf, len, card);
}
printk(KERN_ERR
   "icn: if_readstatus called with invalid driverId!\n");
@@ -1503,7 +1503,7 @@ if_sendbuf(int id, int channel, int ack, struct sk_buff 
*skb)
if (card) {
if (!(card->flags & ICN_FLAGS_RUNNING))
return -ENODEV;
-   return (icn_sendbuf(channel, ack, skb, card));
+   return icn_sendbuf(channel, ack, skb, card);
}
printk(KERN_ERR
   "icn: if_sendbuf called with invalid driverId!\n");
@@ -1617,7 +1617,7 @@ icn_setup(char *line)
icn_id2 = sid2;
}
}
-   return (1);
+   return 1;
 }
 __setup("icn=", icn_setup);
 #endif /* MODULE */
@@ -1644,7 +1644,7 @@ static int __init icn_init(void)
strcpy(rev, " ??? ");
printk(KERN_NOTICE "ICN-ISDN-driver Rev%smem=0x%08lx\n", rev,
   dev.memaddr);
-   return (icn_addcard(portbase, icn_id, icn_id2));
+   return icn_addcard(portbase, icn_id, icn_id2);
 }
 
 static void __exit icn_exit(void)
-- 
1.9.1

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


[PATCH 4/6] staging: i4l: icn: remove braces

2016-06-11 Thread Sudip Mukherjee
Braces are not required in a single statement block.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/i4l/icn/icn.c | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c
index abc6599..ff0fb6c6 100644
--- a/drivers/staging/i4l/icn/icn.c
+++ b/drivers/staging/i4l/icn/icn.c
@@ -883,9 +883,8 @@ icn_loadboot(u_char __user *buffer, icn_card *card)
SLEEP(1);
OUTB_P(0xff, ICN_RUN);  /* Start Boot-Code */
ret = icn_check_loader(card->doubleS0 ? 2 : 1);
-   if (ret) {
+   if (ret)
goto out_kfree;
-   }
if (!card->doubleS0) {
ret = 0;
goto out_kfree;
@@ -1274,9 +1273,8 @@ icn_command(isdn_ctrl *c, icn_card *card)
if (a) {
if (!card->leased) {
card->leased = 1;
-   while (card->ptype == 
ISDN_PTYPE_UNKNOWN) {
+   while (card->ptype == 
ISDN_PTYPE_UNKNOWN)

msleep_interruptible(ICN_BOOT_TIMEOUT1);
-   }
msleep_interruptible(ICN_BOOT_TIMEOUT1);
sprintf(cbuf, 
"00;FV2ON\n01;EAZ%c\n02;EAZ%c\n",
(a & 1) ? '1' : 'C', (a & 2) ? 
'2' : 'C');
@@ -1576,9 +1574,8 @@ icn_addcard(int port, char *id1, char *id2)
icn_card *card2;
 
card = icn_initcard(port, id1);
-   if (!card) {
+   if (!card)
return -EIO;
-   }
if (!strlen(id2)) {
printk(KERN_INFO
   "icn: (%s) ICN-2B, port 0x%x added\n",
-- 
1.9.1

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


Re: [PATCH 5/5] staging: media: lirc: use new parport device model

2016-05-25 Thread Sudip Mukherjee

On Monday 25 January 2016 10:42 PM, Mauro Carvalho Chehab wrote:

Em Mon, 25 Jan 2016 22:32:31 +0530
Sudip Mukherjee <sudipm.mukher...@gmail.com> escreveu:


On Mon, Jan 25, 2016 at 02:29:06PM -0200, Mauro Carvalho Chehab wrote:

Em Fri, 18 Dec 2015 18:35:29 +0530
Sudip Mukherjee <sudipm.mukher...@gmail.com> escreveu:


Modify lirc_parallel driver to use the new parallel port device model.


Did you or someone else tested this patch?


Only build tested and tested by inserting and removing the module.
But since the only change is in the way it registers and nothing else
so it should not break.


It would be worth to wait for a while in the hope that someone could
test with a real hardware.


Hi Mauro,
Since no one has commented on the patch till now, maybe you can merge 
now, or do i need to resend?


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


[PATCH 3/4] staging: i4l: act2000: remove blank line after brace

2016-04-30 Thread Sudip Mukherjee
checkpatch complains about an extra blank line after an opening brace.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/i4l/act2000/act2000_isa.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/i4l/act2000/act2000_isa.c 
b/drivers/staging/i4l/act2000/act2000_isa.c
index 048507e..27c0046 100644
--- a/drivers/staging/i4l/act2000/act2000_isa.c
+++ b/drivers/staging/i4l/act2000/act2000_isa.c
@@ -358,7 +358,6 @@ act2000_isa_send(act2000_card *card)
 static int
 act2000_isa_getid(act2000_card *card)
 {
-
act2000_fwid fid;
u_char *p = (u_char *)
int count = 0;
-- 
1.9.1

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


[PATCH 2/4] staging: i4l: act2000: do not assign in if

2016-04-30 Thread Sudip Mukherjee
It is not the kernel coding style to assign values to some variable in
if statement. Split them up into different statements.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/i4l/act2000/act2000_isa.c | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/i4l/act2000/act2000_isa.c 
b/drivers/staging/i4l/act2000/act2000_isa.c
index 34c0a9a..048507e 100644
--- a/drivers/staging/i4l/act2000/act2000_isa.c
+++ b/drivers/staging/i4l/act2000/act2000_isa.c
@@ -31,7 +31,8 @@ act2000_isa_reset(unsigned short portbase)
int serial = 0;
 
found = 0;
-   if ((reg = inb(portbase + ISA_COR)) != 0xff) {
+   reg = inb(portbase + ISA_COR);
+   if (reg != 0xff) {
outb(reg | ISA_COR_RESET, portbase + ISA_COR);
mdelay(10);
outb(reg, portbase + ISA_COR);
@@ -303,7 +304,8 @@ act2000_isa_send(act2000_card *card)
while (1) {
spin_lock_irqsave(>lock, flags);
if (!(card->sbuf)) {
-   if ((card->sbuf = skb_dequeue(>sndq))) {
+   card->sbuf = skb_dequeue(>sndq);
+   if (card->sbuf) {
card->ack_msg = card->sbuf->data;
msg = (actcapi_msg *)card->sbuf->data;
if ((msg->hdr.cmd.cmd == 0x86) &&
@@ -378,7 +380,8 @@ act2000_isa_getid(act2000_card *card)
printk(KERN_WARNING "act2000: Wrong Firmware-ID!\n");
return -EPROTO;
}
-   if ((p = strchr(fid.revision, '\n')))
+   p = strchr(fid.revision, '\n');
+   if (p)
*p = '\0';
printk(KERN_INFO "act2000: Firmware-ID: %s\n", fid.revision);
if (card->flags & ACT2000_FLAGS_IVALID) {
-- 
1.9.1

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


[PATCH 4/4] staging: i4l: act2000: remove extra space

2016-04-30 Thread Sudip Mukherjee
It is not kernel coding style to give an extra space after a cast.
We get warned about it by checkpatch.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/i4l/act2000/act2000_isa.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/i4l/act2000/act2000_isa.c 
b/drivers/staging/i4l/act2000/act2000_isa.c
index 27c0046..f0eb844 100644
--- a/drivers/staging/i4l/act2000/act2000_isa.c
+++ b/drivers/staging/i4l/act2000/act2000_isa.c
@@ -233,7 +233,7 @@ act2000_isa_receive(act2000_card *card)
 {
u_char c;
 
-   if (test_and_set_bit(ACT2000_LOCK_RX, (void *) >ilock) != 0)
+   if (test_and_set_bit(ACT2000_LOCK_RX, (void *)>ilock) != 0)
return;
while (!act2000_isa_readb(card, )) {
if (card->idat.isa.rcvidx < 8) {
@@ -248,7 +248,7 @@ act2000_isa_receive(act2000_card *card)
card->idat.isa.rcvignore = 1;
printk(KERN_WARNING
   "act2000_isa_receive: no 
memory\n");
-   
test_and_clear_bit(ACT2000_LOCK_RX, (void *) >ilock);
+   
test_and_clear_bit(ACT2000_LOCK_RX, (void *)>ilock);
return;
}
memcpy(skb_put(card->idat.isa.rcvskb, 
8), card->idat.isa.rcvhdr, 8);
@@ -288,7 +288,7 @@ act2000_isa_receive(act2000_card *card)
 (card->idat.isa.rcvidx < card->idat.isa.rcvlen)))
act2000_schedule_poll(card);
}
-   test_and_clear_bit(ACT2000_LOCK_RX, (void *) >ilock);
+   test_and_clear_bit(ACT2000_LOCK_RX, (void *)>ilock);
 }
 
 void
@@ -299,7 +299,7 @@ act2000_isa_send(act2000_card *card)
actcapi_msg *msg;
int l;
 
-   if (test_and_set_bit(ACT2000_LOCK_TX, (void *) >ilock) != 0)
+   if (test_and_set_bit(ACT2000_LOCK_TX, (void *)>ilock) != 0)
return;
while (1) {
spin_lock_irqsave(>lock, flags);
@@ -319,7 +319,7 @@ act2000_isa_send(act2000_card *card)
spin_unlock_irqrestore(>lock, flags);
if (!(card->sbuf)) {
/* No more data to send */
-   test_and_clear_bit(ACT2000_LOCK_TX, (void *) 
>ilock);
+   test_and_clear_bit(ACT2000_LOCK_TX, (void 
*)>ilock);
return;
}
skb = card->sbuf;
@@ -327,7 +327,7 @@ act2000_isa_send(act2000_card *card)
while (skb->len) {
if (act2000_isa_writeb(card, *(skb->data))) {
/* Fifo is full, but more data to send */
-   test_and_clear_bit(ACT2000_LOCK_TX, (void *) 
>ilock);
+   test_and_clear_bit(ACT2000_LOCK_TX, (void 
*)>ilock);
/* Schedule myself */
act2000_schedule_tx(card);
return;
-- 
1.9.1

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


[PATCH 1/4] staging: i4l: act2000: fix use of return

2016-04-30 Thread Sudip Mukherjee
checkpatch warns that return is not a function and as such the brace
after it is not required.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/i4l/act2000/act2000_isa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/i4l/act2000/act2000_isa.c 
b/drivers/staging/i4l/act2000/act2000_isa.c
index b5fad29..34c0a9a 100644
--- a/drivers/staging/i4l/act2000/act2000_isa.c
+++ b/drivers/staging/i4l/act2000/act2000_isa.c
@@ -439,5 +439,5 @@ act2000_isa_download(act2000_card *card, act2000_ddef 
__user *cb)
}
kfree(buf);
msleep_interruptible(500);
-   return (act2000_isa_getid(card));
+   return act2000_isa_getid(card);
 }
-- 
1.9.1

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


[PATCH 1/2] staging: wilc1000: fix double unlock

2016-04-14 Thread Sudip Mukherjee
The semaphore was being released twice, once at the beginning of the
thread and then again when the thread is about to close.
The semaphore is acquired immediately after creating the thread so we
should be releasing it when the thread ends.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/wilc1000/linux_wlan.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index a858552..5643a3d 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -313,7 +313,6 @@ static int linux_wlan_txq_task(void *vp)
vif = netdev_priv(dev);
wl = vif->wilc;
 
-   up(>txq_thread_started);
while (1) {
down(>txq_event);
 
-- 
1.9.1

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


[PATCH 2/2] staging: wilc1000: remove unused variables

2016-04-14 Thread Sudip Mukherjee
These variables were havnig the pointer returned by wiphy_priv() but
they were never used.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/wilc1000/linux_wlan.c | 8 
 1 file changed, 8 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 5643a3d..8cc8e8d 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -865,7 +865,6 @@ int wilc_mac_open(struct net_device *ndev)
unsigned char mac_add[ETH_ALEN] = {0};
int ret = 0;
int i = 0;
-   struct wilc_priv *priv;
struct wilc *wl;
 
vif = netdev_priv(ndev);
@@ -876,7 +875,6 @@ int wilc_mac_open(struct net_device *ndev)
return -ENODEV;
}
 
-   priv = wiphy_priv(vif->ndev->ieee80211_ptr->wiphy);
netdev_dbg(ndev, "MAC OPEN[%p]\n", ndev);
 
ret = wilc_init_host_int(ndev);
@@ -953,14 +951,10 @@ static struct net_device_stats *mac_stats(struct 
net_device *dev)
 static void wilc_set_multicast_list(struct net_device *dev)
 {
struct netdev_hw_addr *ha;
-   struct wilc_priv *priv;
-   struct host_if_drv *hif_drv;
struct wilc_vif *vif;
int i = 0;
 
-   priv = wiphy_priv(dev->ieee80211_ptr->wiphy);
vif = netdev_priv(dev);
-   hif_drv = (struct host_if_drv *)priv->hif_drv;
 
if (dev->flags & IFF_PROMISC)
return;
@@ -1114,7 +1108,6 @@ static int mac_ioctl(struct net_device *ndev, struct 
ifreq *req, int cmd)
s8 rssi;
u32 size = 0, length = 0;
struct wilc_vif *vif;
-   struct wilc_priv *priv;
s32 ret = 0;
struct wilc *wilc;
 
@@ -1138,7 +1131,6 @@ static int mac_ioctl(struct net_device *ndev, struct 
ifreq *req, int cmd)
return PTR_ERR(buff);
 
if (strncasecmp(buff, "RSSI", length) == 0) {
-   priv = 
wiphy_priv(vif->ndev->ieee80211_ptr->wiphy);
ret = wilc_get_rssi(vif, );
netdev_info(ndev, "RSSI :%d\n", rssi);
 
-- 
1.9.1

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


[PATCH] staging: android: ion: dummy: fix dereference of ERR_PTR

2016-04-07 Thread Sudip Mukherjee
ion_device_create() can fail and if it fails then it returns the error
value in ERR_PTR.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/android/ion/ion_dummy_driver.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/android/ion/ion_dummy_driver.c 
b/drivers/staging/android/ion/ion_dummy_driver.c
index 5678870..806e76b 100644
--- a/drivers/staging/android/ion/ion_dummy_driver.c
+++ b/drivers/staging/android/ion/ion_dummy_driver.c
@@ -68,6 +68,8 @@ static int __init ion_dummy_init(void)
int i, err;
 
idev = ion_device_create(NULL);
+   if (IS_ERR(idev))
+   return PTR_ERR(idev);
heaps = kcalloc(dummy_ion_pdata.nr, sizeof(struct ion_heap *),
GFP_KERNEL);
if (!heaps)
-- 
1.9.1

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


[PATCH] staging: android: make function static

2016-04-05 Thread Sudip Mukherjee
The only user of ion_handle_put() is within the file ion.c, so we can
safely make it static. Just to be double sure, checked the function
ion_handle_get() which is static.
So we can make ion_handle_put() static.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/android/ion/ion.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/ion/ion.c 
b/drivers/staging/android/ion/ion.c
index d4c6207..bbc8bc5 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -396,7 +396,7 @@ static int ion_handle_put_nolock(struct ion_handle *handle)
return ret;
 }
 
-int ion_handle_put(struct ion_handle *handle)
+static int ion_handle_put(struct ion_handle *handle)
 {
struct ion_client *client = handle->client;
int ret;
-- 
1.9.1

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


Re: [PATCH V3] staging: rtl8192u: check return value of read_nic_word_E

2016-03-06 Thread Sudip Mukherjee
On Fri, Mar 04, 2016 at 11:40:29AM +0100, Salah Triki wrote:
> The call of read_nic_word_E may fail, therefore its return value must be
> checked.
> 
> Signed-off-by: Salah Triki 
> ---
>  drivers/staging/rtl8192u/r8180_93cx6.c |  30 +--
>  drivers/staging/rtl8192u/r8180_93cx6.h |   2 +-
>  drivers/staging/rtl8192u/r8192U_core.c | 140 
> ++---
>  3 files changed, 119 insertions(+), 53 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192u/r8180_93cx6.c 
> b/drivers/staging/rtl8192u/r8180_93cx6.c

> @@ -144,7 +157,10 @@ u32 eprom_read(struct net_device *dev, u32 addr)
>* and reading data. (eeprom outs a dummy 0)
>*/
>   eprom_ck_cycle(dev);
> - ret |= (eprom_r(dev)<<(15-i));
> + err = eprom_r(dev)<<(15-i);

read_nic_byte_E() can return -ENOMEM so eprom_r() also can return
-ENOMEM. So if eprom_r() fails then err becomes -12 << (15-i) where i
ranges from 0 to 16.

> + if (err)
> + return err;

And that values is used to decide the error. oops... am i reading it
properly?

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


Re: [PATCH 1/2] staging: dgnc: use pointer type of tty_struct

2016-03-06 Thread Sudip Mukherjee
On Mon, Feb 29, 2016 at 11:15:51AM +0900, Daeseok Youn wrote:
> From 70f8703b3bd73fa56f4ea91e98967b8925550aa6 Mon Sep 17 00:00:00 2001
> From: Daeseok Youn 
> Date: Thu, 25 Feb 2016 14:53:37 +0900
> Subject: [PATCH 1/2] staging: dgnc: use pointer type of tty_struct

These lines above are not required in the commit log. Please send v2 of
both your patches without these lines.

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


Re: [PATCH 5/5] staging: media: lirc: use new parport device model

2016-03-03 Thread Sudip Mukherjee
On Mon, Jan 25, 2016 at 03:12:57PM -0200, Mauro Carvalho Chehab wrote:
> Em Mon, 25 Jan 2016 22:32:31 +0530
> Sudip Mukherjee <sudipm.mukher...@gmail.com> escreveu:
> 
> > On Mon, Jan 25, 2016 at 02:29:06PM -0200, Mauro Carvalho Chehab wrote:
> > > Em Fri, 18 Dec 2015 18:35:29 +0530
> > > Sudip Mukherjee <sudipm.mukher...@gmail.com> escreveu:
> > >   
> > > > Modify lirc_parallel driver to use the new parallel port device model.  
> > > 
> > > Did you or someone else tested this patch?  
> > 
> > Only build tested and tested by inserting and removing the module.
> > But since the only change is in the way it registers and nothing else
> > so it should not break.
> 
> It would be worth to wait for a while in the hope that someone could
> test with a real hardware.

Hi Mauro,
Merge window is almost going to open. Maybe now you can consider
applying it.

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


[PATCH 3/4] staging: dgnc: unregister pci driver

2016-02-27 Thread Sudip Mukherjee
We may choose to load the module without the hardware present. That will
register the pci driver but since probe will not succeed so
dgnc_NumBoards will be 0. Now if we unload the module then the pci
driver stays registered as dgnc_NumBoards is 0. And if we try to load
the module again it fails with the error:
"Driver 'dgnc' is already registered."

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/dgnc/dgnc_driver.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index 1d1d5c8..22a92d1 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -156,8 +156,7 @@ static void dgnc_cleanup_module(void)
 
dgnc_tty_post_uninit();
 
-   if (dgnc_NumBoards)
-   pci_unregister_driver(_driver);
+   pci_unregister_driver(_driver);
 }
 
 /*
-- 
1.9.1

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


[PATCH 4/4] staging: dgnc: cleanup properly

2016-02-27 Thread Sudip Mukherjee
dgnc_cleanup_module() was called when the module unloaded to do a total
cleanup and it was also called if pci_register_driver() fails. But
dgnc_cleanup_module() will try dgnc_remove_driver_sysfiles() but the
sysfiles will be created only if pci_register_driver() succeeds.
So if pci_register_driver() fails and we try dgnc_cleanup_module() then we
were getting:

[  942.001479] BUG: unable to handle kernel NULL pointer dereference at 0018
[  942.001482] IP: [] sysfs_remove_file_ns+0x8/0x20

with part of the call trace as:

[  942.001544] Call Trace:
[  942.001555]  [] driver_remove_file+0x16/0x20
[  942.001571]  [] dgnc_remove_driver_sysfiles+0x18/0x40 [dgnc]
[  942.001575]  [] dgnc_cleanup_module+0x47/0x260 [dgnc]
[  942.001577]  [] ? 0xf86cb000
[  942.001580]  [] dgnc_init_module+0x1e6/0x1000 [dgnc]

Lets have a separate cleanup function which will execute
dgnc_remove_driver_sysfiles() depending on the argument passed to it.

Reported-by: Navy Cheng <nav...@126.com>
Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---

Hi Greg,
If you remember this problem was reported by Navy Cheng on the
kernelnewbies list but his report did not contain the call trace. He
just reported that his system hangs after reloading dgnc module.

 drivers/staging/dgnc/dgnc_driver.c | 21 +
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index 22a92d1..4eb410e 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -125,12 +125,7 @@ static struct pci_driver dgnc_driver = {
  *
  /
 
-/*
- * dgnc_cleanup_module()
- *
- * Module unload.  This is where it all ends.
- */
-static void dgnc_cleanup_module(void)
+static void cleanup(bool sysfiles)
 {
int i;
unsigned long flags;
@@ -142,7 +137,8 @@ static void dgnc_cleanup_module(void)
/* Turn off poller right away. */
del_timer_sync(_poll_timer);
 
-   dgnc_remove_driver_sysfiles(_driver);
+   if (sysfiles)
+   dgnc_remove_driver_sysfiles(_driver);
 
device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
class_destroy(dgnc_class);
@@ -155,7 +151,16 @@ static void dgnc_cleanup_module(void)
}
 
dgnc_tty_post_uninit();
+}
 
+/*
+ * dgnc_cleanup_module()
+ *
+ * Module unload.  This is where it all ends.
+ */
+static void dgnc_cleanup_module(void)
+{
+   cleanup(true);
pci_unregister_driver(_driver);
 }
 
@@ -182,7 +187,7 @@ static int __init dgnc_init_module(void)
rc = pci_register_driver(_driver);
if (rc) {
pr_warn("WARNING: dgnc driver load failed.  No Digi Neo or 
Classic boards found.\n");
-   dgnc_cleanup_module();
+   cleanup(false);
return rc;
}
dgnc_create_driver_sysfiles(_driver);
-- 
1.9.1

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


[PATCH 2/4] staging: dgnc: remove pci_unregister_driver

2016-02-27 Thread Sudip Mukherjee
If pci_register_driver() fails then dgnc_NumBoards can never be more
than zero. dgnc_NumBoards is incremented only at the end of a successful
probe. And moreover if the pci driver has failed to register then we
never need to unregister it. Lets just print the warning, perform the
cleanup and exit with the error code.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/staging/dgnc/dgnc_driver.c | 19 +--
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index c32f208..1d1d5c8 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -181,23 +181,14 @@ static int __init dgnc_init_module(void)
 * Find and configure all the cards
 */
rc = pci_register_driver(_driver);
-
-   /*
-* If something went wrong in the scan, bail out of driver.
-*/
-   if (rc < 0) {
-   /* Only unregister if it was actually registered. */
-   if (dgnc_NumBoards)
-   pci_unregister_driver(_driver);
-   else
-   pr_warn("WARNING: dgnc driver load failed.  No Digi Neo 
or Classic boards found.\n");
-
+   if (rc) {
+   pr_warn("WARNING: dgnc driver load failed.  No Digi Neo or 
Classic boards found.\n");
dgnc_cleanup_module();
-   } else {
-   dgnc_create_driver_sysfiles(_driver);
+   return rc;
}
+   dgnc_create_driver_sysfiles(_driver);
 
-   return rc;
+   return 0;
 }
 
 module_init(dgnc_init_module);
-- 
1.9.1

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


[PATCH 1/4] staging: dgnc: remove unneeded else

2016-02-27 Thread Sudip Mukherjee
If pci_enable_device() fails then we can return directly.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---

I saw there is some pending dgnc patch in outreachy, so this series
might not apply. This series is based on staging-testing.
I will resend v2 if it fails.

 drivers/staging/dgnc/dgnc_driver.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index fc6d298..c32f208 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -283,13 +283,13 @@ static int dgnc_init_one(struct pci_dev *pdev, const 
struct pci_device_id *ent)
/* wake up and enable device */
rc = pci_enable_device(pdev);
 
-   if (rc < 0) {
-   rc = -EIO;
-   } else {
-   rc = dgnc_found_board(pdev, ent->driver_data);
-   if (rc == 0)
-   dgnc_NumBoards++;
-   }
+   if (rc)
+   return -EIO;
+
+   rc = dgnc_found_board(pdev, ent->driver_data);
+   if (rc == 0)
+   dgnc_NumBoards++;
+
return rc;
 }
 
-- 
1.9.1

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


Re: [PATCH 04/30] staging: sm750fb: use PLL_CTRL_POWER defines for CRT_PLL_CTRL

2016-02-15 Thread Sudip Mukherjee
On Wed, Feb 10, 2016 at 06:33:56PM +0200, Mike Rapoport wrote:
> Use PLL_CTRL_POWER definitions for CRT_PLL_CTRL register access

Can we? IIRC, we have two different PLL for two displays. One for the
PANEL and the other for CRT. You have renamed PANEL_PLL_* to PLL_*, but
can you mix up two different PLL registers for two different displays
like this? They will obviously have different clocks.
Am i missing something here?

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


Re: [PATCH 03/30] staging: sm750fb: rename PANEL_PLL_CTRL_* fields to PLL_CTRL_*

2016-02-15 Thread Sudip Mukherjee
On Wed, Feb 10, 2016 at 06:33:55PM +0200, Mike Rapoport wrote:
> Several PLL control registers have the same layout and therefore the
> field definitions may be shared for those registers. Renaming
> definitions of PANEL_PLL_CTRL_* fields to more generic PLL_CTRL_* will
> allow reusing these definitions for other PLL control registers.
> 
> Signed-off-by: Mike Rapoport 
> ---

> diff --git a/drivers/staging/sm750fb/ddk750_display.c 
> b/drivers/staging/sm750fb/ddk750_display.c
> index 1a29ae0..514f909 100644
> --- a/drivers/staging/sm750fb/ddk750_display.c
> +++ b/drivers/staging/sm750fb/ddk750_display.c
> @@ -126,8 +126,8 @@ static void waitNextVerticalSync(int ctrl, int delay)
>  
>   /* Do not wait when the Primary PLL is off or display control 
> is already off.
>  This will prevent the software to wait forever. */
> - if ((FIELD_GET(PEEK32(PANEL_PLL_CTRL), PANEL_PLL_CTRL, POWER) ==
> -  PANEL_PLL_CTRL_POWER_OFF) ||
> + if ((FIELD_GET(PEEK32(PANEL_PLL_CTRL), PLL_CTRL, POWER) ==
> +  PLL_CTRL_POWER_OFF) ||

Here you are changing one use of PANEL_PLL_CTRL to PLL_CTRL while
keeping another use unchanged. Any reason for that?

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


Re: [PATCH v2] staging: unisys: use common return path

2016-02-09 Thread Sudip Mukherjee
On Mon, Feb 08, 2016 at 10:46:57PM +0530, Sudip Mukherjee wrote:
> On Sun, Feb 07, 2016 at 02:04:21PM -0800, Greg Kroah-Hartman wrote:
> > On Tue, Dec 01, 2015 at 04:22:33PM +0530, Sudip Mukherjee wrote:
> > > The success path and the error path both are first doing
> > > spin_unlock_irqrestore() before returning. Use that in the common path
> > > and return the success/error value.
> > > 
> > > Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
> > > ---
> > > 
> > > v2: changed label name
> > > 
> > > It is dependent on the patch series sent by Benjamin (Nov 30th).
> > 
> > Which didn't get applied, so can you resend this after that does get
> > accepted?
> 
> oops, i dont think i have the patch anymore. But looking at the commit
> message, i think i just sent the same suggestion to Benjamin for his
> [PATCH v3 13/14] staging: unisys: fix else statement in visornic_main.c
> 
> If he is not changing then I will create the patch and send you.

Hi Greg,
I will not be resending this patch as Ben is against to using goto.

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


Re: [PATCH v2 2/9] Staging: rts5208: rtsx_transport.c: Align to open parenthesis

2016-02-09 Thread Sudip Mukherjee
On Mon, Feb 08, 2016 at 05:31:18PM -0800, Shaun Ren wrote:
> This patch fixes the alignment issue reported by checkpatch.pl:
> 
> CHECK: Alignment should match open parenthesis
> 
> Signed-off-by: Shaun Ren 
> ---
>  drivers/staging/rts5208/rtsx_transport.c | 61 
> ++--
>  1 file changed, 35 insertions(+), 26 deletions(-)
> 

>  
> @@ -732,11 +739,13 @@ int rtsx_transfer_data_partial(struct rtsx_chip *chip, 
> u8 card,
>   if (rtsx_chk_stat(chip, RTSX_STAT_ABORT))
>   return -EIO;
>  
> - if (use_sg)
> - err = rtsx_transfer_sglist_adma_partial(chip, card,
> - (struct scatterlist *)buf, use_sg,
> - index, offset, (int)len, dma_dir, timeout);
> - else
> + if (use_sg) {
> + struct scatterlist *sg = (struct scatterlist *)buf;

this change is not documented in commit message.
> +
> + err = rtsx_transfer_sglist_adma_partial(chip, card, sg, use_sg,
> + index, offset, (int)len,
> + dma_dir, timeout);
> + } else

This will introduce new checkpatch warning. If you are giving braces in
the if block then you need to have braces in the else part also.

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


Re: [PATCH v2 7/9] Staging: rts5208: rtsx_transport.c: Remove unnecessary parentheses

2016-02-09 Thread Sudip Mukherjee
On Mon, Feb 08, 2016 at 05:31:23PM -0800, Shaun Ren wrote:
> This patch removes all unnecessary parentheses found by checkpatch.pl.
> 
> Signed-off-by: Shaun Ren 

This will not apply anymore because of some other changes done by:
9a66d05d82db ("Staging: rts5208: fix check for dma mapping error")

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


Re: [PATCH v3 13/14] staging: unisys: fix else statement in visornic_main.c

2016-02-09 Thread Sudip Mukherjee
On Tue, Feb 09, 2016 at 10:16:12AM -0500, Ben Romer wrote:
> On Mon, 2016-02-08 at 22:39 +0530, Sudip Mukherjee wrote:
> > maybe this is better where you have single exit point and so only one
> > spin_unlock_irqrestore().
> 
> 
> We discussed this before. I don't want to put any of the goto messes
> back in because I don't think it shortens the code or makes it any
> simpler.

yes, now i remember. Sorry for suggesting the same thing again.
Documentation/CodingStyle says:
"The goto statement comes in handy when a function exits from multiple
locations and some common work such as cleanup has to be done.  If there
is no cleanup needed then just return directly."

IMHO, the patch I posted or this suggestion does not go against that.
But anyway, since you are opposed to it I will not send the patch again.

> 
> [snip]
> > +
> > +exit_unlock:
> > +   spin_unlock_irqrestore(>priv_lock, flags);
> > return 0;
> 
> This should be returning ret.

yes, ofcourse. my mistake.

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


Re: [PATCH 2/3] staging: most: return proper error

2016-02-08 Thread Sudip Mukherjee
On Sun, Feb 07, 2016 at 02:14:56PM -0800, Greg Kroah-Hartman wrote:
> On Sun, Nov 22, 2015 at 10:30:55PM +0530, Sudip Mukherjee wrote:
> > We were returning ENOMEM on all types of errors. Lets return the actual
> > error code. At the same time remove the label which became unused as a
> > result of this patch.
> > 
> > Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
> > ---
> >  drivers/staging/most/mostcore/core.c | 22 +++---
> >  1 file changed, 15 insertions(+), 7 deletions(-)
> 
> This and patch 3/3 don't apply anymore :(

This one I have rebased and sent again but looks like 3/3 has already
been done by a later patch.

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


Re: [PATCH v3 13/14] staging: unisys: fix else statement in visornic_main.c

2016-02-08 Thread Sudip Mukherjee
On Mon, Feb 08, 2016 at 10:41:52AM -0500, Benjamin Romer wrote:
> From: Erik Arfvidson 
> 
> This patch fixes the following types of check patch warnings:
> else is not generally useful after a break or return
> 
> Signed-off-by: Erik Arfvidson 
> Signed-off-by: Benjamin Romer 
> 
> ---
> v2: the patch was rebased.
> v3: the patch was rebased.
> ---
>  drivers/staging/unisys/visornic/visornic_main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/unisys/visornic/visornic_main.c 
> b/drivers/staging/unisys/visornic/visornic_main.c
> index 3da849a..234fa21 100644
> --- a/drivers/staging/unisys/visornic/visornic_main.c
> +++ b/drivers/staging/unisys/visornic/visornic_main.c
> @@ -377,8 +377,8 @@ visornic_serverdown(struct visornic_devdata *devdata,
>   __func__);
>   spin_unlock_irqrestore(>priv_lock, flags);
>   return -EINVAL;
> - } else
> - spin_unlock_irqrestore(>priv_lock, flags);
> + }
> + spin_unlock_irqrestore(>priv_lock, flags);
>   return 0;
>  }

maybe this is better where you have single exit point and so only one
spin_unlock_irqrestore().

diff --git a/drivers/staging/unisys/visornic/visornic_main.c 
b/drivers/staging/unisys/visornic/visornic_main.c
index 3da849a..5d76497 100644
--- a/drivers/staging/unisys/visornic/visornic_main.c
+++ b/drivers/staging/unisys/visornic/visornic_main.c
@@ -358,15 +358,16 @@ visornic_serverdown(struct visornic_devdata *devdata,
visorbus_state_complete_func complete_func)
 {
unsigned long flags;
+   int ret = 0;
 
spin_lock_irqsave(>priv_lock, flags);
if (!devdata->server_down && !devdata->server_change_state) {
if (devdata->going_away) {
-   spin_unlock_irqrestore(>priv_lock, flags);
dev_dbg(>dev->device,
"%s aborting because device removal pending\n",
__func__);
-   return -ENODEV;
+   ret = -ENODEV;
+   goto exit_unlock;
}
devdata->server_change_state = true;
devdata->server_down_complete_func = complete_func;
@@ -375,10 +376,11 @@ visornic_serverdown(struct visornic_devdata *devdata,
} else if (devdata->server_change_state) {
dev_dbg(>dev->device, "%s changing state\n",
__func__);
-   spin_unlock_irqrestore(>priv_lock, flags);
-   return -EINVAL;
-   } else
-   spin_unlock_irqrestore(>priv_lock, flags);
+   ret = -EINVAL;
+   }
+
+exit_unlock:
+   spin_unlock_irqrestore(>priv_lock, flags);
return 0;
 }


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


[PATCH v2] staging: most: return error value

2016-02-08 Thread Sudip Mukherjee
On error we were returning retval, but retval is not having the error
value. We will get the error value using PTR_ERR.

Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---

v2: sent after rebasing

 drivers/staging/most/aim-cdev/cdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/most/aim-cdev/cdev.c 
b/drivers/staging/most/aim-cdev/cdev.c
index 3a2dbf1..de4f76a 100644
--- a/drivers/staging/most/aim-cdev/cdev.c
+++ b/drivers/staging/most/aim-cdev/cdev.c
@@ -470,8 +470,8 @@ static int aim_probe(struct most_interface *iface, int 
channel_id,
 NULL,
 "%s", name);
 
-   retval = IS_ERR(c->dev);
-   if (retval) {
+   if (IS_ERR(c->dev)) {
+   retval = PTR_ERR(c->dev);
pr_info("failed to create new device node %s\n", name);
goto error_create_device;
}
-- 
1.9.1

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


[PATCH v2] staging: most: return proper error

2016-02-08 Thread Sudip Mukherjee
We were returning ENOMEM on all types of errors. Lets return the actual
error code. At the same time remove the label which became unused as a
result of this patch.

Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---

v1 failed to apply due to some other changes.

 drivers/staging/most/mostcore/core.c | 27 +++
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/most/mostcore/core.c 
b/drivers/staging/most/mostcore/core.c
index ab4c32d..322ee01 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -1854,40 +1854,52 @@ EXPORT_SYMBOL_GPL(most_resume_enqueue);
 
 static int __init most_init(void)
 {
+   int err;
+
pr_info("init()\n");
INIT_LIST_HEAD(_list);
INIT_LIST_HEAD(_list);
ida_init(_id);
 
-   if (bus_register(_bus)) {
+   err = bus_register(_bus);
+   if (err) {
pr_info("Cannot register most bus\n");
-   goto exit;
+   return err;
}
 
most_class = class_create(THIS_MODULE, "most");
if (IS_ERR(most_class)) {
pr_info("No udev support.\n");
+   err = PTR_ERR(most_class);
goto exit_bus;
}
-   if (driver_register()) {
+
+   err = driver_register();
+   if (err) {
pr_info("Cannot register core driver\n");
goto exit_class;
}
 
class_glue_dir =
device_create(most_class, NULL, 0, NULL, "mostcore");
-   if (IS_ERR(class_glue_dir))
+   if (IS_ERR(class_glue_dir)) {
+   err = PTR_ERR(class_glue_dir);
goto exit_driver;
+   }
 
most_aim_kset =
kset_create_and_add("aims", NULL, _glue_dir->kobj);
-   if (!most_aim_kset)
+   if (!most_aim_kset) {
+   err = -ENOMEM;
goto exit_class_container;
+   }
 
most_inst_kset =
kset_create_and_add("devices", NULL, _glue_dir->kobj);
-   if (!most_inst_kset)
+   if (!most_inst_kset) {
+   err = -ENOMEM;
goto exit_driver_kset;
+   }
 
return 0;
 
@@ -1901,8 +1913,7 @@ exit_class:
class_destroy(most_class);
 exit_bus:
bus_unregister(_bus);
-exit:
-   return -ENOMEM;
+   return err;
 }
 
 static void __exit most_exit(void)
-- 
1.9.1

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


Re: [PATCH v2] staging: unisys: use common return path

2016-02-08 Thread Sudip Mukherjee
On Sun, Feb 07, 2016 at 02:04:21PM -0800, Greg Kroah-Hartman wrote:
> On Tue, Dec 01, 2015 at 04:22:33PM +0530, Sudip Mukherjee wrote:
> > The success path and the error path both are first doing
> > spin_unlock_irqrestore() before returning. Use that in the common path
> > and return the success/error value.
> > 
> > Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
> > ---
> > 
> > v2: changed label name
> > 
> > It is dependent on the patch series sent by Benjamin (Nov 30th).
> 
> Which didn't get applied, so can you resend this after that does get
> accepted?

oops, i dont think i have the patch anymore. But looking at the commit
message, i think i just sent the same suggestion to Benjamin for his
[PATCH v3 13/14] staging: unisys: fix else statement in visornic_main.c

If he is not changing then I will create the patch and send you.

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


[PATCH] staging: wilc1000: fix build failure

2016-02-05 Thread Sudip Mukherjee
allmodconfig build of alpha, m68k, m32r, tilepro has failed with the
error:
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c: In function 
'wilc_create_wiphy':
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c:2632:13:
error: 'struct wiphy' has no member named 'wowlan'

Looking at other drivers wowlan can be only used when CONFIG_PM is
defined.

Fixes: 73584a40d748 ("staging: wilc1000: add ops resuem/suspend/wakeup in 
cfg80211")
Cc: Glen Lee <glen@atmel.com>
Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---

builds of next-20160205.

I think I have seen the same report from 0day also when this commit was
in staging-testing.

 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 4eede2b..08c28b7 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -2629,7 +2629,9 @@ struct wireless_dev *wilc_create_wiphy(struct net_device 
*net, struct device *de
sema_init(&(priv->SemHandleUpdateStats), 1);
priv->wdev = wdev;
wdev->wiphy->max_scan_ssids = MAX_NUM_PROBED_SSID;
+#ifdef CONFIG_PM
wdev->wiphy->wowlan = _support;
+#endif
wdev->wiphy->max_num_pmkids = WILC_MAX_NUM_PMKIDS;
PRINT_INFO(CFG80211_DBG, "Max number of PMKIDs = %d\n", 
wdev->wiphy->max_num_pmkids);
 
-- 
1.9.1

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


Re: [PATCH] misc: Move panel driver out of staging

2016-02-02 Thread Sudip Mukherjee
On Tue, Feb 02, 2016 at 08:23:20AM -0800, Greg KH wrote:
> On Tue, Feb 02, 2016 at 03:38:21PM +0100, Ksenija Stanojevic wrote:
> > Move panel driver from drivers/staging/panel to drivers/misc.
> > 
> > Signed-off-by: Ksenija Stanojevic 
> > ---
> >  drivers/misc/Kconfig  |  278 
> >  drivers/misc/Makefile |1 +
> >  drivers/misc/panel.c  | 2445 
> > +
> >  drivers/staging/Kconfig   |2 -
> >  drivers/staging/Makefile  |1 -
> >  drivers/staging/panel/Kconfig |  278 
> >  drivers/staging/panel/Makefile|1 -
> >  drivers/staging/panel/TODO|8 -
> >  drivers/staging/panel/lcd-panel-cgram.txt |   24 -
> >  drivers/staging/panel/panel.c | 2445 
> > -
> >  10 files changed, 2724 insertions(+), 2759 deletions(-)
> >  create mode 100644 drivers/misc/panel.c
> >  delete mode 100644 drivers/staging/panel/Kconfig
> >  delete mode 100644 drivers/staging/panel/Makefile
> >  delete mode 100644 drivers/staging/panel/TODO
> >  delete mode 100644 drivers/staging/panel/lcd-panel-cgram.txt
> >  delete mode 100644 drivers/staging/panel/panel.c
> 
> 
> Can you generate a patch like this with the -M option to git
> format-patch?  It will show the files being moved, not being deleted and
> added again, making it much easier to see that nothing is changing
> during the move.

while at it please modify the MAINTAINERS file also.

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


Re: [PATCH 1/2] staging: xgifb: XGI_main_26.c fixed spacing to match coding style

2016-02-01 Thread Sudip Mukherjee
On Sat, Jan 30, 2016 at 12:52:45PM -0800, Santosh Madiraju wrote:
> From: madiraju 

You do not need this extra From: line here. Even if you need to give it
for some reason then the name should match the name as given in your
Signed-off-by: name.

> 
> Removed unnecessary spaces to match coding style.
> 
> Signed-off-by: Santosh Madiraju  
  ^

Did you write this Signed-off-by: manually? There is an extra space
there, i have marked, which will not be there if git creates the
Signed-off-by.

> ---
>  drivers/staging/xgifb/XGI_main_26.c | 22 ++
>  1 file changed, 6 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/staging/xgifb/XGI_main_26.c 
> b/drivers/staging/xgifb/XGI_main_26.c
> index 89f5b55..4978737 100644
> --- a/drivers/staging/xgifb/XGI_main_26.c
> +++ b/drivers/staging/xgifb/XGI_main_26.c
> @@ -1989,7 +1989,6 @@ static int xgifb_probe(struct pci_dev *pdev,
>   _info->var.vsync_len,
>   _info->var.sync,
>   _info->var.vmode)) {
> -
>   if ((fb_info->var.vmode & FB_VMODE_MASK) ==
>   FB_VMODE_INTERLACED) {
>   fb_info->var.yres <<= 1;
> @@ -1999,10 +1998,7 @@ static int xgifb_probe(struct pci_dev *pdev,
>   fb_info->var.pixclock >>= 1;
>   fb_info->var.yres >>= 1;
>   fb_info->var.yres_virtual >>= 1;
> - }
> -
> - }
> -
> + } }

:(
This does not match coding style.
BTW, what error checkpatch showed here? I am not finding anythig here
except an extra blank line.

>   fb_info->flags = FBINFO_FLAG_DEFAULT;
>   fb_info->screen_base = xgifb_info->video_vbase;
>   fb_info->fbops = _ops;
> @@ -2064,33 +2060,27 @@ static struct pci_driver xgifb_driver = {
>   .remove = xgifb_remove
>  };
>  
> -
> -
>  /*/
>  /*  MODULE   */
>  /*/
>  
>  module_param(mode, charp, 0);
> -MODULE_PARM_DESC(mode,
> - "Selects the desired default display mode in the format XxYxDepth (eg. 
> 1024x768x16).");
> +MODULE_PARM_DESC(mode, "Selects the desired default display mode in the 
> format XxYxDepth (eg. 1024x768x16).");
>  
>  module_param(forcecrt2type, charp, 0);
> -MODULE_PARM_DESC(forcecrt2type,
> - "Force the second display output type. Possible values are NONE, LCD, 
> TV, VGA, SVIDEO or COMPOSITE.");
> +MODULE_PARM_DESC(forcecrt2type, "Force the second display output type. 
> Possible values are NONE, LCD, TV, VGA, SVIDEO or COMPOSITE.");
>  
>  module_param(vesa, int, 0);
> -MODULE_PARM_DESC(vesa,
> - "Selects the desired default display mode by VESA mode number (eg. 
> 0x117).");
> +MODULE_PARM_DESC(vesa, "Selects the desired default display mode by VESA 
> mode number (eg. 0x117).");
>  
>  module_param(filter, int, 0);
> -MODULE_PARM_DESC(filter,
> - "Selects TV flicker filter type (only for systems with a SiS301 video 
> bridge). Possible values 0-7. Default: [no filter]).");
> +MODULE_PARM_DESC(filter, "Selects TV flicker filter type (only for systems 
> with a SiS301 video bridge). Possible values 0-7. Default: [no filter]).");
>  
>  static int __init xgifb_init(void)
>  {
>   char *option = NULL;
>  
> - if (forcecrt2type != NULL)
> + if (!forcecrt2type)

oops...
shouldn't it be:
if (forcecrt2type)

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


Re: [PATCH] Staging: gs_fpgaboot: fixed coding style issues in gs_fpgaboot.c

2016-02-01 Thread Sudip Mukherjee
On Sun, Jan 31, 2016 at 09:06:31PM +0100, Ben Marsh wrote:
> Signed-off-by: Ben Marsh 
> ---

You have not given any commit message. Please mention which coding style
issue you have fixed.
On first look, you have done multiple types of changes. Please only do
one type of change in a single patch.

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


Re: Move wlan-ng out of staging?

2016-01-29 Thread Sudip Mukherjee
On Fri, Jan 29, 2016 at 05:00:16PM +0100, Xose Vazquez Perez wrote:
> Ksenija wrote:
> 
> > I'm helping Greg do a bit of cleanup in the staging tree, I noticed that
> > wlan-ng driver is maybe ready to be moved out of staging. Are there
> > any TODO tasks left to do beside checkpatch.pl clean-up?
> 
> Its FAQ was very clear: ftp://ftp.linux-wlan.org/pub/linux-wlan-ng/FAQ
> [archived at 
> http://puppylinux.dreamhosters.com/wireless/linux-wlan-org_FAQ.txt ]
> 
> --cut--
> Q: When will linux-wlan-ng be merged into the mainline kernel?
> 
>   Short answer:  Never.

The ultimate aim of a driver in staging is to graduate out of staging
area into the main part of the kernel. If it is already known that this
driver can never move out of staging then IMHO its better to remove it.

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


Re: [PATCH 1/1] staging: coding style cleanups for staging/most/mostcore driver

2016-01-29 Thread Sudip Mukherjee
On Fri, Jan 29, 2016 at 10:38:42PM +0530, Bijosh Thykkoottathil wrote:
> From: Bijosh Thykkoottathil 

You do not need this From: line here. The email From: header is
sufficient.

> 
> Fixes following coading style issues reported by the check patch script.
> - ERROR: Macros with complex values should be enclosed in parentheses
> - CHECK: struct mutex definition without comment
> - CHECK: spinlock_t definition without comment
> - CHECK: Avoid crashing the kernel - try using WARN_ON & recovery code
>   rather than BUG() or BUG_ON()
> - WARNING: storage class should be at the beginning of the declaration

You are doing too many things in one patch. Please break them up into
separate patches. Each patch should do only one type of change.

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


Re: Move wlan-ng out of staging?

2016-01-25 Thread Sudip Mukherjee
On Mon, Jan 25, 2016 at 01:16:56PM +0100, Ksenija Stanojević wrote:
> Hi All,
> 
> I'm helping Greg do a bit of cleanup in the staging tree, I noticed that
> wlan-ng driver is maybe ready to be moved out of staging. Are there
> any TODO tasks left to do beside checkpatch.pl clean-up?

I think the main part is still pending. using in-kernel wireless stack.

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


Re: [PATCH] Revert "Staging: panel: usleep_range is preferred over udelay"

2016-01-25 Thread Sudip Mukherjee
On Mon, Jan 25, 2016 at 03:40:41PM +0300, Dan Carpenter wrote:
> On Mon, Jan 25, 2016 at 03:13:21PM +0530, Sudip Mukherjee wrote:
> > Apart from the mail which Ying Huang sent to me last week for another error
> > (which actually turned out to be this one), i saw the first report by
> > Ying Huang on November.
> > https://lkml.org/lkml/2015/11/2/93
> 
> Ying, could you CC the subsystem list for these reports?  This one was
> CC'd to Sirnam, Greg and LKML.  Sirnam is too new to understand what
> they mean, Greg is too busy, and only Sudip and Alan Cox read LKML.

I only read the mails whose subject is interesting and something which
I can understand. I am also still new to understand many of the things.
I am sure Alan, Greg, Linus, they will read all the mails.

I am setting up a filter in my lkml mails so that these reports are
saved in a separate folder and I will keep and track the reports i
understand.

regards
sudip


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


Re: [PATCH] Revert "Staging: panel: usleep_range is preferred over udelay"

2016-01-25 Thread Sudip Mukherjee
On Mon, Jan 25, 2016 at 04:47:26AM -0800, Joe Perches wrote:
> On Mon, 2016-01-25 at 12:16 +0300, Dan Carpenter wrote:
> > Ugh...  Checkpatch told us to introduce bugs...  :(  We almost certainly
> > would have missed this bug in review, but it wasn't sent to the list so
> > I guess we'll never know.
> 
> So when isn't usleep_range preferred over udelay?

inside a spin_lock or in some interrupt routine.

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


Re: [PATCH 5/5] staging: media: lirc: use new parport device model

2016-01-25 Thread Sudip Mukherjee
On Mon, Jan 25, 2016 at 02:29:06PM -0200, Mauro Carvalho Chehab wrote:
> Em Fri, 18 Dec 2015 18:35:29 +0530
> Sudip Mukherjee <sudipm.mukher...@gmail.com> escreveu:
> 
> > Modify lirc_parallel driver to use the new parallel port device model.
> 
> Did you or someone else tested this patch?

Only build tested and tested by inserting and removing the module.
But since the only change is in the way it registers and nothing else
so it should not break.

Only patch 1/5 is applying now. I will send v2 after removing patch 4/5.

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


Re: [PATCH 5/5] staging: media: lirc: use new parport device model

2016-01-25 Thread Sudip Mukherjee

On Monday 25 January 2016 10:42 PM, Mauro Carvalho Chehab wrote:

Em Mon, 25 Jan 2016 22:32:31 +0530
Sudip Mukherjee <sudipm.mukher...@gmail.com> escreveu:


On Mon, Jan 25, 2016 at 02:29:06PM -0200, Mauro Carvalho Chehab wrote:

Em Fri, 18 Dec 2015 18:35:29 +0530
Sudip Mukherjee <sudipm.mukher...@gmail.com> escreveu:


Modify lirc_parallel driver to use the new parallel port device model.


Did you or someone else tested this patch?


Only build tested and tested by inserting and removing the module.
But since the only change is in the way it registers and nothing else
so it should not break.


It would be worth to wait for a while in the hope that someone could
test with a real hardware.


Sure, we have lots of time for 4.6 merge window. May be if you have the 
schematic somewhere then I can try to build one. Its a Homebrew one, so 
maybe I can try.


regards
sudip

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


Re: [PATCH] Revert "Staging: panel: usleep_range is preferred over udelay"

2016-01-25 Thread Sudip Mukherjee
On Mon, Jan 25, 2016 at 12:16:01PM +0300, Dan Carpenter wrote:
> Ugh...  Checkpatch told us to introduce bugs...  :(  We almost certainly
> would have missed this bug in review, but it wasn't sent to the list so
> I guess we'll never know.

I can find the v1 of the patch in usb list.
http://permalink.gmane.org/gmane.linux.usb.general/132712

Apart from the mail which Ying Huang sent to me last week for another error
(which actually turned out to be this one), i saw the first report by
Ying Huang on November.
https://lkml.org/lkml/2015/11/2/93

I think i will start keeping a list of errors sent by 0day to check if
they are getting fixed or not.

Or maybe Ying Huang has some mechanism. do you?

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


Re: [PATCH] Revert "Staging: panel: usleep_range is preferred over udelay"

2016-01-24 Thread Sudip Mukherjee
On Sat, Jan 23, 2016 at 02:49:20PM +0530, Sudip Mukherjee wrote:
> This reverts commit ebd43516d3879f882a403836bba8bc5791f26a28.
> 
> We should not be sleeping inside spin_lock.
> 
> Fixes: ebd43516d387 ("Staging: panel: usleep_range is preferred over udelay")
> Cc: Sirnam Swetha <theonly.ultim...@gmail.com>
> Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>

Reported-by: Huang, Ying <ying.hu...@intel.com>

And can we also add
Tested-by: Huang, Ying <ying.hu...@intel.com>

based on his test report and mail at
https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1058239.html
and
https://lkml.org/lkml/2016/1/24/355

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


[PATCH] Revert "Staging: panel: usleep_range is preferred over udelay"

2016-01-23 Thread Sudip Mukherjee
This reverts commit ebd43516d3879f882a403836bba8bc5791f26a28.

We should not be sleeping inside spin_lock.

Fixes: ebd43516d387 ("Staging: panel: usleep_range is preferred over udelay")
Cc: Sirnam Swetha <theonly.ultim...@gmail.com>
Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---
 drivers/staging/panel/panel.c | 34 +++---
 1 file changed, 15 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index 79ac192..70b8f4f 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -825,8 +825,7 @@ static void lcd_write_cmd_s(int cmd)
lcd_send_serial(0x1F);  /* R/W=W, RS=0 */
lcd_send_serial(cmd & 0x0F);
lcd_send_serial((cmd >> 4) & 0x0F);
-   /* the shortest command takes at least 40 us */
-   usleep_range(40, 100);
+   udelay(40); /* the shortest command takes at least 40 us */
spin_unlock_irq(_lock);
 }
 
@@ -837,8 +836,7 @@ static void lcd_write_data_s(int data)
lcd_send_serial(0x5F);  /* R/W=W, RS=1 */
lcd_send_serial(data & 0x0F);
lcd_send_serial((data >> 4) & 0x0F);
-   /* the shortest data takes at least 40 us */
-   usleep_range(40, 100);
+   udelay(40); /* the shortest data takes at least 40 us */
spin_unlock_irq(_lock);
 }
 
@@ -848,20 +846,19 @@ static void lcd_write_cmd_p8(int cmd)
spin_lock_irq(_lock);
/* present the data to the data port */
w_dtr(pprt, cmd);
-   /* maintain the data during 20 us before the strobe */
-   usleep_range(20, 100);
+   udelay(20); /* maintain the data during 20 us before the strobe */
 
bits.e = BIT_SET;
bits.rs = BIT_CLR;
bits.rw = BIT_CLR;
set_ctrl_bits();
 
-   usleep_range(40, 100);  /* maintain the strobe during 40 us */
+   udelay(40); /* maintain the strobe during 40 us */
 
bits.e = BIT_CLR;
set_ctrl_bits();
 
-   usleep_range(120, 500); /* the shortest command takes at least 120 us */
+   udelay(120);/* the shortest command takes at least 120 us */
spin_unlock_irq(_lock);
 }
 
@@ -871,20 +868,19 @@ static void lcd_write_data_p8(int data)
spin_lock_irq(_lock);
/* present the data to the data port */
w_dtr(pprt, data);
-   /* maintain the data during 20 us before the strobe */
-   usleep_range(20, 100);
+   udelay(20); /* maintain the data during 20 us before the strobe */
 
bits.e = BIT_SET;
bits.rs = BIT_SET;
bits.rw = BIT_CLR;
set_ctrl_bits();
 
-   usleep_range(40, 100);  /* maintain the strobe during 40 us */
+   udelay(40); /* maintain the strobe during 40 us */
 
bits.e = BIT_CLR;
set_ctrl_bits();
 
-   usleep_range(45, 100);  /* the shortest data takes at least 45 us */
+   udelay(45); /* the shortest data takes at least 45 us */
spin_unlock_irq(_lock);
 }
 
@@ -894,7 +890,7 @@ static void lcd_write_cmd_tilcd(int cmd)
spin_lock_irq(_lock);
/* present the data to the control port */
w_ctr(pprt, cmd);
-   usleep_range(60, 120);
+   udelay(60);
spin_unlock_irq(_lock);
 }
 
@@ -904,7 +900,7 @@ static void lcd_write_data_tilcd(int data)
spin_lock_irq(_lock);
/* present the data to the data port */
w_dtr(pprt, data);
-   usleep_range(60, 120);
+   udelay(60);
spin_unlock_irq(_lock);
 }
 
@@ -947,7 +943,7 @@ static void lcd_clear_fast_s(void)
lcd_send_serial(0x5F);  /* R/W=W, RS=1 */
lcd_send_serial(' ' & 0x0F);
lcd_send_serial((' ' >> 4) & 0x0F);
-   usleep_range(40, 100);  /* the shortest data takes at least 40 
us */
+   udelay(40); /* the shortest data takes at least 40 us */
}
spin_unlock_irq(_lock);
 
@@ -971,7 +967,7 @@ static void lcd_clear_fast_p8(void)
w_dtr(pprt, ' ');
 
/* maintain the data during 20 us before the strobe */
-   usleep_range(20, 100);
+   udelay(20);
 
bits.e = BIT_SET;
bits.rs = BIT_SET;
@@ -979,13 +975,13 @@ static void lcd_clear_fast_p8(void)
set_ctrl_bits();
 
/* maintain the strobe during 40 us */
-   usleep_range(40, 100);
+   udelay(40);
 
bits.e = BIT_CLR;
set_ctrl_bits();
 
/* the shortest data takes at least 45 us */
-   usleep_range(45, 100);
+   udelay(45);
}
spin_unlock_irq(_lock);
 
@@ -1007,7 +1003,7 @@ static void lcd_clear_fast_tilcd(void)
for (pos = 0; pos < lcd.height * lcd.hwidth; pos++) {
/* present the data to the data port */
w_dtr(pprt, ' '

Re: [PATCH 25/27] staging: wilc1000: fix coding style of kmalloc usage

2016-01-21 Thread Sudip Mukherjee
On Thu, Jan 21, 2016 at 10:20:28AM +0900, Chaehyun Lim wrote:
> This patch fixes coding style of kmalloc usage found by checkpatch.
> CHECK: Prefer kmalloc(sizeof(*new_msg)...) over kmalloc(sizeof(struct 
> message)...)
> 
> Signed-off-by: Chaehyun Lim 
> ---
>  drivers/staging/wilc1000/wilc_msgqueue.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
> b/drivers/staging/wilc1000/wilc_msgqueue.c
> index 7107715..c7a60f4 100644
> --- a/drivers/staging/wilc1000/wilc_msgqueue.c
> +++ b/drivers/staging/wilc1000/wilc_msgqueue.c
> @@ -70,7 +70,7 @@ int wilc_mq_send(struct message_queue *mq,
>   }
>  
>   /* construct a new message */
> - new_msg = kmalloc(sizeof(struct message), GFP_ATOMIC);
> + new_msg = kmalloc(sizeof(*new_msg), GFP_ATOMIC);

This checkpatch error was introduced by 1/27 patch of this series. Maybe
it will be better to fix it in that one.

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


Re: [PATCH v2 1/7] staging/wilc1000: Introduce linux_spi_msg_init

2016-01-12 Thread Sudip Mukherjee
On Mon, Jan 11, 2016 at 09:13:31PM +0100, Janosch Frank wrote:
> Since all spi read and write functions were basically preparing the
> same data, moving the preparation into a function decreased line count
> a lot.
> 
> This also resolves the following problems:
> Zeroing the message ourselves is not needed, as spi_message_init()
> already does that for us.
> 
> The comment on struct spi_transfer states that setting rx or tx to
> NULL will result in sending zeroes or discarding read data. Therefore
> we don't have to allocate an empty buffer if we only do one way
> transfer.
> 
> Returning -ENOMEM on failed allocation would not have resulted in
> error catching but success in the callee. Thats because of the
> strange expected return values.
> 
> Signed-off-by: Janosch Frank 
> ---
>  drivers/staging/wilc1000/linux_wlan_spi.c | 183 
> --

linux_wlan_spi.c has been deleted by:
523fc23f1179 ("staging: wilc1000: remove unused files")

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


Re: [PATCH 1/6] staging: wlan-ng: Fixed block comment coding style

2016-01-11 Thread Sudip Mukherjee
On Sat, Jan 09, 2016 at 11:23:14AM +0530, Pranjal wrote:
> 
> 
> On Saturday 09 January 2016 09:58 AM, Sudip Mukherjee wrote:
> >On Sat, Jan 09, 2016 at 12:29:21AM +0530, Pranjal Bhor wrote:
> >>Block comments now end with '*/' on a newline and all lines
> >>of block comments now begin with '*'
> >>
> >>Signed-off-by: Pranjal Bhor <bhor.pran...@gmail.com>
> >>---
> >something is wrong, when I am trying to test the patch, it is not
> >applying and git says patch is corrupt.
> >
> >regards
> >sudip
> I have checked it once again but everything seems to be fine. How
> can I reproduce your result?

Sorry for the late reply. Please try to apply the patch that you have
sent.

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


Re: [PATCH] staging/ion: Add support to get ion handle from dma buf

2016-01-08 Thread Sudip Mukherjee
On Thu, Jan 07, 2016 at 11:57:34AM +0300, Dan Carpenter wrote:
> Hm...  Perhaps I should be CC'ing LKML more often.  What's the rule on
> this, should I just send bugfixes to LKML and whitespace changes to only
> subsystem list?

All my patches (whitespace, bugfix, build fail) always has CC to lkml.
Infact, I have setup an alias for that so that i don't have to add lkml
manually everytime.

sm = send-email --cc=linux-ker...@vger.kernel.org

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


Re: [PATCH 1/2] Staging: panel: Fix line over 80 characters

2015-12-30 Thread Sudip Mukherjee
On Wed, Dec 30, 2015 at 11:13:40AM +0100, Ksenija Stanojević wrote:
> On Wed, Dec 30, 2015 at 6:01 AM, Sudip Mukherjee
> <sudipm.mukher...@gmail.com> wrote:
> > On Sun, Dec 27, 2015 at 12:16:15PM +0100, Ksenija Stanojevic wrote:
> >> Split comment in order to fit into 80 characters per line.
> >> Found by checkpatch.pl
> >>
> >> Signed-off-by: Ksenija Stanojevic <ksenija.stanoje...@gmail.com>
> >> ---
> >
> > Instead of multiline maybe this is better:
> >
> > diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
> > index 79ac192..3525919 100644
> > --- a/drivers/staging/panel/panel.c
> > +++ b/drivers/staging/panel/panel.c
> > @@ -947,7 +947,8 @@ static void lcd_clear_fast_s(void)
> > lcd_send_serial(0x5F);  /* R/W=W, RS=1 */
> > lcd_send_serial(' ' & 0x0F);
> > lcd_send_serial((' ' >> 4) & 0x0F);
> > -   usleep_range(40, 100);  /* the shortest data takes at least 
> > 40 us */
> > +   /* the shortest data takes at least 40 us */
> > +   usleep_range(40, 100);
> > }
> > spin_unlock_irq(_lock);
> 
> It's already been done by Bijosh Thykkoottathil:
> https://lkml.org/lkml/2015/12/18/681

But I think not yet accepted by Greg. And his commit message doesnot
mention what coding style errors he has fixed. Usually Greg will not
accept them.

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


Re: [PATCH 2/6] Staging: gdm72xx: Add space around that " "

2015-12-29 Thread Sudip Mukherjee
On Sun, Dec 27, 2015 at 02:44:41AM +0530, shraddha.6...@gmail.com wrote:
> From: Shraddha Barke 
> 
> Add missing space around that " " to follow linux kernel coding
> style. Warning detected by checkpatch
> 
> Signed-off-by: Shraddha Barke 
> ---

This will not apply due to:
2bc29a1abc5c ("staging: gdm72xx: Replace timeval with ktime_t")

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


Re: [PATCH 1/2] Staging: panel: Fix line over 80 characters

2015-12-29 Thread Sudip Mukherjee
On Sun, Dec 27, 2015 at 12:16:15PM +0100, Ksenija Stanojevic wrote:
> Split comment in order to fit into 80 characters per line.
> Found by checkpatch.pl
> 
> Signed-off-by: Ksenija Stanojevic 
> ---

Instead of multiline maybe this is better:

diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index 79ac192..3525919 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -947,7 +947,8 @@ static void lcd_clear_fast_s(void)
lcd_send_serial(0x5F);  /* R/W=W, RS=1 */
lcd_send_serial(' ' & 0x0F);
lcd_send_serial((' ' >> 4) & 0x0F);
-   usleep_range(40, 100);  /* the shortest data takes at least 40 
us */
+   /* the shortest data takes at least 40 us */
+   usleep_range(40, 100);
}
spin_unlock_irq(_lock);


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


Re: [PATCH 21/28] staging: most: fix retrieval of buffer availability

2015-12-24 Thread Sudip Mukherjee
On Tue, Dec 22, 2015 at 10:53:02AM +0100, Christian Gromm wrote:
> This patch fixes the function channel_has_mbo that delivers the false
> information in case two AIMs are using the same tx channel.
> 
> Signed-off-by: Christian Gromm 
> ---
> 

> diff --git a/drivers/staging/most/mostcore/core.c 
> b/drivers/staging/most/mostcore/core.c
> index b085f0a..ff0e0dc 100644
> --- a/drivers/staging/most/mostcore/core.c
> +++ b/drivers/staging/most/mostcore/core.c
> @@ -1352,7 +1352,7 @@ most_c_obj *get_channel_by_iface(struct most_interface 
> *iface, int id)
>   return i->channel[id];
>  }
>  
> -int channel_has_mbo(struct most_interface *iface, int id)
> +int channel_has_mbo(struct most_interface *iface, int id, struct most_aim 
> *aim)
>  {
>   struct most_c_obj *c = get_channel_by_iface(iface, id);
>   unsigned long flags;
> @@ -1361,6 +1361,11 @@ int channel_has_mbo(struct most_interface *iface, int 
> id)
>   if (unlikely(!c))
>   return -EINVAL;
>  
> + if (c->aim0.refs && c->aim1.refs &&
> + ((aim == c->aim0.ptr && c->aim0.num_buffers <= 0) ||
> +  (aim == c->aim1.ptr && c->aim1.num_buffers <= 0)))
> + return false;

channel_has_mbo() return int. maybe return 0 instead of return false..

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


[PATCH 5/5] staging: media: lirc: use new parport device model

2015-12-18 Thread Sudip Mukherjee
Modify lirc_parallel driver to use the new parallel port device model.

Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---
 drivers/staging/media/lirc/lirc_parallel.c | 100 +++--
 1 file changed, 65 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_parallel.c 
b/drivers/staging/media/lirc/lirc_parallel.c
index 0156114..20ec9b6 100644
--- a/drivers/staging/media/lirc/lirc_parallel.c
+++ b/drivers/staging/media/lirc/lirc_parallel.c
@@ -629,43 +629,26 @@ static void kf(void *handle)
*/
 }
 
-/*** module initialization and cleanup ***/
-
-static int __init lirc_parallel_init(void)
+static void lirc_parallel_attach(struct parport *port)
 {
-   int result;
+   struct pardev_cb lirc_parallel_cb;
 
-   result = platform_driver_register(_parallel_driver);
-   if (result) {
-   pr_notice("platform_driver_register returned %d\n", result);
-   return result;
-   }
+   if (port->base != io)
+   return;
 
-   lirc_parallel_dev = platform_device_alloc(LIRC_DRIVER_NAME, 0);
-   if (!lirc_parallel_dev) {
-   result = -ENOMEM;
-   goto exit_driver_unregister;
-   }
+   pport = port;
+   memset(_parallel_cb, 0, sizeof(lirc_parallel_cb));
+   lirc_parallel_cb.preempt = pf;
+   lirc_parallel_cb.wakeup = kf;
+   lirc_parallel_cb.irq_func = lirc_lirc_irq_handler;
 
-   result = platform_device_add(lirc_parallel_dev);
-   if (result)
-   goto exit_device_put;
-
-   pport = parport_find_base(io);
-   if (!pport) {
-   pr_notice("no port at %x found\n", io);
-   result = -ENXIO;
-   goto exit_device_put;
-   }
-   ppdevice = parport_register_device(pport, LIRC_DRIVER_NAME,
-  pf, kf, lirc_lirc_irq_handler, 0,
-  NULL);
-   parport_put_port(pport);
+   ppdevice = parport_register_dev_model(port, LIRC_DRIVER_NAME,
+ _parallel_cb, 0);
if (!ppdevice) {
pr_notice("parport_register_device() failed\n");
-   result = -ENXIO;
-   goto exit_device_put;
+   return;
}
+
if (parport_claim(ppdevice) != 0)
goto skip_init;
is_claimed = 1;
@@ -693,18 +676,66 @@ static int __init lirc_parallel_init(void)
 
is_claimed = 0;
parport_release(ppdevice);
- skip_init:
+
+skip_init:
+   return;
+}
+
+static void lirc_parallel_detach(struct parport *port)
+{
+   if (port->base != io)
+   return;
+
+   parport_unregister_device(ppdevice);
+}
+
+static struct parport_driver lirc_parport_driver = {
+   .name = LIRC_DRIVER_NAME,
+   .match_port = lirc_parallel_attach,
+   .detach = lirc_parallel_detach,
+   .devmodel = true,
+};
+
+/*** module initialization and cleanup ***/
+
+static int __init lirc_parallel_init(void)
+{
+   int result;
+
+   result = platform_driver_register(_parallel_driver);
+   if (result) {
+   pr_notice("platform_driver_register returned %d\n", result);
+   return result;
+   }
+
+   lirc_parallel_dev = platform_device_alloc(LIRC_DRIVER_NAME, 0);
+   if (!lirc_parallel_dev) {
+   result = -ENOMEM;
+   goto exit_driver_unregister;
+   }
+
+   result = platform_device_add(lirc_parallel_dev);
+   if (result)
+   goto exit_device_put;
+
+   result = parport_register_driver(_parport_driver);
+   if (result) {
+   pr_notice("parport_register_driver returned %d\n", result);
+   goto exit_device_put;
+   }
+
driver.dev = _parallel_dev->dev;
driver.minor = lirc_register_driver();
if (driver.minor < 0) {
pr_notice("register_chrdev() failed\n");
-   parport_unregister_device(ppdevice);
result = -EIO;
-   goto exit_device_put;
+   goto exit_unregister;
}
pr_info("installed using port 0x%04x irq %d\n", io, irq);
return 0;
 
+exit_unregister:
+   parport_unregister_driver(_parport_driver);
 exit_device_put:
platform_device_put(lirc_parallel_dev);
 exit_driver_unregister:
@@ -714,9 +745,8 @@ exit_driver_unregister:
 
 static void __exit lirc_parallel_exit(void)
 {
-   parport_unregister_device(ppdevice);
lirc_unregister_driver(driver.minor);
-
+   parport_unregister_driver(_parport_driver);
platform_device_unregister(lirc_parallel_dev);
platform_driver_unregister(_parallel_driver);
 }
-- 
1.9.1

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


[PATCH 3/5] staging: media: lirc: space around operator

2015-12-18 Thread Sudip Mukherjee
checkpatch complains about missing space around operators.

Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---
 drivers/staging/media/lirc/lirc_parallel.c | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_parallel.c 
b/drivers/staging/media/lirc/lirc_parallel.c
index f65ab93..e09894d 100644
--- a/drivers/staging/media/lirc/lirc_parallel.c
+++ b/drivers/staging/media/lirc/lirc_parallel.c
@@ -161,17 +161,17 @@ static unsigned int init_lirc_timer(void)
 || (now.tv_sec == tv.tv_sec
 && now.tv_usec < tv.tv_usec)));
 
-   timeelapsed = (now.tv_sec + 1 - tv.tv_sec)*100
+   timeelapsed = (now.tv_sec + 1 - tv.tv_sec) * 100
 + (now.tv_usec - tv.tv_usec);
if (count >= 1000 && timeelapsed > 0) {
if (default_timer == 0) {
/* autodetect timer */
-   newtimer = (100*count)/timeelapsed;
+   newtimer = (100 * count) / timeelapsed;
pr_info("%u Hz timer detected\n", newtimer);
return newtimer;
}
-   newtimer = (100*count)/timeelapsed;
-   if (abs(newtimer - default_timer) > default_timer/10) {
+   newtimer = (100 * count) / timeelapsed;
+   if (abs(newtimer - default_timer) > default_timer / 10) {
/* bad timer */
pr_notice("bad timer: %u Hz\n", newtimer);
pr_notice("using default timer: %u Hz\n",
@@ -196,7 +196,7 @@ static int lirc_claim(void)
return 0;
}
}
-   out(LIRC_LP_CONTROL, LP_PSELECP|LP_PINITP);
+   out(LIRC_LP_CONTROL, LP_PSELECP | LP_PINITP);
is_claimed = 1;
return 1;
 }
@@ -251,7 +251,7 @@ static void lirc_lirc_irq_handler(void *blah)
/* really long time */
data = PULSE_MASK;
else
-   data = (int)(signal*100 +
+   data = (int)(signal * 100 +
 tv.tv_usec - lasttv.tv_usec +
 LIRC_SFH506_DELAY);
 
@@ -269,7 +269,7 @@ static void lirc_lirc_irq_handler(void *blah)
init = 1;
}
 
-   timeout = timer/10; /* timeout after 1/10 sec. */
+   timeout = timer / 10;   /* timeout after 1/10 sec. */
signal = 1;
level = lirc_get_timer();
do {
@@ -291,7 +291,7 @@ static void lirc_lirc_irq_handler(void *blah)
/* adjust value to usecs */
__u64 helper;
 
-   helper = ((__u64)signal)*100;
+   helper = ((__u64)signal) * 100;
do_div(helper, timer);
signal = (long)helper;
 
@@ -299,7 +299,7 @@ static void lirc_lirc_irq_handler(void *blah)
data = signal - LIRC_SFH506_DELAY;
else
data = 1;
-   rbuf_write(PULSE_BIT|data); /* pulse */
+   rbuf_write(PULSE_BIT | data); /* pulse */
}
do_gettimeofday();
 #else
@@ -336,7 +336,7 @@ static ssize_t lirc_read(struct file *filep, char __user 
*buf, size_t n,
set_current_state(TASK_INTERRUPTIBLE);
while (count < n) {
if (rptr != wptr) {
-   if (copy_to_user(buf+count, [rptr],
+   if (copy_to_user(buf + count, [rptr],
 sizeof(int))) {
result = -EFAULT;
break;
@@ -398,7 +398,7 @@ static ssize_t lirc_write(struct file *filep, const char 
__user *buf, size_t n,
for (i = 0; i < count; i++) {
__u64 helper;
 
-   helper = ((__u64)wbuf[i])*timer;
+   helper = ((__u64)wbuf[i]) * timer;
do_div(helper, 100);
wbuf[i] = (int)helper;
}
@@ -669,7 +669,7 @@ static int __init lirc_parallel_init(void)
if (parport_claim(ppdevice) != 0)
goto skip_init;
is_claimed = 1;
-   out(LIRC_LP_CONTROL, LP_PSELECP|LP_PINITP);
+   out(LIRC_LP_CONTROL, LP_PSELECP | LP_PINITP);
 
 #ifdef LIRC_TIMER
if (debug)
-- 
1.9.1

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


  1   2   3   4   5   6   7   8   9   10   >