[PATCH] staging: android: fix typo

2015-08-19 Thread Junesung Lee
Fix typo.

Signed-off-by: Junesung Lee 
---
 drivers/staging/android/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig
index 24d657b..0a9a7b3 100644
--- a/drivers/staging/android/Kconfig
+++ b/drivers/staging/android/Kconfig
@@ -53,7 +53,7 @@ config SW_SYNC
depends on SYNC
---help---
  A sync object driver that uses a 32bit counter to coordinate
- syncrhronization.  Useful when there is no hardware primitive backing
+ synchronization.  Useful when there is no hardware primitive backing
  the synchronization.
 
 config SW_SYNC_USER
-- 
2.1.4

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


[PATCH] staging: most: Use NULL instead of 0 in assignment of pointer

2015-08-19 Thread Anders Fridlund
Fix sparse warning 'Using plain integer as NULL pointer' by replacing 0
with NULL in the assignment.

Signed-off-by: Anders Fridlund 
---
 drivers/staging/most/aim-network/networking.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/most/aim-network/networking.c 
b/drivers/staging/most/aim-network/networking.c
index c8ab239..a1e1bce 100644
--- a/drivers/staging/most/aim-network/networking.c
+++ b/drivers/staging/most/aim-network/networking.c
@@ -295,7 +295,7 @@ static void most_net_rm_netdev_safe(struct net_dev_context 
*nd)
 
unregister_netdev(nd->dev);
free_netdev(nd->dev);
-   nd->dev = 0;
+   nd->dev = NULL;
 }
 
 static struct net_dev_context *get_net_dev_context(
-- 
1.9.1

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


Re: [PATCH 00/14] MIPS/staging: OCTEON: enable ethernet/xaui on CN68XX

2015-08-19 Thread Ralf Baechle
On Fri, Aug 14, 2015 at 12:49:58PM -0700, David Daney wrote:

> If what you have now works, I would merge this patch set, so:
> 
> Acked-by: David Daney 
> 
> 
> Follow-on improvements can be made with additional patches.

Cool, thanks.  Queued for kernel $n + 1.

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


Re: [PATCH V2] staging: dgnc: take lock when storing value in dgnc_poll_tick

2015-08-19 Thread Salah Triki
On Wed, Aug 19, 2015 at 10:36:14PM +0300, Dan Carpenter wrote:
> On Wed, Aug 19, 2015 at 07:11:55PM +0100, Salah Triki wrote:
> > poll_tick is declared global, so dgnc_driver_pollrate_store needs to take
> > the lock dgnc_poll_lock before modifying this variable. dgnc_poll_lock is
> > the appropriate lock, since it is intended for poll scheduling and
> > dgnc_poll_tick contains the poll rate. dgnc_poll_lock needs to be declared
> > not static and extern in order to be visible for dgnc_driver_pollrate_store.
> > 
> > Signed-off-by: Salah Triki 
> > ---
> 
> Looks good.
> 
> Reviewed-by: Dan Carpenter 
> 
> Greg has closed the tree because of the pending merge window so it will
> take several weeks before he merges this.  No worries though.
> 
> regards,
> dan carpenter
> 

Thanx :)

best regards,
salah triki
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH V2] staging: dgnc: take lock when storing value in dgnc_poll_tick

2015-08-19 Thread Dan Carpenter
On Wed, Aug 19, 2015 at 07:11:55PM +0100, Salah Triki wrote:
> poll_tick is declared global, so dgnc_driver_pollrate_store needs to take
> the lock dgnc_poll_lock before modifying this variable. dgnc_poll_lock is
> the appropriate lock, since it is intended for poll scheduling and
> dgnc_poll_tick contains the poll rate. dgnc_poll_lock needs to be declared
> not static and extern in order to be visible for dgnc_driver_pollrate_store.
> 
> Signed-off-by: Salah Triki 
> ---

Looks good.

Reviewed-by: Dan Carpenter 

Greg has closed the tree because of the pending merge window so it will
take several weeks before he merges this.  No worries though.

regards,
dan carpenter

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


Re: [PATCH v10 5/8] staging: usage documentation for simple fpga bus

2015-08-19 Thread Moritz Fischer
Acked-by: Moritz Fischer 

On Wed, Aug 19, 2015 at 11:28 AM, atull  wrote:
> On Mon, 17 Aug 2015, Pavel Machek wrote:
>
>> On Thu 2015-08-13 12:37:29, at...@opensource.altera.com wrote:
>> > From: Alan Tull 
>> >
>> > Add a document spelling out usage of the simple fpga bus.
>> >
>> > Signed-off-by: Alan Tull 
>>
>> Acked-by: Pavel Machek 
>>  
>>  Pavel
> Hi Pavel,
>
> Thanks!
>
> Alan
>
>> --
>> (english) http://www.livejournal.com/~pavelmachek
>> (cesky, pictures) 
>> http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
>>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v10 5/8] staging: usage documentation for simple fpga bus

2015-08-19 Thread atull
On Mon, 17 Aug 2015, Pavel Machek wrote:

> On Thu 2015-08-13 12:37:29, at...@opensource.altera.com wrote:
> > From: Alan Tull 
> > 
> > Add a document spelling out usage of the simple fpga bus.
> > 
> > Signed-off-by: Alan Tull 
> 
> Acked-by: Pavel Machek 
>   
> Pavel
Hi Pavel,

Thanks!

Alan

> -- 
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) 
> http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH V2] staging: dgnc: take lock when storing value in dgnc_poll_tick

2015-08-19 Thread Salah Triki
poll_tick is declared global, so dgnc_driver_pollrate_store needs to take
the lock dgnc_poll_lock before modifying this variable. dgnc_poll_lock is
the appropriate lock, since it is intended for poll scheduling and
dgnc_poll_tick contains the poll rate. dgnc_poll_lock needs to be declared
not static and extern in order to be visible for dgnc_driver_pollrate_store.

Signed-off-by: Salah Triki 
---
 drivers/staging/dgnc/dgnc_driver.c | 2 +-
 drivers/staging/dgnc/dgnc_driver.h | 1 +
 drivers/staging/dgnc/dgnc_sysfs.c  | 9 -
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index 7546aff..f03e8b3 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -64,6 +64,7 @@ static const struct file_operations dgnc_BoardFops = {
 uint   dgnc_NumBoards;
 struct dgnc_board  *dgnc_Board[MAXBOARDS];
 DEFINE_SPINLOCK(dgnc_global_lock);
+DEFINE_SPINLOCK(dgnc_poll_lock);
 uint   dgnc_Major;
 intdgnc_poll_tick = 20;/* Poll interval - 20 ms */
 
@@ -75,7 +76,6 @@ static struct class *dgnc_class;
 /*
  * Poller stuff
  */
-static DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
 static ulong   dgnc_poll_time; /* Time of next poll */
 static uintdgnc_poll_stop; /* Used to tell poller to stop */
 static struct timer_list dgnc_poll_timer;
diff --git a/drivers/staging/dgnc/dgnc_driver.h 
b/drivers/staging/dgnc/dgnc_driver.h
index 06ece51..6784d81 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -389,6 +389,7 @@ struct channel_t {
  */
 extern uintdgnc_Major; /* Our driver/mgmt major */
 extern int dgnc_poll_tick; /* Poll interval - 20 ms */
+extern spinlock_t  dgnc_poll_lock; /* Poll scheduling lock */
 extern spinlock_t  dgnc_global_lock;   /* Driver global spinlock */
 extern uintdgnc_NumBoards; /* Total number of boards */
 extern struct dgnc_board   *dgnc_Board[MAXBOARDS]; /* Array of board 
structs */
diff --git a/drivers/staging/dgnc/dgnc_sysfs.c 
b/drivers/staging/dgnc/dgnc_sysfs.c
index 44db870..f91a36a 100644
--- a/drivers/staging/dgnc/dgnc_sysfs.c
+++ b/drivers/staging/dgnc/dgnc_sysfs.c
@@ -56,11 +56,18 @@ static ssize_t dgnc_driver_pollrate_show(struct 
device_driver *ddp, char *buf)
 static ssize_t dgnc_driver_pollrate_store(struct device_driver *ddp,
  const char *buf, size_t count)
 {
+   unsigned long flags;
+   int tick;
int ret;
 
-   ret = sscanf(buf, "%d\n", &dgnc_poll_tick);
+   ret = sscanf(buf, "%d\n", &tick);
if (ret != 1)
return -EINVAL;
+
+   spin_lock_irqsave(&dgnc_poll_lock, flags);
+   dgnc_poll_tick = tick;
+   spin_unlock_irqstore(&dgnc_poll_lock, flags);
+
return count;
 }
 static DRIVER_ATTR(pollrate, (S_IRUSR | S_IWUSR), dgnc_driver_pollrate_show,
-- 
1.9.1

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


Re: [PATCH 0/4] [media] Media entity cleanups and build fixes

2015-08-19 Thread Mauro Carvalho Chehab
Hi Javier,

Em Wed, 19 Aug 2015 17:35:18 +0200
Javier Martinez Canillas  escreveu:

> Hello,
> 
> This series contains a couple of build fixes and cleanups for the
> Media Controller framework. The goal of the series is to get rid of
> the struct media_entity .parent member since now that a media_gobj is
> embedded into entities, the media_gobj .mdev member can be used to
> store a pointer to the parent struct media_device.
> 
> So the .parent field becomes redundant and can be removed after all
> the users are converted to use entity .graph_obj.mdev instead.
> 
> Patches 1/4 and 2/4 are build fixes I found while build testing if no
> regressions were introduced by the conversion. 

Crap. Those omap drivers depend on some sub-arch specific DMA functions,
and can't use COMPILE_TEST. I hope some day someone would fix it,
in order to avoid troubles like that.

> Patch 3/4 converts
> all the drivers and the MC core to use .mdev instead of .parent and
> finally patch 4/4 removes the .parent field since now is unused.

Thanks for that!
All patches look good on my eyes.
> 
> The series depend on Mauro's "[PATCH v6 0/8] MC preparation patches
> series" [0].

I'll add those patches on my experimental branch together with the
other patches that belong to the MC next gen rework.

> 
> The transformation were automated using a coccinelle semantic patch
> and the drivers were build tested using allyesconfig and x-building
> the ARM Exynos and OMAP defconfigs + the needed media config options.
> 
> Best regards,
> Javier
> 
> [0]: http://www.mail-archive.com/linux-media@vger.kernel.org/msg91330.html
> 
> 
> Javier Martinez Canillas (4):
>   [media] staging: omap4iss: get entity ID using media_entity_id()
>   [media] omap3isp: get entity ID using media_entity_id()
>   [media] media: use entity.graph_obj.mdev instead of .parent
>   [media] media: remove media entity .parent field
> 
>  drivers/media/media-device.c   |  8 ++---
>  drivers/media/media-entity.c   | 34 
> --
>  drivers/media/platform/exynos4-is/fimc-isp-video.c |  6 ++--
>  drivers/media/platform/exynos4-is/fimc-lite.c  |  8 ++---
>  drivers/media/platform/exynos4-is/media-dev.c  |  2 +-
>  drivers/media/platform/exynos4-is/media-dev.h  |  8 ++---
>  drivers/media/platform/omap3isp/isp.c  | 11 ---
>  drivers/media/platform/omap3isp/ispccdc.c  |  2 +-
>  drivers/media/platform/omap3isp/ispvideo.c | 10 ---
>  drivers/media/platform/vsp1/vsp1_video.c   |  2 +-
>  drivers/media/platform/xilinx/xilinx-dma.c |  2 +-
>  drivers/staging/media/davinci_vpfe/vpfe_video.c|  6 ++--
>  drivers/staging/media/omap4iss/iss.c   |  6 ++--
>  drivers/staging/media/omap4iss/iss_video.c |  4 +--
>  include/media/media-entity.h   |  1 -
>  15 files changed, 58 insertions(+), 52 deletions(-)
> 

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


[PATCH] hyper-v: mark TSC as unstable

2015-08-19 Thread Vitaly Kuznetsov
Hyper-V top-level functional specification states, that "algorithms should
be resilient to sudden jumps forward or backward in the TSC value", this
means that we should consider TSC as unstable. In some cases tsc tests are
able to detect the instability, it was detected in 543 out of 646 boots in
my testing:

 Measured 6277 cycles TSC warp between CPUs, turning off TSC clock.
 tsc: Marking TSC unstable due to check_tsc_sync_source failed

This is, however, just a heuristic. On Hyper-V platform there are two good
clocksources: MSR-based hyperv_clocksource and recently introduced TSC
page.

Signed-off-by: Vitaly Kuznetsov 
---
 arch/x86/kernel/cpu/mshyperv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index aad4bd8..6fd023d 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -141,6 +141,7 @@ static void __init ms_hyperv_init_platform(void)
no_timer_check = 1;
 #endif
 
+   mark_tsc_unstable("running on Hyper-V");
 }
 
 const __refconst struct hypervisor_x86 x86_hyper_ms_hyperv = {
-- 
2.4.3

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


Re: USB, TTY, char/misc, and Staging trees now closed for 4.3

2015-08-19 Thread Albino B Neto
2015-08-19 11:52 GMT-03:00 Greg KH :
> Given that 4.2 will be out in a few days, it's time to close my trees
> for new patches until 4.3-rc1 is out.

Ok

-- 
Albino B Neto
"Debian. Freedom to code. Code to freedom!" faw
twitter.com/b1n0anb
gplus.to/AlbinoBNeto
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] /media/davinci_vpfe/dm365_resizer.c:Bug containing more than 80 characters in a line is fixed.

2015-08-19 Thread Ravinder Atla
Signed-off-by: Ravinder Atla 
---
 drivers/staging/media/davinci_vpfe/dm365_resizer.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/davinci_vpfe/dm365_resizer.c 
b/drivers/staging/media/davinci_vpfe/dm365_resizer.c
index 6218230..273aea3 100644
--- a/drivers/staging/media/davinci_vpfe/dm365_resizer.c
+++ b/drivers/staging/media/davinci_vpfe/dm365_resizer.c
@@ -1393,8 +1393,8 @@ resizer_try_format(struct v4l2_subdev *sd, struct 
v4l2_subdev_pad_config *cfg,
  * return -EINVAL or zero on success
  */
 static int resizer_set_format(struct v4l2_subdev *sd,
-   struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_format *
-   fmt)
+   struct v4l2_subdev_pad_config *cfg,
+   struct v4l2_subdev_format *fmt)
 {
struct vpfe_resizer_device *resizer = v4l2_get_subdevdata(sd);
struct v4l2_mbus_framefmt *format;
@@ -1454,8 +1454,8 @@ static int resizer_set_format(struct v4l2_subdev *sd,
  * return -EINVAL or zero on success
  */
 static int resizer_get_format(struct v4l2_subdev *sd,
-   struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_format *
-   fmt)
+   struct v4l2_subdev_pad_config *cfg,
+   struct v4l2_subdev_format *fmt)
 {
struct v4l2_mbus_framefmt *format;
 
-- 
1.9.1

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


[PATCH 3/4] [media] media: use entity.graph_obj.mdev instead of .parent

2015-08-19 Thread Javier Martinez Canillas
The struct media_entity has a .parent field that stores a pointer
to the parent struct media_device. But recently a media_gobj was
embedded into the entities and since struct media_gojb already has
a pointer to a struct media_device in the .mdev field, the .parent
field becomes redundant and can be removed.

This patch replaces all the usage of .parent by .graph_obj.mdev so
that field will become unused and can be removed on a later patch.

No functional changes.

The transformation was made using the following coccinelle spatch:

@@
struct media_entity *me;
@@

- me->parent
+ me->graph_obj.mdev

@@
struct media_entity *link;
@@

- link->source->entity->parent
+ link->source->entity->graph_obj.mdev

@@
struct exynos_video_entity *ve;
@@

- ve->vdev.entity.parent
+ ve->vdev.entity.graph_obj.mdev

Suggested-by: Mauro Carvalho Chehab 
Signed-off-by: Javier Martinez Canillas 
---

 drivers/media/media-device.c   |  8 ++---
 drivers/media/media-entity.c   | 34 --
 drivers/media/platform/exynos4-is/fimc-isp-video.c |  6 ++--
 drivers/media/platform/exynos4-is/fimc-lite.c  |  8 ++---
 drivers/media/platform/exynos4-is/media-dev.c  |  2 +-
 drivers/media/platform/exynos4-is/media-dev.h  |  8 ++---
 drivers/media/platform/omap3isp/isp.c  |  4 +--
 drivers/media/platform/omap3isp/ispvideo.c |  2 +-
 drivers/media/platform/vsp1/vsp1_video.c   |  2 +-
 drivers/media/platform/xilinx/xilinx-dma.c |  2 +-
 drivers/staging/media/davinci_vpfe/vpfe_video.c|  6 ++--
 drivers/staging/media/omap4iss/iss.c   |  4 +--
 drivers/staging/media/omap4iss/iss_video.c |  2 +-
 13 files changed, 45 insertions(+), 43 deletions(-)

diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index 0f3844470147..138b18416460 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -435,8 +435,8 @@ int __must_check media_device_register_entity(struct 
media_device *mdev,
int i;
 
/* Warn if we apparently re-register an entity */
-   WARN_ON(entity->parent != NULL);
-   entity->parent = mdev;
+   WARN_ON(entity->graph_obj.mdev != NULL);
+   entity->graph_obj.mdev = mdev;
 
spin_lock(&mdev->lock);
/* Initialize media_gobj embedded at the entity */
@@ -471,7 +471,7 @@ EXPORT_SYMBOL_GPL(media_device_register_entity);
 void media_device_unregister_entity(struct media_entity *entity)
 {
int i;
-   struct media_device *mdev = entity->parent;
+   struct media_device *mdev = entity->graph_obj.mdev;
 
if (mdev == NULL)
return;
@@ -484,7 +484,7 @@ void media_device_unregister_entity(struct media_entity 
*entity)
media_gobj_remove(&entity->graph_obj);
list_del(&entity->list);
spin_unlock(&mdev->lock);
-   entity->parent = NULL;
+   entity->graph_obj.mdev = NULL;
 }
 EXPORT_SYMBOL_GPL(media_device_unregister_entity);
 
diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index 35e52cd1fc5a..a23c93369a04 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -332,7 +332,7 @@ EXPORT_SYMBOL_GPL(media_entity_graph_walk_next);
 __must_check int media_entity_pipeline_start(struct media_entity *entity,
 struct media_pipeline *pipe)
 {
-   struct media_device *mdev = entity->parent;
+   struct media_device *mdev = entity->graph_obj.mdev;
struct media_entity_graph graph;
struct media_entity *entity_err = entity;
int ret;
@@ -387,7 +387,7 @@ __must_check int media_entity_pipeline_start(struct 
media_entity *entity,
 
ret = entity->ops->link_validate(link);
if (ret < 0 && ret != -ENOIOCTLCMD) {
-   dev_dbg(entity->parent->dev,
+   dev_dbg(entity->graph_obj.mdev->dev,
"link validation failed for \"%s\":%u 
-> \"%s\":%u, error %d\n",
link->source->entity->name,
link->source->index,
@@ -401,7 +401,7 @@ __must_check int media_entity_pipeline_start(struct 
media_entity *entity,
 
if (!bitmap_full(active, entity->num_pads)) {
ret = -EPIPE;
-   dev_dbg(entity->parent->dev,
+   dev_dbg(entity->graph_obj.mdev->dev,
"\"%s\":%u must be connected by an enabled 
link\n",
entity->name,
(unsigned)find_first_zero_bit(
@@ -454,7 +454,7 @@ EXPORT_SYMBOL_GPL(media_entity_pipeline_start);
  */
 void media_entity_pipeline_stop(struct media_entity *entity)
 {
-   struct media_device *mdev = entity->parent;
+   struct media_device *mdev = entity->graph_obj.mdev;
struct media_ent

[PATCH 1/4] [media] staging: omap4iss: get entity ID using media_entity_id()

2015-08-19 Thread Javier Martinez Canillas
The struct media_entity does not have an .id field anymore since
now the entity ID is stored in the embedded struct media_gobj.

This caused the omap4iss driver fail to build. Fix by using the
media_entity_id() macro to obtain the entity ID.

Signed-off-by: Javier Martinez Canillas 
---

 drivers/staging/media/omap4iss/iss.c   | 2 +-
 drivers/staging/media/omap4iss/iss_video.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/omap4iss/iss.c 
b/drivers/staging/media/omap4iss/iss.c
index f32ab7b98ae2..7226553ceb2f 100644
--- a/drivers/staging/media/omap4iss/iss.c
+++ b/drivers/staging/media/omap4iss/iss.c
@@ -607,7 +607,7 @@ static int iss_pipeline_disable(struct iss_pipeline *pipe,
 * crashed. Mark it as such, the ISS will be reset when
 * applications will release it.
 */
-   iss->crashed |= 1U << subdev->entity.id;
+   iss->crashed |= 1U << media_entity_id(&subdev->entity);
failure = -ETIMEDOUT;
}
}
diff --git a/drivers/staging/media/omap4iss/iss_video.c 
b/drivers/staging/media/omap4iss/iss_video.c
index bae67742706f..25e9e7a6b99d 100644
--- a/drivers/staging/media/omap4iss/iss_video.c
+++ b/drivers/staging/media/omap4iss/iss_video.c
@@ -784,7 +784,7 @@ iss_video_streamon(struct file *file, void *fh, enum 
v4l2_buf_type type)
entity = &video->video.entity;
media_entity_graph_walk_start(&graph, entity);
while ((entity = media_entity_graph_walk_next(&graph)))
-   pipe->entities |= 1 << entity->id;
+   pipe->entities |= 1 << media_entity_id(entity);
 
/* Verify that the currently configured format matches the output of
 * the connected subdev.
-- 
2.4.3

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


[PATCH 0/4] [media] Media entity cleanups and build fixes

2015-08-19 Thread Javier Martinez Canillas
Hello,

This series contains a couple of build fixes and cleanups for the
Media Controller framework. The goal of the series is to get rid of
the struct media_entity .parent member since now that a media_gobj is
embedded into entities, the media_gobj .mdev member can be used to
store a pointer to the parent struct media_device.

So the .parent field becomes redundant and can be removed after all
the users are converted to use entity .graph_obj.mdev instead.

Patches 1/4 and 2/4 are build fixes I found while build testing if no
regressions were introduced by the conversion. Patch 3/4 converts
all the drivers and the MC core to use .mdev instead of .parent and
finally patch 4/4 removes the .parent field since now is unused.

The series depend on Mauro's "[PATCH v6 0/8] MC preparation patches
series" [0].

The transformation were automated using a coccinelle semantic patch
and the drivers were build tested using allyesconfig and x-building
the ARM Exynos and OMAP defconfigs + the needed media config options.

Best regards,
Javier

[0]: http://www.mail-archive.com/linux-media@vger.kernel.org/msg91330.html


Javier Martinez Canillas (4):
  [media] staging: omap4iss: get entity ID using media_entity_id()
  [media] omap3isp: get entity ID using media_entity_id()
  [media] media: use entity.graph_obj.mdev instead of .parent
  [media] media: remove media entity .parent field

 drivers/media/media-device.c   |  8 ++---
 drivers/media/media-entity.c   | 34 --
 drivers/media/platform/exynos4-is/fimc-isp-video.c |  6 ++--
 drivers/media/platform/exynos4-is/fimc-lite.c  |  8 ++---
 drivers/media/platform/exynos4-is/media-dev.c  |  2 +-
 drivers/media/platform/exynos4-is/media-dev.h  |  8 ++---
 drivers/media/platform/omap3isp/isp.c  | 11 ---
 drivers/media/platform/omap3isp/ispccdc.c  |  2 +-
 drivers/media/platform/omap3isp/ispvideo.c | 10 ---
 drivers/media/platform/vsp1/vsp1_video.c   |  2 +-
 drivers/media/platform/xilinx/xilinx-dma.c |  2 +-
 drivers/staging/media/davinci_vpfe/vpfe_video.c|  6 ++--
 drivers/staging/media/omap4iss/iss.c   |  6 ++--
 drivers/staging/media/omap4iss/iss_video.c |  4 +--
 include/media/media-entity.h   |  1 -
 15 files changed, 58 insertions(+), 52 deletions(-)

-- 
2.4.3

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


Re: [PATCH] Staging: most: Use NULL instead of zero

2015-08-19 Thread Christian Gromm
On Wed, 19 Aug 2015 11:17:09 +0530
Ronit Halder  wrote:

> This patch fixes the warning generated by sparse
> "Using plain integer as NULL pointer" by using NULL
> instead of zero.
> 
> Signed-off-by: Ronit halder 
Acked-by: Christian Gromm 
> ---
>  drivers/staging/most/aim-network/networking.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/most/aim-network/networking.c 
> b/drivers/staging/most/aim-network/networking.c
> index c8ab239..a1e1bce 100644
> --- a/drivers/staging/most/aim-network/networking.c
> +++ b/drivers/staging/most/aim-network/networking.c
> @@ -295,7 +295,7 @@ static void most_net_rm_netdev_safe(struct 
> net_dev_context *nd)
>  
>   unregister_netdev(nd->dev);
>   free_netdev(nd->dev);
> - nd->dev = 0;
> + nd->dev = NULL;
>  }
>  
>  static struct net_dev_context *get_net_dev_context(

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


Re: [PATCHv7 5/5] Staging: most: aim-cdev/cdev.c. Fix "missing static keyword" warnings

2015-08-19 Thread Christian Gromm
On Fri, 14 Aug 2015 12:18:04 +0200
Adrian Remonda  wrote:

> This is a patch to the most/aim_cdev.c file. It makes several
> local functions and structures static to prevent global visibility.
> 
> Signed-off-by: Adrian Remonda 
Acked-by: Christian Gromm 
> ---
>  drivers/staging/most/aim-cdev/cdev.c | 18 +-
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/staging/most/aim-cdev/cdev.c 
> b/drivers/staging/most/aim-cdev/cdev.c
> index 252a17cf153c..0a13d8d0fa39 100644
> --- a/drivers/staging/most/aim-cdev/cdev.c
> +++ b/drivers/staging/most/aim-cdev/cdev.c
> @@ -49,7 +49,7 @@ static struct list_head channel_list;
>  static spinlock_t ch_list_lock;
>  
>  
> -struct aim_channel *get_channel(struct most_interface *iface, int id)
> +static struct aim_channel *get_channel(struct most_interface *iface, int id)
>  {
>   struct aim_channel *channel, *tmp;
>   unsigned long flags;
> @@ -289,7 +289,7 @@ static const struct file_operations channel_fops = {
>   * This frees allocated memory and removes the cdev that represents this
>   * channel in user space.
>   */
> -int aim_disconnect_channel(struct most_interface *iface, int channel_id)
> +static int aim_disconnect_channel(struct most_interface *iface, int 
> channel_id)
>  {
>   struct aim_channel *channel;
>   unsigned long flags;
> @@ -329,7 +329,7 @@ int aim_disconnect_channel(struct most_interface *iface, 
> int channel_id)
>   * This searches for the channel linked to this MBO and stores it in the 
> local
>   * fifo buffer.
>   */
> -int aim_rx_completion(struct mbo *mbo)
> +static int aim_rx_completion(struct mbo *mbo)
>  {
>   struct aim_channel *channel;
>  
> @@ -356,7 +356,7 @@ int aim_rx_completion(struct mbo *mbo)
>   *
>   * This wakes sleeping processes in the wait-queue.
>   */
> -int aim_tx_completion(struct most_interface *iface, int channel_id)
> +static int aim_tx_completion(struct most_interface *iface, int channel_id)
>  {
>   struct aim_channel *channel;
>  
> @@ -376,7 +376,7 @@ int aim_tx_completion(struct most_interface *iface, int 
> channel_id)
>   return 0;
>  }
>  
> -struct most_aim cdev_aim;
> +static struct most_aim cdev_aim;
>  
>  /**
>   * aim_probe - probe function of the driver module
> @@ -390,9 +390,9 @@ struct most_aim cdev_aim;
>   *
>   * Returns 0 on success or error code otherwise.
>   */
> -int aim_probe(struct most_interface *iface, int channel_id,
> -   struct most_channel_config *cfg,
> -   struct kobject *parent, char *name)
> +static int aim_probe(struct most_interface *iface, int channel_id,
> +  struct most_channel_config *cfg,
> +  struct kobject *parent, char *name)
>  {
>   struct aim_channel *channel;
>   unsigned long cl_flags;
> @@ -463,7 +463,7 @@ error_alloc_channel:
>   return retval;
>  }
>  
> -struct most_aim cdev_aim = {
> +static struct most_aim cdev_aim = {
>   .name = "cdev",
>   .probe_channel = aim_probe,
>   .disconnect_channel = aim_disconnect_channel,

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


Re: [PATCHv7 4/5] Staging: most: hdm-dim2/dim2_hal.c. Fix "Using plain integer as NULL pointer" warnings

2015-08-19 Thread Christian Gromm
On Fri, 14 Aug 2015 12:18:03 +0200
Adrian Remonda  wrote:

> This patch fixes the warning generated by sparse: "Using plain integer
> as NULL pointer" by replacing the offending 0 with NULL.
> 
> Signed-off-by: Adrian Remonda 
> ---
>  drivers/staging/most/hdm-dim2/dim2_hal.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/most/hdm-dim2/dim2_hal.c 
> b/drivers/staging/most/hdm-dim2/dim2_hal.c
> index 01b748944ee4..a54cf2cedac3 100644
> --- a/drivers/staging/most/hdm-dim2/dim2_hal.c
> +++ b/drivers/staging/most/hdm-dim2/dim2_hal.c
> @@ -889,7 +889,7 @@ struct dim_ch_state_t *DIM_GetChannelState(struct 
> dim_channel *ch,
>   struct dim_ch_state_t *state_ptr)
>  {
>   if (!ch || !state_ptr)
> - return 0;
> + return NULL;
>  
>   state_ptr->ready = ch->state.level < 2;
>   state_ptr->done_buffers = ch->done_sw_buffers_number;

This has already been addressed.

Regards,
Chris

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


Re: [PATCHv7 3/5] Staging: most: hdm-usb/hdm_usb.c. Fix "missing static keyword" warnings

2015-08-19 Thread Christian Gromm
On Fri, 14 Aug 2015 12:18:02 +0200
Adrian Remonda  wrote:

> This is a patch to the most/hdm-usb/hdm_usb.c file. It
> makes several local functions and structures static to prevent global
> visibility.
> 
> Signed-off-by: Adrian Remonda 
Acked-by: Christian Gromm 
> ---
>  drivers/staging/most/hdm-usb/hdm_usb.c | 16 
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c 
> b/drivers/staging/most/hdm-usb/hdm_usb.c
> index 514ce3529b7a..305303f2f17c 100644
> --- a/drivers/staging/most/hdm-usb/hdm_usb.c
> +++ b/drivers/staging/most/hdm-usb/hdm_usb.c
> @@ -290,7 +290,7 @@ static unsigned int get_stream_frame_size(struct 
> most_channel_config *cfg)
>   *
>   * Returns 0 on success or error code otherwise.
>   */
> -int hdm_poison_channel(struct most_interface *iface, int channel)
> +static int hdm_poison_channel(struct most_interface *iface, int channel)
>  {
>   struct most_dev *mdev;
>  
> @@ -328,7 +328,7 @@ int hdm_poison_channel(struct most_interface *iface, int 
> channel)
>   * This inserts the INIC hardware specific padding bytes into a streaming
>   * channel's buffer
>   */
> -int hdm_add_padding(struct most_dev *mdev, int channel, struct mbo *mbo)
> +static int hdm_add_padding(struct most_dev *mdev, int channel, struct mbo 
> *mbo)
>  {
>   struct most_channel_config *conf = &mdev->conf[channel];
>   unsigned int j, num_frames, frame_size;
> @@ -365,7 +365,7 @@ int hdm_add_padding(struct most_dev *mdev, int channel, 
> struct mbo *mbo)
>   * This takes the INIC hardware specific padding bytes off a streaming
>   * channel's buffer.
>   */
> -int hdm_remove_padding(struct most_dev *mdev, int channel, struct mbo *mbo)
> +static int hdm_remove_padding(struct most_dev *mdev, int channel, struct mbo 
> *mbo)
>  {
>   unsigned int j, num_frames, frame_size;
>   struct most_channel_config *const conf = &mdev->conf[channel];
> @@ -644,7 +644,7 @@ static void hdm_read_completion(struct urb *urb)
>   *
>   * Context: Could in _some_ cases be interrupt!
>   */
> -int hdm_enqueue(struct most_interface *iface, int channel, struct mbo *mbo)
> +static int hdm_enqueue(struct most_interface *iface, int channel, struct mbo 
> *mbo)
>  {
>   struct most_dev *mdev;
>   struct buf_anchor *anchor;
> @@ -743,8 +743,8 @@ _error:
>   * @channel: channel ID
>   * @conf: structure that holds the configuration information
>   */
> -int hdm_configure_channel(struct most_interface *iface, int channel,
> -   struct most_channel_config *conf)
> +static int hdm_configure_channel(struct most_interface *iface, int channel,
> +  struct most_channel_config *conf)
>  {
>   unsigned int num_frames;
>   unsigned int frame_size;
> @@ -824,7 +824,7 @@ exit:
>   * This triggers the USB vendor requests to read the hardware address and
>   * the current link status of the attached device.
>   */
> -int hdm_update_netinfo(struct most_dev *mdev)
> +static int hdm_update_netinfo(struct most_dev *mdev)
>  {
>   struct device *dev = &mdev->usb_device->dev;
>   int i;
> @@ -873,7 +873,7 @@ int hdm_update_netinfo(struct most_dev *mdev)
>   * polls for the NI state of the INIC every 2 seconds.
>   *
>   */
> -void hdm_request_netinfo(struct most_interface *iface, int channel)
> +static void hdm_request_netinfo(struct most_interface *iface, int channel)
>  {
>   struct most_dev *mdev;
>  

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


Re: [PATCH] staging: wilc1000: Set all options in region debugfs file

2015-08-19 Thread Greg KH
On Wed, Aug 19, 2015 at 06:00:12PM +0530, Chandra Gorentla wrote:
> On Tue, Aug 18, 2015 at 08:01:00PM -0700, Greg KH wrote:
> > On Tue, Aug 18, 2015 at 10:32:17PM +0530, Chandra S Gorentla wrote:
> > > This patch allows setting all options in the module's debug region
> > > options file 'wilc_debug_region'.  This functionality allows the user
> > > to enable logging from all regions (initialization, locks, firmware
> > > etc.) of the driver.  Logging from the following regions is enabled
> > > during the driver initialization:
> > > 
> > > INIT_DBG, GENERIC_DBG, CFG80211_DBG, FIRM_DBG and HOSTAPD_DBG
> > > 
> > > Before this change, the numerical value set is equal first byte of 
> > > input minus 0x30 (ASCII value of '0').  Because of this, after a write 
> > > to this debugfs file, it is difficult to predict the regions on which
> > > logging is enabled.
> > > 
> > > The DBG_REGION_ALL now includes 3 additional regions TCP_ENH, SPIN_DEBUG
> > > and FIRM_DBG.
> > 
> > Why did you add these extra ones?
> I added them because there is code support them and to avoid a holes in
> the range of the options.

But why do you need to debug such things?

> > All of this should eventually just be deleted, as network drivers need
> > to use the networking driver debug interfaces, not their own crazy ones.
> In that case, can I assume that we are not going forward with this change?

I hope not, please work on fixing the driver up to work properly (i.e.
not with this type of stuff...)

thanks,

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


USB, TTY, char/misc, and Staging trees now closed for 4.3

2015-08-19 Thread Greg KH
Hi all,

Given that 4.2 will be out in a few days, it's time to close my trees
for new patches until 4.3-rc1 is out.

Please feel free to send me patches for these trees, but note that I'll
be ignoring them until 4.3-rc1 is out, at which point in time I'll start
reviewing them again and applying them to the various places they
belong.

thanks,

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


Re: [PATCH 1/9] staging: most: NULL comparison style

2015-08-19 Thread Frans Klaver
On Wed, Aug 19, 2015 at 12:00 PM, Sudip Mukherjee
 wrote:
> On Tue, Aug 18, 2015 at 01:31:00PM -0300, Fabio Estevam wrote:
>> On Tue, Aug 18, 2015 at 12:18 PM, Sudip Mukherjee
>>  wrote:
>> > According to the kernel coding style the NULL check should not be
>> > written as [variable] == NULL or [variable] != NULL.
>>
>> It seems this not documented in Documentation/CodingStyle .
> Yes, it is not in the CodingStyle file. But mostly it is the convention
> that is followed. And in CodingStyle file if you see the "The rationale
> for using gotos is:" section, you will see in the example function the
> test is done like: if (!buffer).
> Anyways, frankly speaking I know commit message is bad but I could not
> think of anything else other than the one I wrote. Any ideas please...

Maybe something like:

Although not made explicit in Documentation/CodingStyle, there seems
to be a preference for writing NULL tests as 'if (!var)' rather than
if (var == NULL). The coding style does explicitly prefer brevity, so
convert all NULL checks to follow this shorter approach.

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


Re: [PATCHv7 2/5] Staging: most: mostcore/core.c. Fix "Using plain integer as NULL pointer" warnings

2015-08-19 Thread Christian Gromm
On Fri, 14 Aug 2015 12:18:01 +0200
Adrian Remonda  wrote:

> This patch fixes the warning generated by sparse: "Using plain integer
> as NULL pointer" by replacing the pointer test against 0 with a logical test.
> 
> Signed-off-by: Adrian Remonda 
Acked-by: Christian Gromm 
> ---
>  drivers/staging/most/mostcore/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/most/mostcore/core.c 
> b/drivers/staging/most/mostcore/core.c
> index fa9c19b65a5c..7bb16db42893 100644
> --- a/drivers/staging/most/mostcore/core.c
> +++ b/drivers/staging/most/mostcore/core.c
> @@ -982,7 +982,7 @@ static ssize_t store_add_link(struct most_aim_obj 
> *aim_obj,
>   if (ret)
>   return ret;
>  
> - if (mdev_devnod == 0 || *mdev_devnod == 0) {
> + if (!mdev_devnod || *mdev_devnod == 0) {
>   snprintf(devnod_buf, sizeof(devnod_buf), "%s-%s", mdev, 
> mdev_ch);
>   mdev_devnod = devnod_buf;
>   }

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


Re: [PATCHv7 1/5] Staging: most: mostcore/core.c. Fix "missing static keyword" warnings

2015-08-19 Thread Christian Gromm
On Fri, 14 Aug 2015 12:18:00 +0200
Adrian Remonda  wrote:

> This is a patch to the mostcore/core.c file. It makes
> several local functions and structures static to prevent global
> visibility.
> 
> Signed-off-by: Adrian Remonda 
Acked-by: Christian Gromm 
> ---
>  drivers/staging/most/mostcore/core.c | 15 ---
>  1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/most/mostcore/core.c 
> b/drivers/staging/most/mostcore/core.c
> index f4fea8cf5560..fa9c19b65a5c 100644
> --- a/drivers/staging/most/mostcore/core.c
> +++ b/drivers/staging/most/mostcore/core.c
> @@ -178,7 +178,7 @@ static void most_free_mbo_coherent(struct mbo *mbo)
>   * flush_channel_fifos - clear the channel fifos
>   * @c: pointer to channel object
>   */
> -void flush_channel_fifos(struct most_c_obj *c)
> +static void flush_channel_fifos(struct most_c_obj *c)
>  {
>   unsigned long flags, hf_flags;
>   struct mbo *mbo, *tmp;
> @@ -888,7 +888,7 @@ static ssize_t show_add_link(struct most_aim_obj *aim_obj,
>   * Input: "mdev0:ch0@ep_81"
>   * Output: *a -> "mdev0", *b -> "ch0@ep_81", *c == NULL
>   */
> -int split_string(char *buf, char **a, char **b, char **c)
> +static int split_string(char *buf, char **a, char **b, char **c)
>  {
>   *a = strsep(&buf, ":");
>   if (!*a)
> @@ -1006,7 +1006,7 @@ static ssize_t store_add_link(struct most_aim_obj 
> *aim_obj,
>   return len;
>  }
>  
> -struct most_aim_attribute most_aim_attr_add_link =
> +static struct most_aim_attribute most_aim_attr_add_link =
>   __ATTR(add_link, S_IRUGO | S_IWUSR, show_add_link, store_add_link);
>  
>  static ssize_t show_remove_link(struct most_aim_obj *aim_obj,
> @@ -1057,7 +1057,7 @@ static ssize_t store_remove_link(struct most_aim_obj 
> *aim_obj,
>   return len;
>  }
>  
> -struct most_aim_attribute most_aim_attr_remove_link =
> +static struct most_aim_attribute most_aim_attr_remove_link =
>   __ATTR(remove_link, S_IRUGO | S_IWUSR, show_remove_link, 
> store_remove_link);
>  
>  static struct attribute *most_aim_def_attrs[] = {
> @@ -1121,14 +1121,14 @@ static void destroy_most_aim_obj(struct most_aim_obj 
> *p)
>  /**
>   * Instantiation of the MOST bus
>   */
> -struct bus_type most_bus = {
> +static struct bus_type most_bus = {
>   .name = "most",
>  };
>  
>  /**
>   * Instantiation of the core driver
>   */
> -struct device_driver mostcore = {
> +static struct device_driver mostcore = {
>   .name = "mostcore",
>   .bus = &most_bus,
>  };
> @@ -1255,7 +1255,8 @@ static void arm_mbo(struct mbo *mbo)
>   *
>   * Returns the number of allocated and enqueued MBOs.
>   */
> -int arm_mbo_chain(struct most_c_obj *c, int dir, void (*compl)(struct mbo *))
> +static int arm_mbo_chain(struct most_c_obj *c, int dir,
> +  void (*compl)(struct mbo *))
>  {
>   unsigned int i;
>   int retval;

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


Re: [PATCH] staging: wilc1000: Set all options in region debugfs file

2015-08-19 Thread Chandra Gorentla
On Tue, Aug 18, 2015 at 08:01:00PM -0700, Greg KH wrote:
> On Tue, Aug 18, 2015 at 10:32:17PM +0530, Chandra S Gorentla wrote:
> > This patch allows setting all options in the module's debug region
> > options file 'wilc_debug_region'.  This functionality allows the user
> > to enable logging from all regions (initialization, locks, firmware
> > etc.) of the driver.  Logging from the following regions is enabled
> > during the driver initialization:
> > 
> > INIT_DBG, GENERIC_DBG, CFG80211_DBG, FIRM_DBG and HOSTAPD_DBG
> > 
> > Before this change, the numerical value set is equal first byte of 
> > input minus 0x30 (ASCII value of '0').  Because of this, after a write 
> > to this debugfs file, it is difficult to predict the regions on which
> > logging is enabled.
> > 
> > The DBG_REGION_ALL now includes 3 additional regions TCP_ENH, SPIN_DEBUG
> > and FIRM_DBG.
> 
> Why did you add these extra ones?
I added them because there is code support them and to avoid a holes in
the range of the options.
> 
> All of this should eventually just be deleted, as network drivers need
> to use the networking driver debug interfaces, not their own crazy ones.
In that case, can I assume that we are not going forward with this change?
> 
> thanks,
> 
> greg k-h

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


[PATCH v6 8/8] [media] media: rename the function that create pad links

2015-08-19 Thread Mauro Carvalho Chehab
Now that a link can be either between two different graph
objects, we'll need to add more functions to create links.
So, rename the existing one that create links only between
two pads as media_create_pad_link().

No functional changes.

This patch was created via this shell script:
for i in $(find drivers/media -name '*.[ch]' -type f) $(find 
drivers/staging/media -name '*.[ch]' -type f) $(find include/ -name '*.h' -type 
f) ; do sed s,media_entity_create_link,media_create_pad_link,g <$i >a && mv a 
$i; done

Signed-off-by: Mauro Carvalho Chehab 
Acked-by: Hans Verkuil 

diff --git a/Documentation/media-framework.txt 
b/Documentation/media-framework.txt
index 6903b2503577..b424de6c3bb3 100644
--- a/Documentation/media-framework.txt
+++ b/Documentation/media-framework.txt
@@ -199,7 +199,7 @@ pre-allocated and grows dynamically as needed.
 
 Drivers create links by calling
 
-   media_entity_create_link(struct media_entity *source, u16 source_pad,
+   media_create_pad_link(struct media_entity *source, u16 source_pad,
 struct media_entity *sink,   u16 sink_pad,
 u32 flags);
 
diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c
index 2fdcbb5f000a..65f59f2124b4 100644
--- a/drivers/media/dvb-core/dvbdev.c
+++ b/drivers/media/dvb-core/dvbdev.c
@@ -412,16 +412,16 @@ void dvb_create_media_graph(struct dvb_adapter *adap)
}
 
if (tuner && fe)
-   media_entity_create_link(tuner, 0, fe, 0, 0);
+   media_create_pad_link(tuner, 0, fe, 0, 0);
 
if (fe && demux)
-   media_entity_create_link(fe, 1, demux, 0, MEDIA_LNK_FL_ENABLED);
+   media_create_pad_link(fe, 1, demux, 0, MEDIA_LNK_FL_ENABLED);
 
if (demux && dvr)
-   media_entity_create_link(demux, 1, dvr, 0, 
MEDIA_LNK_FL_ENABLED);
+   media_create_pad_link(demux, 1, dvr, 0, MEDIA_LNK_FL_ENABLED);
 
if (demux && ca)
-   media_entity_create_link(demux, 1, ca, 0, MEDIA_LNK_FL_ENABLED);
+   media_create_pad_link(demux, 1, ca, 0, MEDIA_LNK_FL_ENABLED);
 }
 EXPORT_SYMBOL_GPL(dvb_create_media_graph);
 #endif
diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-core.c 
b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
index 6d167428727d..c81bfbfea32f 100644
--- a/drivers/media/i2c/s5c73m3/s5c73m3-core.c
+++ b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
@@ -1482,11 +1482,11 @@ static int s5c73m3_oif_registered(struct v4l2_subdev 
*sd)
return ret;
}
 
-   ret = media_entity_create_link(&state->sensor_sd.entity,
+   ret = media_create_pad_link(&state->sensor_sd.entity,
S5C73M3_ISP_PAD, &state->oif_sd.entity, OIF_ISP_PAD,
MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED);
 
-   ret = media_entity_create_link(&state->sensor_sd.entity,
+   ret = media_create_pad_link(&state->sensor_sd.entity,
S5C73M3_JPEG_PAD, &state->oif_sd.entity, OIF_JPEG_PAD,
MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED);
 
diff --git a/drivers/media/i2c/s5k5baf.c b/drivers/media/i2c/s5k5baf.c
index 30a9ca62e034..d3bff30bcb6f 100644
--- a/drivers/media/i2c/s5k5baf.c
+++ b/drivers/media/i2c/s5k5baf.c
@@ -1756,7 +1756,7 @@ static int s5k5baf_registered(struct v4l2_subdev *sd)
v4l2_err(sd, "failed to register subdev %s\n",
 state->cis_sd.name);
else
-   ret = media_entity_create_link(&state->cis_sd.entity, PAD_CIS,
+   ret = media_create_pad_link(&state->cis_sd.entity, PAD_CIS,
   &state->sd.entity, PAD_CIS,
   MEDIA_LNK_FL_IMMUTABLE |
   MEDIA_LNK_FL_ENABLED);
diff --git a/drivers/media/i2c/smiapp/smiapp-core.c 
b/drivers/media/i2c/smiapp/smiapp-core.c
index 308613ea0aed..5aa49eb393a9 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -2495,7 +2495,7 @@ static int smiapp_register_subdevs(struct smiapp_sensor 
*sensor)
return rval;
}
 
-   rval = media_entity_create_link(&this->sd.entity,
+   rval = media_create_pad_link(&this->sd.entity,
this->source_pad,
&last->sd.entity,
last->sink_pad,
@@ -2503,7 +2503,7 @@ static int smiapp_register_subdevs(struct smiapp_sensor 
*sensor)
MEDIA_LNK_FL_IMMUTABLE);
if (rval) {
dev_err(&client->dev,
-   "media_entity_create_link failed\n");
+   "media_create_pad_link failed\n");
return rval;
}

Re: [PATCHv2 19/19] staging: rtl8192u: r8192U_core: fix line over 80 characters code style issue

2015-08-19 Thread Dan Carpenter
On Tue, Aug 18, 2015 at 12:58:20PM -0400, Raphaël Beamonte wrote:
> Light code refactoring to keep the lines under 80 characters to follow
> the kernel code style.
> 

The first patches seem fine but this one is too hard to review...
Divide it up somehow.  Maybe:

patch #1: comments
patch #2: add line breaks
patch #3: add temporary variables
patch #4: reverse conditions

I have looked through this patch a little, and I am skepitcal of some
of these changes.  Do they really improve readability?


-   if (TempCCk == 
priv->cck_txbbgain_table[i].ccktxbb_valuearray[0]) {
-   
priv->cck_present_attentuation_20Mdefault = (u8)i;
-   break;
-   }
+   if (TempCCk !=
+   priv->cck_txbbgain_table[i].
+   ccktxbb_valuearray[0])
+   continue;


regards,
dan carpenter

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


Re: [PATCH] staging: dgnc: take lock when storing value in dgnc_poll_tick

2015-08-19 Thread Dan Carpenter
On Tue, Aug 18, 2015 at 08:37:21PM +0100, Salah Triki wrote:
> @@ -57,11 +57,17 @@ static ssize_t dgnc_driver_pollrate_store(struct 
> device_driver *ddp,
> const char *buf, size_t count)
>  {
>   int ret;
> + unsigned long flags;
>  
> + spin_lock_irqsave(&dgnc_poll_lock, flags);
>   ret = sscanf(buf, "%d\n", &dgnc_poll_tick);
>   if (ret != 1)
> - return -EINVAL;
> - return count;
> + ret = -EINVAL;
> + else
> + ret = count;
> + spin_unlock_irqrestore(&dgnc_poll_lock, flags);
> +
> + return ret;
>  }

Looks basically ok, but I wonder if it would be better to use a
temporary buffer for the sscanf.

unsigned long flags;
int tick;
int ret;

ret = sscanf(buf, "%d\n", &tick);
if (ret != 1)
return -EINVAL;

spin_lock_irqsave(&dgnc_poll_lock, flags);
dgnc_poll_tick = tick;
spin_unlock_irqrestore(&dgnc_poll_lock, flags);

return count;

regards,
dan carpenter

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


Re: [PATCH 5/5] staging: wilc1000: use id value as argument

2015-08-19 Thread Dan Carpenter

> Real ID value means the value mapped to an alive NIC handler.

Who is mapping it?  It's all within the driver so it is not "real"
unless there external requirements.

> And when the driver transmits and receives some data frame with chipset,
> the ID is used to distinguish the data frame's owner. Just like the driver,
> chipset uses the appointed identifier. the data frame always includes the
> identifier.

Yes.  But it uses whatever we give it, otherwise it will break when we
change this.

> You know, current driver is using 32bit pointer address as the identifier.
> So, this patch converts the address value to integer value. As mentioned
> earlier, '0' value is the reserved value to terminate an alive NIC handler
> and inform it to chipset.

Ah... I see now.  In the original code we used pointers and NULL meant
disconnect.  Now we are using integers but we still want zero to be
disconnect.  Fine, just make the array one pointer larger, it's not
worth the extra headache (the first version had off by one bugs, and the
second version still had an off by one bug even after I pointed them out
in the first version), just to save 8 bytes:

/* Zero is not used, because a zero ID means disconnect */
static tstrWILC_WFIDrv *wfidrv_list[NUM_CONCURRENT_IFC + 1];

static int add_handler_in_list(tstrWILC_WFIDrv *handler)
{
int i;

for (i = 1; i < ARRAY_SIZE(wfidrv_list); i++) {
if (!wfidrv_list[i]) {
wfidrv_list[i] = handler;
return 0;
}
}

return -ENOBUFS;
}

static int remove_handler_in_list(tstrWILC_WFIDrv *handler)
{
int i;

for (i = 1; i < ARRAY_SIZE(wfidrv_list); i++) {
if (wfidrv_list[i] == handler) {
wfidrv_list[i] = NULL;
return 0;
}
}

return -EINVAL;
}

static int get_id_from_handler(tstrWILC_WFIDrv *handler)
{
int i;

if (!handler)
return 0;

for (i = 1; i < ARRAY_SIZE(wfidrv_list); i++) {
if (wfidrv_list[i] == handler)
return i;
}

return 0;
}

static tstrWILC_WFIDrv *get_handler_from_id(int id)
{
if (id <= 0 || id >= ARRAY_SIZE(wfidrv_list))
return NULL;

return wfidrv_list[id];
}

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


Re: [PATCH 1/9] staging: most: NULL comparison style

2015-08-19 Thread Sudip Mukherjee
On Tue, Aug 18, 2015 at 01:31:00PM -0300, Fabio Estevam wrote:
> On Tue, Aug 18, 2015 at 12:18 PM, Sudip Mukherjee
>  wrote:
> > According to the kernel coding style the NULL check should not be
> > written as [variable] == NULL or [variable] != NULL.
> 
> It seems this not documented in Documentation/CodingStyle .
Yes, it is not in the CodingStyle file. But mostly it is the convention
that is followed. And in CodingStyle file if you see the "The rationale
for using gotos is:" section, you will see in the example function the
test is done like: if (!buffer).
Anyways, frankly speaking I know commit message is bad but I could not
think of anything else other than the one I wrote. Any ideas please...

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


[PATCH] drivers: staging: dgap: fixed all the block comments styling issues

2015-08-19 Thread Panos Vlachos
Signed-off-by: Panos Vlachos 
---
 drivers/staging/dgap/dgap.c | 84 -
 1 file changed, 52 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 9112dd2..1cacd18 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -91,23 +91,23 @@ static uint dgap_poll_stop; /* Used to tell poller 
to stop */
 static struct timer_list dgap_poll_timer;
 
 /*
- SUPPORTED PRODUCTS
-
- Card Model   Number of Ports  Interface
- 
- Acceleport Xem   4 - 64  (EIA232 & EIA422)
- Acceleport Xr4 & 8   (EIA232)
- Acceleport Xr 9204 & 8   (EIA232)
- Acceleport C/X   8 - 128 (EIA232)
- Acceleport EPC/X 8 - 224 (EIA232)
- Acceleport Xr/4224 & 8   (EIA422)
- Acceleport 2r/9202   (EIA232)
- Acceleport 4r/9204   (EIA232)
- Acceleport 8r/9208   (EIA232)
-
- IBM 8-Port Asynchronous PCI Adapter  (EIA232)
- IBM 128-Port Asynchronous PCI Adapter(EIA232 & EIA422)
-*/
+ * SUPPORTED PRODUCTS
+ *
+ * Card Model   Number of Ports  Interface
+ * 
+ * Acceleport Xem   4 - 64  (EIA232 & EIA422)
+ * Acceleport Xr4 & 8   (EIA232)
+ * Acceleport Xr 9204 & 8   (EIA232)
+ * Acceleport C/X   8 - 128 (EIA232)
+ * Acceleport EPC/X 8 - 224 (EIA232)
+ * Acceleport Xr/4224 & 8   (EIA422)
+ * Acceleport 2r/9202   (EIA232)
+ * Acceleport 4r/9204   (EIA232)
+ * Acceleport 8r/9208   (EIA232)
+ *
+ * IBM 8-Port Asynchronous PCI Adapter  (EIA232)
+ * IBM 128-Port Asynchronous PCI Adapter(EIA232 & EIA422)
+ */
 
 static struct pci_device_id dgap_pci_tbl[] = {
{ DIGI_VID, PCI_DEV_XEM_DID,  PCI_ANY_ID, PCI_ANY_ID, 0, 0,  0 },
@@ -1494,13 +1494,15 @@ static void dgap_parity_scan(struct channel_t *ch, 
unsigned char *cbuf,
*len = count;
 }
 
-/*===
+/*
+ * ===
  *
  *  dgap_input - Process received data.
  *
  *  ch  - Pointer to channel structure.
  *
- *===*/
+ * ===
+ */
 
 static void dgap_input(struct channel_t *ch)
 {
@@ -1843,13 +1845,16 @@ static void dgap_carrier(struct channel_t *ch)
ch->ch_flags &= ~CH_CD;
 }
 
-/*===
+/*
+ * ===
  *
  *  dgap_event - FEP to host event processing routine.
  *
  *  bd - Board of current event.
  *
- *===*/
+ * ===
+ */
+
 static int dgap_event(struct board_t *bd)
 {
struct channel_t *ch;
@@ -2375,7 +2380,8 @@ schedule_poller:
add_timer(&dgap_poll_timer);
 }
 
-/*===
+/*
+ * ===
  *
  *  dgap_cmdb - Sends a 2 byte command to the FEP.
  *
@@ -2386,7 +2392,9 @@ schedule_poller:
  *  ncmds   - Wait until ncmds or fewer cmds are left
  *in the cmd buffer before returning.
  *
- *===*/
+ * ===
+ */
+
 static void dgap_cmdb(struct channel_t *ch, u8 cmd, u8 byte1,
u8 byte2, uint ncmds)
 {
@@ -2462,7 +2470,8 @@ static void dgap_cmdb(struct channel_t *ch, u8 cmd, u8 
byte1,
}
 }
 
-/*===
+/*
+ * ===
  *
  *  dgap_cmdw - Sends a 1 word command to the FEP.
  *
@@ -2472,7 +2481,9 @@ static void dgap_cmdb(struct channel_t *ch, u8 cmd, u8 
byte1,
  *  ncmds   - Wait until ncmds or fewer cmds are left
  *in the cmd buffer before returning.
  *
- *===*/
+ * ===
+ */
+
 static void dgap_cmdw(struct channel_t *ch, u8 c

Re: [PATCH RFC v5 8/8] [media] media: rename the function that create pad links

2015-08-19 Thread Hans Verkuil
On 08/18/2015 10:04 PM, Mauro Carvalho Chehab wrote:
> Now that a link can be either between two different graph
> objects, we'll need to add more functions to create links.
> So, rename the existing one that create links only between
> two pads as media_create_pad_link().
> 
> No functional changes.
> 
> This patch was created via this shell script:
>   for i in $(find drivers/media -name '*.[ch]' -type f) $(find 
> drivers/staging/media -name '*.[ch]' -type f) $(find include/ -name '*.h' 
> -type f) ; do sed s,media_entity_create_link,media_create_pad_link,g <$i >a 
> && mv a $i; done
> 
> Signed-off-by: Mauro Carvalho Chehab 
>

Acked-by: Hans Verkuil 

Thanks!

Hans

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


Re: [PATCH 5/5] staging: wilc1000: use id value as argument

2015-08-19 Thread Johnny Kim

Hello Dan.
On 2015년 08월 18일 18:12, Dan Carpenter wrote:

On Tue, Aug 18, 2015 at 12:10:53PM +0900, Johnny Kim wrote:

Hello Dan.

On 2015년 08월 13일 23:49, Dan Carpenter wrote:

On Thu, Aug 13, 2015 at 01:41:23PM +0900, Tony Cho wrote:

+static u32 get_id_from_handler(tstrWILC_WFIDrv *handler)
+{
+   u32 id;
+
+   if (!handler)
+   return 0;
+
+   for (id = 0; id < NUM_CONCURRENT_IFC; id++) {
+   if (wfidrv_list[id] == handler) {
+   id += 1;
+   break;
+   }
+   }
+
+   if (id > NUM_CONCURRENT_IFC)
+   return 0;
+   else
+   return id;
+}
+

This still has an off by one bug.  Just use zero offset arrays
throughout.

static int get_id_from_handler(tstrWILC_WFIDrv *handler)
{
int id;

if (!handler)
return -ENOBUFS;

for (id = 0; id < NUM_CONCURRENT_IFC; id++) {
if (wfidrv_list[id] == handler)
return id;
}

return -ENOBUFS;
}

Thanks for your review. The return value of this function has from 0 till 2.
1 and 2 value is real ID value. only 0 value is reserved to remove a
registered id.
But I also think that error handling should be added about the
overflowed value
as your opinion.

I thought we had created "id" here in this patch so we don't have to
pass function pointers through a u32 value (which can't fit a 64 bit
pointer).  What do you mean it is a "real ID value"?  Is it there in
the hardware spec?

Real ID value means the value mapped to an alive NIC handler.
And when the driver transmits and receives some data frame with chipset,
the ID is used to distinguish the data frame's owner. Just like the driver,
chipset uses the appointed identifier. the data frame always includes the
identifier.
You know, current driver is using 32bit pointer address as the identifier.
So, this patch converts the address value to integer value. As mentioned
earlier, '0' value is the reserved value to terminate an alive NIC handler
and inform it to chipset.

Anyway, this code is buggy and messy.  Please find a different way to
write it.


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


[PATCH 12/13] staging: wilc1000: rename WILC_MsgQueueRecv to wilc_mq_recv

2015-08-19 Thread Chaehyun Lim
This patch replaces WILC_MsgQueueRecv with wilc_mq_recv
to shorten function name and avoid CamelCase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 drivers/staging/wilc1000/wilc_msgqueue.c  | 2 +-
 drivers/staging/wilc1000/wilc_msgqueue.h  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 6be2348..f0a1383 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4332,7 +4332,7 @@ static int hostIFthread(void *pvArg)
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
 
while (1) {
-   WILC_MsgQueueRecv(&gMsgQHostIF, &strHostIFmsg, 
sizeof(tstrHostIFmsg), &u32Ret);
+   wilc_mq_recv(&gMsgQHostIF, &strHostIFmsg, 
sizeof(tstrHostIFmsg), &u32Ret);
pstrWFIDrv = (tstrWILC_WFIDrv *)strHostIFmsg.drvHandler;
if (strHostIFmsg.u16MsgId == HOST_IF_MSG_EXIT) {
PRINT_D(GENERIC_DBG, "THREAD: Exiting HostIfThread\n");
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index b5d230b..6015098 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -110,7 +110,7 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
  *  @note  copied from FLO glue implementatuion
  *  @version   1.0
  */
-int WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
+int wilc_mq_recv(WILC_MsgQueueHandle *pHandle,
 void *pvRecvBuffer, u32 u32RecvBufferSize,
 u32 *pu32ReceivedLength)
 {
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index 197b0a9..143fba4 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -63,7 +63,7 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
  *  @date  30 Aug 2010
  *  @version   1.0
  */
-int WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
+int wilc_mq_recv(WILC_MsgQueueHandle *pHandle,
 void *pvRecvBuffer, u32 u32RecvBufferSize,
 u32 *pu32ReceivedLength);
 
-- 
1.9.1

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


[PATCH 13/13] staging: wilc1000: rename WILC_MsgQueueDestroy to wilc_mq_destroy

2015-08-19 Thread Chaehyun Lim
This patch replaces WILC_MsgQueueDestroy to wilc_mq_destroy to
shorten function name and avoid CamelCase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 drivers/staging/wilc1000/wilc_msgqueue.c  | 2 +-
 drivers/staging/wilc1000/wilc_msgqueue.h  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index f0a1383..d411847 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -6616,7 +6616,7 @@ _fail_timer_2:
del_timer_sync(&pstrWFIDrv->hScanTimer);
kthread_stop(HostIFthreadHandler);
 _fail_mq_:
-   WILC_MsgQueueDestroy(&gMsgQHostIF);
+   wilc_mq_destroy(&gMsgQHostIF);
 _fail_:
return s32Error;
 
@@ -6717,7 +6717,7 @@ s32 host_int_deinit(tstrWILC_WFIDrv *hWFIDrv)
 
down(&hSemHostIFthrdEnd);
 
-   WILC_MsgQueueDestroy(&gMsgQHostIF);
+   wilc_mq_destroy(&gMsgQHostIF);
msgQ_created = 0;
}
 
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 6015098..76d2e63 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -24,7 +24,7 @@ int wilc_mq_create(WILC_MsgQueueHandle *pHandle)
  *  @note  copied from FLO glue implementatuion
  *  @version   1.0
  */
-int WILC_MsgQueueDestroy(WILC_MsgQueueHandle *pHandle)
+int wilc_mq_destroy(WILC_MsgQueueHandle *pHandle)
 {
pHandle->bExiting = true;
 
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index 143fba4..fc65dfe 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -76,6 +76,6 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle,
  *  @date  30 Aug 2010
  *  @version   1.0
  */
-int WILC_MsgQueueDestroy(WILC_MsgQueueHandle *pHandle);
+int wilc_mq_destroy(WILC_MsgQueueHandle *pHandle);
 
 #endif
-- 
1.9.1

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


[PATCH 11/13] staging: wilc1000: rename WILC_MsgQueueSend to wilc_mq_send

2015-08-19 Thread Chaehyun Lim
This patch replaces WILC_MsgQueueSend with wilc_mq_send to
shorten function name and avoid CamelCase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 98 +++
 drivers/staging/wilc1000/wilc_msgqueue.c  |  2 +-
 drivers/staging/wilc1000/wilc_msgqueue.h  |  2 +-
 3 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 159734f..6be2348 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3997,7 +3997,7 @@ static void ListenTimerCB(unsigned long arg)
strHostIFmsg.uniHostIFmsgBody.strHostIfRemainOnChan.u32ListenSessionID 
= pstrWFIDrv->strHostIfRemainOnChan.u32ListenSessionID;
 
/* send the message */
-   s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, 
sizeof(tstrHostIFmsg));
+   s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, 
sizeof(tstrHostIFmsg));
if (s32Error)
WILC_ERRORREPORT(s32Error, s32Error);
WILC_CATCH(s32Error)
@@ -4344,13 +4344,13 @@ static int hostIFthread(void *pvArg)
if ((!g_wilc_initialized)) {
PRINT_D(GENERIC_DBG, "--WAIT--");
usleep_range(200 * 1000, 200 * 1000);
-   WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, 
sizeof(tstrHostIFmsg));
+   wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, 
sizeof(tstrHostIFmsg));
continue;
}
 
if (strHostIFmsg.u16MsgId == HOST_IF_MSG_CONNECT && 
pstrWFIDrv->strWILC_UsrScanReq.pfUserScanResult != NULL) {
PRINT_D(HOSTINF_DBG, "Requeue connect request till scan 
done received\n");
-   WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, 
sizeof(tstrHostIFmsg));
+   wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, 
sizeof(tstrHostIFmsg));
usleep_range(2 * 1000, 2 * 1000);
continue;
}
@@ -4557,7 +4557,7 @@ static void TimerCB_Scan(unsigned long arg)
strHostIFmsg.u16MsgId = HOST_IF_MSG_SCAN_TIMER_FIRED;
 
/* send the message */
-   WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
+   wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
 }
 
 static void TimerCB_Connect(unsigned long arg)
@@ -4571,7 +4571,7 @@ static void TimerCB_Connect(unsigned long arg)
strHostIFmsg.u16MsgId = HOST_IF_MSG_CONNECT_TIMER_FIRED;
 
/* send the message */
-   WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
+   wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
 }
 
 
@@ -4642,7 +4642,7 @@ s32 host_int_remove_wep_key(tstrWILC_WFIDrv *hWFIDrv, u8 
u8keyIdx)
uniHostIFkeyAttr.strHostIFwepAttr.u8Wepidx = u8keyIdx;
 
/* send the message */
-   s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, 
sizeof(tstrHostIFmsg));
+   s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, 
sizeof(tstrHostIFmsg));
if (s32Error)
PRINT_ER("Error in sending message queue : Request to remove 
WEP key\n");
down(&(pstrWFIDrv->hSemTestKeyBlock));
@@ -4690,7 +4690,7 @@ s32 host_int_set_WEPDefaultKeyID(tstrWILC_WFIDrv 
*hWFIDrv, u8 u8Index)
uniHostIFkeyAttr.strHostIFwepAttr.u8Wepidx = u8Index;
 
/* send the message */
-   s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, 
sizeof(tstrHostIFmsg));
+   s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, 
sizeof(tstrHostIFmsg));
if (s32Error)
PRINT_ER("Error in sending message queue : Default key 
index\n");
down(&(pstrWFIDrv->hSemTestKeyBlock));
@@ -4757,7 +4757,7 @@ s32 host_int_add_wep_key_bss_sta(tstrWILC_WFIDrv 
*hWFIDrv, const u8 *pu8WepKey,
uniHostIFkeyAttr.strHostIFwepAttr.u8Wepidx = u8Keyidx;
 
/* send the message */
-   s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, 
sizeof(tstrHostIFmsg));
+   s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, 
sizeof(tstrHostIFmsg));
if (s32Error)
PRINT_ER("Error in sending message queue :WEP Key\n");
down(&(pstrWFIDrv->hSemTestKeyBlock));
@@ -4832,7 +4832,7 @@ s32 host_int_add_wep_key_bss_ap(tstrWILC_WFIDrv *hWFIDrv, 
const u8 *pu8WepKey, u
strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.
uniHostIFkeyAttr.strHostIFwepAttr.tenuAuth_type = tenuAuth_type;
/* send the message */
-   s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, 
sizeof(tstrHostIFmsg));
+   s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, 
sizeof(tstrHostIFmsg));
 
if (s32Error)
PRINT_ER("Error in sending message queue :WEP Key\n");
@@ -4931,7 +4931,7 @@ s32 host_int_add_ptk(tstrWILC_WFIDrv *hWFIDrv, const u8 
*pu8Ptk, u8 u8PtkKeylen,
 

[PATCH 10/13] staging: wilc1000: rename WILC_MsgQueueCreate to wilc_mq_create

2015-08-19 Thread Chaehyun Lim
This patch replaces WILC_MsgQueueCreate with wilc_mq_create to
shorten function name and avoid CamelCase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 drivers/staging/wilc1000/wilc_msgqueue.c  | 2 +-
 drivers/staging/wilc1000/wilc_msgqueue.h  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 66fa677..159734f 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -6532,7 +6532,7 @@ s32 host_int_init(tstrWILC_WFIDrv **phWFIDrv)
PRINT_D(HOSTINF_DBG, "INIT: CLIENT COUNT %d\n", clients_count);
 
if (clients_count == 0) {
-   s32Error = WILC_MsgQueueCreate(&gMsgQHostIF);
+   s32Error = wilc_mq_create(&gMsgQHostIF);
 
if (s32Error < 0) {
PRINT_ER("Failed to creat MQ\n");
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index f528f98..0358099 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -8,7 +8,7 @@
  *  @note  copied from FLO glue implementatuion
  *  @version   1.0
  */
-int WILC_MsgQueueCreate(WILC_MsgQueueHandle *pHandle)
+int wilc_mq_create(WILC_MsgQueueHandle *pHandle)
 {
spin_lock_init(&pHandle->strCriticalSection);
sema_init(&pHandle->hSem, 0);
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index a32c6db..555aa02 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -27,7 +27,7 @@
  *  @date  30 Aug 2010
  *  @version   1.0
  */
-int WILC_MsgQueueCreate(WILC_MsgQueueHandle *pHandle);
+int wilc_mq_create(WILC_MsgQueueHandle *pHandle);
 
 /*!
  *  @brief Sends a message
-- 
1.9.1

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


[PATCH 06/13] staging: wilc1000: wilc_msgqueue.c: use ! operator instead of NULL comparison

2015-08-19 Thread Chaehyun Lim
This patch uses ! operator instead of NULL comparison.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 53ce586..0770ff6 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -34,7 +34,7 @@ WILC_ErrNo WILC_MsgQueueDestroy(WILC_MsgQueueHandle *pHandle)
pHandle->u32ReceiversCount--;
}
 
-   while (pHandle->pstrMessageList != NULL) {
+   while (pHandle->pstrMessageList) {
Message *pstrMessge = pHandle->pstrMessageList->pstrNext;
 
kfree(pHandle->pstrMessageList);
@@ -57,7 +57,7 @@ WILC_ErrNo WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
unsigned long flags;
Message *pstrMessage = NULL;
 
-   if ((pHandle == NULL) || (u32SendBufferSize == 0) || (pvSendBuffer == 
NULL)) {
+   if ((!pHandle) || (u32SendBufferSize == 0) || (!pvSendBuffer)) {
WILC_ERRORREPORT(s32RetStatus, WILC_INVALID_ARGUMENT);
}
 
@@ -77,12 +77,12 @@ WILC_ErrNo WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
memcpy(pstrMessage->pvBuffer, pvSendBuffer, u32SendBufferSize);
 
/* add it to the message queue */
-   if (pHandle->pstrMessageList == NULL) {
+   if (!pHandle->pstrMessageList) {
pHandle->pstrMessageList  = pstrMessage;
} else {
Message *pstrTailMsg = pHandle->pstrMessageList;
 
-   while (pstrTailMsg->pstrNext != NULL)
+   while (pstrTailMsg->pstrNext)
pstrTailMsg = pstrTailMsg->pstrNext;
 
pstrTailMsg->pstrNext = pstrMessage;
@@ -95,8 +95,8 @@ WILC_ErrNo WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
WILC_CATCH(s32RetStatus)
{
/* error occured, free any allocations */
-   if (pstrMessage != NULL) {
-   if (pstrMessage->pvBuffer != NULL)
+   if (pstrMessage) {
+   if (pstrMessage->pvBuffer)
kfree(pstrMessage->pvBuffer);
 
kfree(pstrMessage);
@@ -120,8 +120,8 @@ WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
WILC_ErrNo s32RetStatus = WILC_SUCCESS;
unsigned long flags;
 
-   if ((pHandle == NULL) || (u32RecvBufferSize == 0)
-   || (pvRecvBuffer == NULL) || (pu32ReceivedLength == NULL)) {
+   if ((!pHandle) || (u32RecvBufferSize == 0)
+   || (!pvRecvBuffer) || (!pu32ReceivedLength)) {
WILC_ERRORREPORT(s32RetStatus, WILC_INVALID_ARGUMENT);
}
 
@@ -151,7 +151,7 @@ WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
spin_lock_irqsave(&pHandle->strCriticalSection, flags);
 
pstrMessage = pHandle->pstrMessageList;
-   if (pstrMessage == NULL) {
+   if (!pstrMessage) {
spin_unlock_irqrestore(&pHandle->strCriticalSection, 
flags);
WILC_ERRORREPORT(s32RetStatus, WILC_FAIL);
}
-- 
1.9.1

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


[PATCH 07/13] staging: wilc1000: wilc_msgqueue.c: remove kfree NULL check

2015-08-19 Thread Chaehyun Lim
This patch removes kfree NULL check.
WARNING: kfree(NULL) is safe and this check is probably not required.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 0770ff6..d97dd70 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -96,9 +96,7 @@ WILC_ErrNo WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
{
/* error occured, free any allocations */
if (pstrMessage) {
-   if (pstrMessage->pvBuffer)
-   kfree(pstrMessage->pvBuffer);
-
+   kfree(pstrMessage->pvBuffer);
kfree(pstrMessage);
}
}
-- 
1.9.1

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


[PATCH 09/13] staging: wilc1000: replace WILC_ErrNo by int type

2015-08-19 Thread Chaehyun Lim
This patch replaces WILC_ErrNo with int type.
WILC_ErrNo typedef is also removed.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_errorsupport.h |  2 --
 drivers/staging/wilc1000/wilc_msgqueue.c | 12 ++--
 drivers/staging/wilc1000/wilc_msgqueue.h |  8 
 3 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_errorsupport.h 
b/drivers/staging/wilc1000/wilc_errorsupport.h
index b9517dc..6012ec4 100644
--- a/drivers/staging/wilc1000/wilc_errorsupport.h
+++ b/drivers/staging/wilc1000/wilc_errorsupport.h
@@ -36,8 +36,6 @@
 #define WILC_FILE_EOF  -116
 
 
-/* Error type */
-typedef s32 WILC_ErrNo;
 
 #define WILC_IS_ERR(__status__) (__status__ < WILC_SUCCESS)
 
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index f974f85..f528f98 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -8,7 +8,7 @@
  *  @note  copied from FLO glue implementatuion
  *  @version   1.0
  */
-WILC_ErrNo WILC_MsgQueueCreate(WILC_MsgQueueHandle *pHandle)
+int WILC_MsgQueueCreate(WILC_MsgQueueHandle *pHandle)
 {
spin_lock_init(&pHandle->strCriticalSection);
sema_init(&pHandle->hSem, 0);
@@ -24,7 +24,7 @@ WILC_ErrNo WILC_MsgQueueCreate(WILC_MsgQueueHandle *pHandle)
  *  @note  copied from FLO glue implementatuion
  *  @version   1.0
  */
-WILC_ErrNo WILC_MsgQueueDestroy(WILC_MsgQueueHandle *pHandle)
+int WILC_MsgQueueDestroy(WILC_MsgQueueHandle *pHandle)
 {
pHandle->bExiting = true;
 
@@ -50,10 +50,10 @@ WILC_ErrNo WILC_MsgQueueDestroy(WILC_MsgQueueHandle 
*pHandle)
  *  @note  copied from FLO glue implementatuion
  *  @version   1.0
  */
-WILC_ErrNo WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
+int WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
 const void *pvSendBuffer, u32 u32SendBufferSize)
 {
-   WILC_ErrNo s32RetStatus = WILC_SUCCESS;
+   int s32RetStatus = WILC_SUCCESS;
unsigned long flags;
Message *pstrMessage = NULL;
 
@@ -110,12 +110,12 @@ WILC_ErrNo WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
  *  @note  copied from FLO glue implementatuion
  *  @version   1.0
  */
-WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
+int WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
 void *pvRecvBuffer, u32 u32RecvBufferSize,
 u32 *pu32ReceivedLength)
 {
Message *pstrMessage;
-   WILC_ErrNo s32RetStatus = WILC_SUCCESS;
+   int s32RetStatus = WILC_SUCCESS;
unsigned long flags;
 
if ((!pHandle) || (u32RecvBufferSize == 0)
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index ef1d2fa..a32c6db 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -27,7 +27,7 @@
  *  @date  30 Aug 2010
  *  @version   1.0
  */
-WILC_ErrNo WILC_MsgQueueCreate(WILC_MsgQueueHandle *pHandle);
+int WILC_MsgQueueCreate(WILC_MsgQueueHandle *pHandle);
 
 /*!
  *  @brief Sends a message
@@ -44,7 +44,7 @@ WILC_ErrNo WILC_MsgQueueCreate(WILC_MsgQueueHandle *pHandle);
  *  @date  30 Aug 2010
  *  @version   1.0
  */
-WILC_ErrNo WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
+int WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
 const void *pvSendBuffer, u32 u32SendBufferSize);
 
 /*!
@@ -63,7 +63,7 @@ WILC_ErrNo WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
  *  @date  30 Aug 2010
  *  @version   1.0
  */
-WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
+int WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
 void *pvRecvBuffer, u32 u32RecvBufferSize,
 u32 *pu32ReceivedLength);
 
@@ -76,6 +76,6 @@ WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
  *  @date  30 Aug 2010
  *  @version   1.0
  */
-WILC_ErrNo WILC_MsgQueueDestroy(WILC_MsgQueueHandle *pHandle);
+int WILC_MsgQueueDestroy(WILC_MsgQueueHandle *pHandle);
 
 #endif
-- 
1.9.1

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


[PATCH 08/13] staging: wilc1000: wilc_msgqueue.c: fix bool comparison style

2015-08-19 Thread Chaehyun Lim
This patch changes bool comparison style found by checkpatch.pl
CHECK: Using comparison to true is error prone

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index d97dd70..f974f85 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -61,7 +61,7 @@ WILC_ErrNo WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
WILC_ERRORREPORT(s32RetStatus, WILC_INVALID_ARGUMENT);
}
 
-   if (pHandle->bExiting == true) {
+   if (pHandle->bExiting) {
WILC_ERRORREPORT(s32RetStatus, WILC_FAIL);
}
 
@@ -123,7 +123,7 @@ WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
WILC_ERRORREPORT(s32RetStatus, WILC_INVALID_ARGUMENT);
}
 
-   if (pHandle->bExiting == true) {
+   if (pHandle->bExiting) {
WILC_ERRORREPORT(s32RetStatus, WILC_FAIL);
}
 
-- 
1.9.1

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