Re: [PATCH 0/5] Replace data type declarations with variables of same types in several source files.

2016-10-16 Thread Alexander Alemayhu
On Mon, Oct 10, 2016 at 04:02:17PM +0200, Sergio Paracuellos wrote:
> This patch series replaces several sizeof(struct XXX) stuff in favour 
> of sizeof(var) which is the preferred one.
>

Why not squash this series into one patch? The commit messages are fairly
similar and the changes are focused into one area. Would be better with one
commit, IMO.

-- 
Mit freundlichen Grüßen

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


Re: [staging:staging-testing 275/275] /tmp/ccbrt8LJ.s:560: Error: missing immediate expression at operand 1 -- `dsb '

2016-10-16 Thread Greg Kroah-Hartman
On Sun, Oct 16, 2016 at 09:25:54AM +0800, kbuild test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
> staging-testing
> head:   07823993a309809c5107de94a892274bc984b92b
> commit: 07823993a309809c5107de94a892274bc984b92b [275/275] staging/vchi: 
> Remove dependency on CONFIG_BROKEN.
> config: arm64-allmodconfig (attached as .config)
> compiler: aarch64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
> reproduce:
> wget 
> https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
>  -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> git checkout 07823993a309809c5107de94a892274bc984b92b
> # save the attached .config to linux build tree
> make.cross ARCH=arm64 
> 
> All errors (new ones prefixed by >>):



Eric, I've dropped the patch that turns BROKEN off for this driver now,
and will be pushing it all to my branch that I can't rebase anymore.

I suggest working on this some more before we can turn that Kconfig
dependency off.

thanks,

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


[PATCH] staging: greybus: audio: Rename cport with intf_id

2016-10-16 Thread Pankaj Bharadiya
gb_audio_manager_module_descriptor's cport field is actually used to
manage and pass interface id to user space.

Thus rename gb_audio_manager_module_descriptor's 'cport' field and
few other things to avoid confusion.

Signed-off-by: Pankaj Bharadiya 
---
 drivers/staging/greybus/audio_manager.h|  2 +-
 drivers/staging/greybus/audio_manager_module.c | 20 ++--
 drivers/staging/greybus/audio_manager_sysfs.c  |  4 ++--
 drivers/staging/greybus/audio_module.c |  2 +-
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/greybus/audio_manager.h 
b/drivers/staging/greybus/audio_manager.h
index c4ca097..056088e 100644
--- a/drivers/staging/greybus/audio_manager.h
+++ b/drivers/staging/greybus/audio_manager.h
@@ -21,7 +21,7 @@ struct gb_audio_manager_module_descriptor {
int slot;
int vid;
int pid;
-   int cport;
+   int intf_id;
unsigned int ip_devices;
unsigned int op_devices;
 };
diff --git a/drivers/staging/greybus/audio_manager_module.c 
b/drivers/staging/greybus/audio_manager_module.c
index a10e96a..2bf40a9 100644
--- a/drivers/staging/greybus/audio_manager_module.c
+++ b/drivers/staging/greybus/audio_manager_module.c
@@ -111,16 +111,16 @@ static ssize_t gb_audio_module_pid_show(
 static struct gb_audio_manager_module_attribute gb_audio_module_pid_attribute =
__ATTR(pid, 0664, gb_audio_module_pid_show, NULL);
 
-static ssize_t gb_audio_module_cport_show(
+static ssize_t gb_audio_module_intf_id_show(
struct gb_audio_manager_module *module,
struct gb_audio_manager_module_attribute *attr, char *buf)
 {
-   return sprintf(buf, "%d", module->desc.cport);
+   return sprintf(buf, "%d", module->desc.intf_id);
 }
 
 static struct gb_audio_manager_module_attribute
-   gb_audio_module_cport_attribute =
-   __ATTR(cport, 0664, gb_audio_module_cport_show, NULL);
+   gb_audio_module_intf_id_attribute =
+   __ATTR(intf_id, 0664, gb_audio_module_intf_id_show, NULL);
 
 static ssize_t gb_audio_module_ip_devices_show(
struct gb_audio_manager_module *module,
@@ -149,7 +149,7 @@ static ssize_t gb_audio_module_op_devices_show(
&gb_audio_module_slot_attribute.attr,
&gb_audio_module_vid_attribute.attr,
&gb_audio_module_pid_attribute.attr,
-   &gb_audio_module_cport_attribute.attr,
+   &gb_audio_module_intf_id_attribute.attr,
&gb_audio_module_ip_devices_attribute.attr,
&gb_audio_module_op_devices_attribute.attr,
NULL,   /* need to NULL terminate the list of attributes */
@@ -167,7 +167,7 @@ static void send_add_uevent(struct gb_audio_manager_module 
*module)
char slot_string[64];
char vid_string[64];
char pid_string[64];
-   char cport_string[64];
+   char intf_id_string[64];
char ip_devices_string[64];
char op_devices_string[64];
 
@@ -176,7 +176,7 @@ static void send_add_uevent(struct gb_audio_manager_module 
*module)
slot_string,
vid_string,
pid_string,
-   cport_string,
+   intf_id_string,
ip_devices_string,
op_devices_string,
NULL
@@ -186,7 +186,7 @@ static void send_add_uevent(struct gb_audio_manager_module 
*module)
snprintf(slot_string, 64, "SLOT=%d", module->desc.slot);
snprintf(vid_string, 64, "VID=%d", module->desc.vid);
snprintf(pid_string, 64, "PID=%d", module->desc.pid);
-   snprintf(cport_string, 64, "CPORT=%d", module->desc.cport);
+   snprintf(intf_id_string, 64, "INTF_ID=%d", module->desc.intf_id);
snprintf(ip_devices_string, 64, "I/P DEVICES=0x%X",
 module->desc.ip_devices);
snprintf(op_devices_string, 64, "O/P DEVICES=0x%X",
@@ -246,13 +246,13 @@ int gb_audio_manager_module_create(
 
 void gb_audio_manager_module_dump(struct gb_audio_manager_module *module)
 {
-   pr_info("audio module #%d name=%s slot=%d vid=%d pid=%d cport=%d i/p 
devices=0x%X o/p devices=0x%X\n",
+   pr_info("audio module #%d name=%s slot=%d vid=%d pid=%d intf_id=%d i/p 
devices=0x%X o/p devices=0x%X\n",
module->id,
module->desc.name,
module->desc.slot,
module->desc.vid,
module->desc.pid,
-   module->desc.cport,
+   module->desc.intf_id,
module->desc.ip_devices,
module->desc.op_devices);
 }
diff --git a/drivers/staging/greybus/audio_manager_sysfs.c 
b/drivers/staging/greybus/audio_manager_sysfs.c
index d8bf859..feb195d 100644
--- a/drivers/staging/greybus/audio_manager_sysfs.c
+++ b/drivers/staging/greybus/audio_manager_sysfs.c
@@ -20,10 +20,10 @@ static ssize_t manager_sysfs_add_store(
 
int num = sscanf(buf,
"name=%" GB_AUDIO_MANAGER_MODULE_NAME_LEN_SSCANF "s "
-

[PATCH] Staging: dgnc: Clean up Macros

2016-10-16 Thread Siddhi Dave
Fix checkpatch warning: Macros with flow control statements should be avoided

Because Macros with flow control statements (goto and return) are
not very nice to read as any flow movement is unexpected.

Signed-off-by: Siddhi Dave 
---
 drivers/staging/dgnc/dgnc_sysfs.c | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_sysfs.c 
b/drivers/staging/dgnc/dgnc_sysfs.c
index 290bf6e..0767740 100644
--- a/drivers/staging/dgnc/dgnc_sysfs.c
+++ b/drivers/staging/dgnc/dgnc_sysfs.c
@@ -90,16 +90,16 @@ void dgnc_remove_driver_sysfiles(struct pci_driver 
*dgnc_driver)
driver_remove_file(driverfs, &driver_attr_pollrate);
 }
 
-#define DGNC_VERIFY_BOARD(p, bd)   \
-   do {\
-   if (!p) \
-   return 0;   \
-   \
-   bd = dev_get_drvdata(p);\
-   if (!bd || bd->magic != DGNC_BOARD_MAGIC)   \
-   return 0;   \
-   if (bd->state != BOARD_READY)   \
-   return 0;   \
+#define DGNC_VERIFY_BOARD(p, bd)
+do {
+   if (!p)
+   return 0;
+
+   bd = dev_get_drvdata(p);
+   if (!bd || bd->magic != DGNC_BOARD_MAGIC)
+   return 0;
+   if (bd->state != BOARD_READY)
+   return 0;
} while (0)
 
 static ssize_t vpd_show(struct device *p, struct device_attribute *attr,
-- 
2.7.4

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


[PATCH] Staging: dgnc: Clean up Macros

2016-10-16 Thread Siddhi Dave
Fix checkpatch warning: Macros with flow control statements should be avoided

Because Macros with flow control statements (goto and return) are
not very nice to read as any flow movement is unexpected.

Signed-off-by: Siddhi Dave 
---
 drivers/staging/dgnc/dgnc_sysfs.c | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_sysfs.c 
b/drivers/staging/dgnc/dgnc_sysfs.c
index 290bf6e..0767740 100644
--- a/drivers/staging/dgnc/dgnc_sysfs.c
+++ b/drivers/staging/dgnc/dgnc_sysfs.c
@@ -90,16 +90,16 @@ void dgnc_remove_driver_sysfiles(struct pci_driver 
*dgnc_driver)
driver_remove_file(driverfs, &driver_attr_pollrate);
 }
 
-#define DGNC_VERIFY_BOARD(p, bd)   \
-   do {\
-   if (!p) \
-   return 0;   \
-   \
-   bd = dev_get_drvdata(p);\
-   if (!bd || bd->magic != DGNC_BOARD_MAGIC)   \
-   return 0;   \
-   if (bd->state != BOARD_READY)   \
-   return 0;   \
+#define DGNC_VERIFY_BOARD(p, bd)
+do {
+   if (!p)
+   return 0;
+
+   bd = dev_get_drvdata(p);
+   if (!bd || bd->magic != DGNC_BOARD_MAGIC)
+   return 0;
+   if (bd->state != BOARD_READY)
+   return 0;
} while (0)
 
 static ssize_t vpd_show(struct device *p, struct device_attribute *attr,
-- 
2.7.4

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


[PATCH] Staging: dgnc: Clean up Macros

2016-10-16 Thread Siddhi Dave
Fix checkpatch warning: Macros with flow control statements should be avoided

Because Macros with flow control statements (goto and return) are
not very nice to read as any flow movement is unexpected.

Signed-off-by: Siddhi Dave 
---
 drivers/staging/dgnc/dgnc_sysfs.c | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_sysfs.c 
b/drivers/staging/dgnc/dgnc_sysfs.c
index 290bf6e..0767740 100644
--- a/drivers/staging/dgnc/dgnc_sysfs.c
+++ b/drivers/staging/dgnc/dgnc_sysfs.c
@@ -90,16 +90,16 @@ void dgnc_remove_driver_sysfiles(struct pci_driver 
*dgnc_driver)
driver_remove_file(driverfs, &driver_attr_pollrate);
 }
 
-#define DGNC_VERIFY_BOARD(p, bd)   \
-   do {\
-   if (!p) \
-   return 0;   \
-   \
-   bd = dev_get_drvdata(p);\
-   if (!bd || bd->magic != DGNC_BOARD_MAGIC)   \
-   return 0;   \
-   if (bd->state != BOARD_READY)   \
-   return 0;   \
+#define DGNC_VERIFY_BOARD(p, bd)
+do {
+   if (!p)
+   return 0;
+
+   bd = dev_get_drvdata(p);
+   if (!bd || bd->magic != DGNC_BOARD_MAGIC)
+   return 0;
+   if (bd->state != BOARD_READY)
+   return 0;
} while (0)
 
 static ssize_t vpd_show(struct device *p, struct device_attribute *attr,
-- 
2.7.4

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


Re: [Outreachy kernel] [PATCH] Staging: dgnc: Clean up Macros

2016-10-16 Thread Julia Lawall


On Sun, 16 Oct 2016, Siddhi Dave wrote:

> Fix checkpatch warning: Macros with flow control statements should be avoided
>
> Because Macros with flow control statements (goto and return) are
> not very nice to read as any flow movement is unexpected.
>
> Signed-off-by: Siddhi Dave 
> ---
>  drivers/staging/dgnc/dgnc_sysfs.c | 20 ++--
>  1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/staging/dgnc/dgnc_sysfs.c 
> b/drivers/staging/dgnc/dgnc_sysfs.c
> index 290bf6e..0767740 100644
> --- a/drivers/staging/dgnc/dgnc_sysfs.c
> +++ b/drivers/staging/dgnc/dgnc_sysfs.c
> @@ -90,16 +90,16 @@ void dgnc_remove_driver_sysfiles(struct pci_driver 
> *dgnc_driver)
>   driver_remove_file(driverfs, &driver_attr_pollrate);
>  }
>
> -#define DGNC_VERIFY_BOARD(p, bd) \
> - do {\
> - if (!p) \
> - return 0;   \
> - \
> - bd = dev_get_drvdata(p);\
> - if (!bd || bd->magic != DGNC_BOARD_MAGIC)   \
> - return 0;   \
> - if (bd->state != BOARD_READY)   \
> - return 0;   \
> +#define DGNC_VERIFY_BOARD(p, bd)
> +do {
> + if (!p)
> + return 0;
> +
> + bd = dev_get_drvdata(p);
> + if (!bd || bd->magic != DGNC_BOARD_MAGIC)
> + return 0;
> + if (bd->state != BOARD_READY)
> + return 0;
>   } while (0)

This does not look correct.  You are still sort of defining a macro,
except that you have dropped all of the \s.  A macro has to be defined on
a single line, or a line continued with \, so this would cause major
syntax errors.  I think that someone else worked on similar code and found
that some of the tests were also not needed in the context in which this
code is used.

julia

>
>  static ssize_t vpd_show(struct device *p, struct device_attribute *attr,
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups 
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to outreachy-kernel+unsubscr...@googlegroups.com.
> To post to this group, send email to outreachy-ker...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/outreachy-kernel/20161016124231.GA18162%40siddhi-home-laptop.
> For more options, visit https://groups.google.com/d/optout.
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: media: omap4iss: fixed coding style issues

2016-10-16 Thread Hector Roussille
Fixed coding style issues

Signed-off-by: Hector Roussille 
---
 drivers/staging/media/omap4iss/iss_video.c | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/omap4iss/iss_video.c 
b/drivers/staging/media/omap4iss/iss_video.c
index c16927a..8f2d374 100644
--- a/drivers/staging/media/omap4iss/iss_video.c
+++ b/drivers/staging/media/omap4iss/iss_video.c
@@ -297,8 +297,10 @@ iss_video_check_format(struct iss_video *video, struct 
iss_video_fh *vfh)
  */
 
 static int iss_video_queue_setup(struct vb2_queue *vq,
-unsigned int *count, unsigned int *num_planes,
-unsigned int sizes[], struct device 
*alloc_devs[])
+unsigned int *count,
+unsigned int *num_planes,
+unsigned int sizes[],
+struct device *alloc_devs[])
 {
struct iss_video_fh *vfh = vb2_get_drv_priv(vq);
struct iss_video *video = vfh->video;
@@ -678,9 +680,10 @@ iss_video_get_selection(struct file *file, void *fh, 
struct v4l2_selection *sel)
if (subdev == NULL)
return -EINVAL;
 
-   /* Try the get selection operation first and fallback to get format if 
not
-* implemented.
+   /* Try the get selection operation first and fallback to
+* get format if not implemented.
 */
+
sdsel.pad = pad;
ret = v4l2_subdev_call(subdev, pad, get_selection, NULL, &sdsel);
if (!ret)
-- 
2.10.0

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


[PATCH] staging: ks7010: Fix coding style errors

2016-10-16 Thread Carlos Maiolino
Fixes the following checkpatch.pl errors/warnings:

WARNING: please, no spaces at the start of a line
ERROR: space prohibited after that open parenthesis '('
ERROR: space prohibited before that close parenthesis ')'
ERROR: space required before the open brace '{'
ERROR: exactly one space required after that #ifdef
WARNING: Missing a blank line after declarations
ERROR: space prohibited after that '&' (ctx:WxW)
WARNING: braces {} are not necessary for single statement blocks
CHECK: No space is necessary after a cast
Signed-off-by: Carlos Maiolino 
---
 drivers/staging/ks7010/ks_hostif.c | 32 +---
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index c57ca58..e2277c5 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -23,11 +23,11 @@
 
 /* macro */
 #define inc_smeqhead(priv) \
-( priv->sme_i.qhead = (priv->sme_i.qhead + 1) % SME_EVENT_BUFF_SIZE )
+   (priv->sme_i.qhead = (priv->sme_i.qhead + 1) % SME_EVENT_BUFF_SIZE)
 #define inc_smeqtail(priv) \
-( priv->sme_i.qtail = (priv->sme_i.qtail + 1) % SME_EVENT_BUFF_SIZE )
+   (priv->sme_i.qtail = (priv->sme_i.qtail + 1) % SME_EVENT_BUFF_SIZE)
 #define cnt_smeqbody(priv) \
-(((priv->sme_i.qtail + SME_EVENT_BUFF_SIZE) - (priv->sme_i.qhead)) % 
SME_EVENT_BUFF_SIZE )
+   (((priv->sme_i.qtail + SME_EVENT_BUFF_SIZE) - (priv->sme_i.qhead)) % 
SME_EVENT_BUFF_SIZE)
 
 #define KS_WLAN_MEM_FLAG (GFP_ATOMIC)
 
@@ -97,11 +97,10 @@ int ks_wlan_do_power_save(struct ks_wlan_private *priv)
 {
DPRINTK(4, "psstatus.status=%d\n", atomic_read(&priv->psstatus.status));
 
-   if ((priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS) {
+   if ((priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS)
hostif_sme_enqueue(priv, SME_POW_MNGMT_REQUEST);
-   } else {
+   else
priv->dev_state = DEVICE_STATE_READY;
-   }
return 0;
 }
 
@@ -386,7 +385,7 @@ void hostif_data_indication(struct ks_wlan_private *priv)
   (priv->rxp) + ((priv->rx_size) - 8), 8);
priv->rx_size = priv->rx_size - 8;
if (auth_type > 0 && auth_type < 4) {   /* 
auth_type check */
-   MichaelMICFunction(&michel_mic, 
(uint8_t *) priv->wpa.key[auth_type - 1].rx_mic_key, (uint8_t *) priv->rxp, 
(int)priv->rx_size, (uint8_t) 0,/* priority */
+   MichaelMICFunction(&michel_mic, 
(uint8_t *)priv->wpa.key[auth_type - 1].rx_mic_key, (uint8_t *)priv->rxp, 
(int)priv->rx_size, (uint8_t)0,   /* priority */
   (uint8_t *)
   michel_mic.Result);
}
@@ -766,8 +765,9 @@ void hostif_sleep_confirm(struct ks_wlan_private *priv)
 static
 void hostif_start_confirm(struct ks_wlan_private *priv)
 {
-#ifdef  WPS
+#ifdef WPS
union iwreq_data wrqu;
+
wrqu.data.length = 0;
wrqu.data.flags = 0;
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
@@ -789,6 +789,7 @@ void hostif_connect_indication(struct ks_wlan_private *priv)
unsigned int old_status = priv->connect_status;
struct net_device *netdev = priv->net_dev;
union iwreq_data wrqu0;
+
connect_code = get_WORD(priv);
 
switch (connect_code) {
@@ -928,6 +929,7 @@ static
 void hostif_infrastructure_set_confirm(struct ks_wlan_private *priv)
 {
uint16_t result_code;
+
DPRINTK(3, "\n");
result_code = get_WORD(priv);
DPRINTK(3, "result code = %d\n", result_code);
@@ -993,6 +995,7 @@ void hostif_bss_scan_confirm(struct ks_wlan_private *priv)
unsigned int result_code;
struct net_device *dev = priv->net_dev;
union iwreq_data wrqu;
+
result_code = get_DWORD(priv);
DPRINTK(2, "result=%d :: scan_ind_count=%d\n", result_code,
priv->scan_ind_count);
@@ -1244,7 +1247,7 @@ int hostif_data_request(struct ks_wlan_private *priv, 
struct sk_buff *packet)
pp->auth_type = cpu_to_le16((uint16_t) TYPE_AUTH);  
/* no encryption */
} else {
if (priv->wpa.pairwise_suite == IW_AUTH_CIPHER_TKIP) {
-   MichaelMICFunction(&michel_mic, (uint8_t *) 
priv->wpa.key[0].tx_mic_key, (uint8_t *) & pp->data[0], (int)packet_len, 
(uint8_t) 0,   /* priority */
+   MichaelMICFunction(&michel_mic, (uint8_t 
*)priv->wpa.key[0].tx_mic_key, (uint8_t *)&pp->data[0], (int)packet_len, 
(uint8_t)0,   /* priority */
   (uint8_t *) michel_mic.
   Result);
memcpy(

Re: [PATCH] Staging: media: omap4iss: fixed coding style issues

2016-10-16 Thread Laurent Pinchart
Hi Hector,

Thank you for the patch.

On Sunday 16 Oct 2016 17:18:56 Hector Roussille wrote:
> Fixed coding style issues

What coding style issues ?

> 
> Signed-off-by: Hector Roussille 
> ---
>  drivers/staging/media/omap4iss/iss_video.c | 11 +++
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/media/omap4iss/iss_video.c
> b/drivers/staging/media/omap4iss/iss_video.c index c16927a..8f2d374 100644
> --- a/drivers/staging/media/omap4iss/iss_video.c
> +++ b/drivers/staging/media/omap4iss/iss_video.c
> @@ -297,8 +297,10 @@ iss_video_check_format(struct iss_video *video, struct
> iss_video_fh *vfh) */
> 
>  static int iss_video_queue_setup(struct vb2_queue *vq,
> -  unsigned int *count, unsigned int 
*num_planes,

This line doesn't exceed the 80 columns limit, no need to split it.

> -  unsigned int sizes[], struct device 
*alloc_devs[])
> +  unsigned int *count,
> +  unsigned int *num_planes,
> +  unsigned int sizes[],
> +  struct device *alloc_devs[])
>  {
>   struct iss_video_fh *vfh = vb2_get_drv_priv(vq);
>   struct iss_video *video = vfh->video;
> @@ -678,9 +680,10 @@ iss_video_get_selection(struct file *file, void *fh,
> struct v4l2_selection *sel) if (subdev == NULL)
>   return -EINVAL;
> 
> - /* Try the get selection operation first and fallback to get format if 
not
> -  * implemented.
> + /* Try the get selection operation first and fallback to

while do you split the line here and not right before the 80 columns limit ?

> +  * get format if not implemented.
>*/

This isn't the preferred comment style for the kernel, see 
http://lkml.iu.edu/hypermail/linux/kernel/1607.1/00627.html. The problem 
doesn't predate your patch, but while at it you might want to fix it through 
the driver.

> +

How does adding a blank line here fix a coding style issue ?

>   sdsel.pad = pad;
>   ret = v4l2_subdev_call(subdev, pad, get_selection, NULL, &sdsel);
>   if (!ret)

-- 
Regards,

Laurent Pinchart

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


Re: [PATCH] Staging: dgnc: Clean up Macros

2016-10-16 Thread Greg KH
On Sun, Oct 16, 2016 at 06:12:32PM +0530, Siddhi Dave wrote:
> Fix checkpatch warning: Macros with flow control statements should be avoided
> 
> Because Macros with flow control statements (goto and return) are
> not very nice to read as any flow movement is unexpected.
> 
> Signed-off-by: Siddhi Dave 
> ---
>  drivers/staging/dgnc/dgnc_sysfs.c | 20 ++--
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/staging/dgnc/dgnc_sysfs.c 
> b/drivers/staging/dgnc/dgnc_sysfs.c
> index 290bf6e..0767740 100644
> --- a/drivers/staging/dgnc/dgnc_sysfs.c
> +++ b/drivers/staging/dgnc/dgnc_sysfs.c
> @@ -90,16 +90,16 @@ void dgnc_remove_driver_sysfiles(struct pci_driver 
> *dgnc_driver)
>   driver_remove_file(driverfs, &driver_attr_pollrate);
>  }
>  
> -#define DGNC_VERIFY_BOARD(p, bd) \
> - do {\
> - if (!p) \
> - return 0;   \
> - \
> - bd = dev_get_drvdata(p);\
> - if (!bd || bd->magic != DGNC_BOARD_MAGIC)   \
> - return 0;   \
> - if (bd->state != BOARD_READY)   \
> - return 0;   \
> +#define DGNC_VERIFY_BOARD(p, bd)
> +do {
> + if (!p)
> + return 0;
> +
> + bd = dev_get_drvdata(p);
> + if (!bd || bd->magic != DGNC_BOARD_MAGIC)
> + return 0;
> + if (bd->state != BOARD_READY)
> + return 0;
>   } while (0)
>  
>  static ssize_t vpd_show(struct device *p, struct device_attribute *attr,

You didn't test-build this code, why not?

Also, please see the archives for why this type of change is not going
to be correct and I can't take it.

And finally, you sent 3 copies of this, why?

thanks,

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


Re: [PATCH 57/80] staging: lustre: osc: revise unstable pages accounting

2016-10-16 Thread Greg Kroah-Hartman
Digging up an old email...

On Tue, Aug 16, 2016 at 04:19:10PM -0400, James Simmons wrote:
> From: Jinshan Xiong 
> 
> A few changes are made in this patch for unstable pages tracking:
> 
> 1. Remove kernel NFS unstable pages tracking because it killed
>performance
> 2. Track unstable pages as part of LRU cache. Otherwise Lustre
>can use much more memory than max_cached_mb
> 3. Remove obd_unstable_pages tracking to avoid using global
>atomic counter
> 4. Make unstable pages track optional. Tracking unstable pages is
>turned off by default, and can be controlled by
>llite.*.unstable_stats.
> 
> Signed-off-by: Jinshan Xiong 
> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4841
> Reviewed-on: http://review.whamcloud.com/10003
> Reviewed-by: Andreas Dilger 
> Reviewed-by: Lai Siyao 
> Reviewed-by: Oleg Drokin 
> Signed-off-by: James Simmons 
> ---
>  drivers/staging/lustre/lustre/include/cl_object.h  |   35 +++-
>  .../staging/lustre/lustre/include/obd_support.h|1 -
>  drivers/staging/lustre/lustre/llite/lproc_llite.c  |   41 -
>  drivers/staging/lustre/lustre/obdclass/class_obd.c |2 -
>  drivers/staging/lustre/lustre/osc/osc_cache.c  |   96 +-
>  drivers/staging/lustre/lustre/osc/osc_internal.h   |2 +-
>  drivers/staging/lustre/lustre/osc/osc_page.c   |  208 
> +---
>  drivers/staging/lustre/lustre/osc/osc_request.c|   13 +-
>  8 files changed, 253 insertions(+), 145 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/include/cl_object.h 
> b/drivers/staging/lustre/lustre/include/cl_object.h
> index d269b32..ec6cf7c 100644
> --- a/drivers/staging/lustre/lustre/include/cl_object.h
> +++ b/drivers/staging/lustre/lustre/include/cl_object.h
> @@ -1039,23 +1039,32 @@ do {  
>   \
>   }\
>  } while (0)
>  
> -static inline int __page_in_use(const struct cl_page *page, int refc)
> -{
> - if (page->cp_type == CPT_CACHEABLE)
> - ++refc;
> - LASSERT(atomic_read(&page->cp_ref) > 0);
> - return (atomic_read(&page->cp_ref) > refc);
> -}
> -
> -#define cl_page_in_use(pg)   __page_in_use(pg, 1)
> -#define cl_page_in_use_noref(pg) __page_in_use(pg, 0)
> -
>  static inline struct page *cl_page_vmpage(struct cl_page *page)
>  {
>   LASSERT(page->cp_vmpage);
>   return page->cp_vmpage;
>  }
>  
> +/**
> + * Check if a cl_page is in use.
> + *
> + * Client cache holds a refcount, this refcount will be dropped when
> + * the page is taken out of cache, see vvp_page_delete().
> + */
> +static inline bool __page_in_use(const struct cl_page *page, int refc)
> +{
> + return (atomic_read(&page->cp_ref) > refc + 1);
> +}
> +
> +/**
> + * Caller itself holds a refcount of cl_page.
> + */
> +#define cl_page_in_use(pg)__page_in_use(pg, 1)
> +/**
> + * Caller doesn't hold a refcount.
> + */
> +#define cl_page_in_use_noref(pg) __page_in_use(pg, 0)
> +
>  /** @} cl_page */
>  
>  /** \addtogroup cl_lock cl_lock
> @@ -2331,6 +2340,10 @@ struct cl_client_cache {
>*/
>   spinlock_t  ccc_lru_lock;
>   /**
> +  * Set if unstable check is enabled
> +  */
> + unsigned intccc_unstable_check:1;
> + /**
>* # of unstable pages for this mount point
>*/
>   atomic_tccc_unstable_nr;
> diff --git a/drivers/staging/lustre/lustre/include/obd_support.h 
> b/drivers/staging/lustre/lustre/include/obd_support.h
> index 26fdff6..a11fff1 100644
> --- a/drivers/staging/lustre/lustre/include/obd_support.h
> +++ b/drivers/staging/lustre/lustre/include/obd_support.h
> @@ -54,7 +54,6 @@ extern int at_early_margin;
>  extern int at_extra;
>  extern unsigned int obd_sync_filter;
>  extern unsigned int obd_max_dirty_pages;
> -extern atomic_t obd_unstable_pages;
>  extern atomic_t obd_dirty_pages;
>  extern atomic_t obd_dirty_transit_pages;
>  extern char obd_jobid_var[];
> diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c 
> b/drivers/staging/lustre/lustre/llite/lproc_llite.c
> index 2f1f389..5f8e78d 100644
> --- a/drivers/staging/lustre/lustre/llite/lproc_llite.c
> +++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c
> @@ -828,10 +828,45 @@ static ssize_t unstable_stats_show(struct kobject *kobj,
>   pages = atomic_read(&cache->ccc_unstable_nr);
>   mb = (pages * PAGE_SIZE) >> 20;
>  
> - return sprintf(buf, "unstable_pages: %8d\n"
> - "unstable_mb:%8d\n", pages, mb);
> + return sprintf(buf, "unstable_check: %8d\n"
> + "unstable_pages: %8d\n"
> + "unstable_mb:%8d\n",
> + cache->ccc_unstable_check, pages, mb);
>  }
> -LUSTRE_RO_ATTR(unstable_stats);
> +
> +static ssize_t unstable_stats_store(struct kobject *kobj,
> + struct attribute *attr,
> +   

Re: [PATCH] staging: ks7010: Fix coding style errors

2016-10-16 Thread Greg KH
On Sun, Oct 16, 2016 at 05:23:51PM +0200, Carlos Maiolino wrote:
> Fixes the following checkpatch.pl errors/warnings:
> 
> WARNING: please, no spaces at the start of a line
> ERROR: space prohibited after that open parenthesis '('
> ERROR: space prohibited before that close parenthesis ')'
> ERROR: space required before the open brace '{'
> ERROR: exactly one space required after that #ifdef
> WARNING: Missing a blank line after declarations
> ERROR: space prohibited after that '&' (ctx:WxW)
> WARNING: braces {} are not necessary for single statement blocks
> CHECK: No space is necessary after a cast
> Signed-off-by: Carlos Maiolino 

That's a lot of different things all done in the same patch.  Please
break it up into "one logical thing per patch" and resend.

Also, we need a blank line before the signed-off-by line in order for
things to work properly.

thanks,

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


Re: [PATCH] Staging: media: omap4iss: fixed coding style issues

2016-10-16 Thread Greg KH
On Sun, Oct 16, 2016 at 05:18:56PM +0200, Hector Roussille wrote:
> Fixed coding style issues


You need to be a lot more specific please.

thanks,

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


[PATCH 1/2] staging: ks7010: Add blank line after declarations

2016-10-16 Thread Sabitha George
Fixes checkpatch.pl warning :Missing a blank line
after declarations

Signed-off-by: Sabitha George 
---
 drivers/staging/ks7010/ks_hostif.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index 1f9f63e..ad840f9 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -750,6 +750,7 @@ void hostif_start_confirm(struct ks_wlan_private *priv)
 {
 #ifdef WPS
union iwreq_data wrqu;
+
wrqu.data.length = 0;
wrqu.data.flags = 0;
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
@@ -771,6 +772,7 @@ void hostif_connect_indication(struct ks_wlan_private *priv)
unsigned int old_status = priv->connect_status;
struct net_device *netdev = priv->net_dev;
union iwreq_data wrqu0;
+
connect_code = get_WORD(priv);
 
switch (connect_code) {
@@ -910,6 +912,7 @@ void hostif_ps_adhoc_set_confirm(struct ks_wlan_private 
*priv)
 void hostif_infrastructure_set_confirm(struct ks_wlan_private *priv)
 {
uint16_t result_code;
+
DPRINTK(3, "\n");
result_code = get_WORD(priv);
DPRINTK(3, "result code = %d\n", result_code);
@@ -975,6 +978,7 @@ void hostif_bss_scan_confirm(struct ks_wlan_private *priv)
unsigned int result_code;
struct net_device *dev = priv->net_dev;
union iwreq_data wrqu;
+
result_code = get_DWORD(priv);
DPRINTK(2, "result=%d :: scan_ind_count=%d\n", result_code,
priv->scan_ind_count);
@@ -1872,6 +1876,7 @@ void hostif_receive(struct ks_wlan_private *priv, 
unsigned char *p,
 void hostif_sme_set_wep(struct ks_wlan_private *priv, int type)
 {
uint32_t val;
+
switch (type) {
case SME_WEP_INDEX_REQUEST:
val = cpu_to_le32((uint32_t) (priv->reg.wep_index));
@@ -2335,6 +2340,7 @@ void hostif_sme_sleep_set(struct ks_wlan_private *priv)
 void hostif_sme_set_key(struct ks_wlan_private *priv, int type)
 {
uint32_t val;
+
switch (type) {
case SME_SET_FLAG:
val = cpu_to_le32((uint32_t) (priv->reg.privacy_invoked));
-- 
1.9.1

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


[PATCH 2/2] staging: ks7010: Remove braces around single statement blocks

2016-10-16 Thread Sabitha George
Fixes checkpatch warning: braces{} are not necessary for
single statment blocks

Signed-off-by: Sabitha George 
---
 drivers/staging/ks7010/ks_hostif.c | 23 ---
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index ad840f9..cbf49c9 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -97,11 +97,10 @@ int ks_wlan_do_power_save(struct ks_wlan_private *priv)
 {
DPRINTK(4, "psstatus.status=%d\n", atomic_read(&priv->psstatus.status));
 
-   if ((priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS) {
+   if ((priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS)
hostif_sme_enqueue(priv, SME_POW_MNGMT_REQUEST);
-   } else {
+   else
priv->dev_state = DEVICE_STATE_READY;
-   }
return 0;
 }
 
@@ -687,15 +686,13 @@ void hostif_mib_set_confirm(struct ks_wlan_private *priv)
break;
case DOT11_GMK1_TSC:
DPRINTK(2, "DOT11_GMK1_TSC:mib_status=%d\n", (int)mib_status);
-   if (atomic_read(&priv->psstatus.snooze_guard)) {
+   if (atomic_read(&priv->psstatus.snooze_guard))
atomic_set(&priv->psstatus.snooze_guard, 0);
-   }
break;
case DOT11_GMK2_TSC:
DPRINTK(2, "DOT11_GMK2_TSC:mib_status=%d\n", (int)mib_status);
-   if (atomic_read(&priv->psstatus.snooze_guard)) {
+   if (atomic_read(&priv->psstatus.snooze_guard))
atomic_set(&priv->psstatus.snooze_guard, 0);
-   }
break;
case LOCAL_PMK:
DPRINTK(2, "LOCAL_PMK:mib_status=%d\n", (int)mib_status);
@@ -2436,9 +2433,8 @@ void hostif_sme_execute(struct ks_wlan_private *priv, int 
event)
DPRINTK(3, "event=%d\n", event);
switch (event) {
case SME_START:
-   if (priv->dev_state == DEVICE_STATE_BOOT) {
+   if (priv->dev_state == DEVICE_STATE_BOOT)
hostif_mib_get_request(priv, DOT11_MAC_ADDRESS);
-   }
break;
case SME_MULTICAST_REQUEST:
hostif_sme_multicast_set(priv);
@@ -2483,14 +2479,12 @@ void hostif_sme_execute(struct ks_wlan_private *priv, 
int event)
}
break;
case SME_GET_MAC_ADDRESS:
-   if (priv->dev_state == DEVICE_STATE_BOOT) {
+   if (priv->dev_state == DEVICE_STATE_BOOT)
hostif_mib_get_request(priv, DOT11_PRODUCT_VERSION);
-   }
break;
case SME_GET_PRODUCT_VERSION:
-   if (priv->dev_state == DEVICE_STATE_BOOT) {
+   if (priv->dev_state == DEVICE_STATE_BOOT)
priv->dev_state = DEVICE_STATE_PREINIT;
-   }
break;
case SME_STOP_REQUEST:
hostif_stop_request(priv);
@@ -2569,9 +2563,8 @@ void hostif_sme_execute(struct ks_wlan_private *priv, int 
event)
/* for power save */
atomic_set(&priv->psstatus.snooze_guard, 0);
atomic_set(&priv->psstatus.confirm_wait, 0);
-   if (priv->dev_state == DEVICE_STATE_PREINIT) {
+   if (priv->dev_state == DEVICE_STATE_PREINIT)
priv->dev_state = DEVICE_STATE_INIT;
-   }
/* wake_up_interruptible_all(&priv->confirm_wait); */
complete(&priv->confirm_wait);
break;
-- 
1.9.1

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


[PATCH] staging/lustre/llite: Move unstable_stats from sysfs to debugfs

2016-10-16 Thread Oleg Drokin
It's multiple values per file, so it has no business being in sysfs,
besides it was assuming seqfile anyway.

Introduced by
commit d806f30e639b ("staging: lustre: osc: revise unstable pages accounting")

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/lproc_llite.c | 34 +++
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c 
b/drivers/staging/lustre/lustre/llite/lproc_llite.c
index 6eae605..23fda9d 100644
--- a/drivers/staging/lustre/lustre/llite/lproc_llite.c
+++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c
@@ -871,12 +871,10 @@ static ssize_t xattr_cache_store(struct kobject *kobj,
 }
 LUSTRE_RW_ATTR(xattr_cache);
 
-static ssize_t unstable_stats_show(struct kobject *kobj,
-  struct attribute *attr,
-  char *buf)
+static int ll_unstable_stats_seq_show(struct seq_file *m, void *v)
 {
-   struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
- ll_kobj);
+   struct super_block *sb= m->private;
+   struct ll_sb_info  *sbi   = ll_s2sbi(sb);
struct cl_client_cache *cache = sbi->ll_cache;
long pages;
int mb;
@@ -884,19 +882,21 @@ static ssize_t unstable_stats_show(struct kobject *kobj,
pages = atomic_long_read(&cache->ccc_unstable_nr);
mb = (pages * PAGE_SIZE) >> 20;
 
-   return sprintf(buf, "unstable_check: %8d\n"
-   "unstable_pages: %12ld\n"
-   "unstable_mb:%8d\n",
-   cache->ccc_unstable_check, pages, mb);
+   seq_printf(m,
+  "unstable_check: %8d\n"
+  "unstable_pages: %12ld\n"
+  "unstable_mb:%8d\n",
+  cache->ccc_unstable_check, pages, mb);
+
+   return 0;
 }
 
-static ssize_t unstable_stats_store(struct kobject *kobj,
-   struct attribute *attr,
-   const char *buffer,
-   size_t count)
+static ssize_t ll_unstable_stats_seq_write(struct file *file,
+  const char __user *buffer,
+  size_t count, loff_t *off)
 {
-   struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
- ll_kobj);
+   struct super_block *sb = ((struct seq_file 
*)file->private_data)->private;
+   struct ll_sb_info *sbi = ll_s2sbi(sb);
char kernbuf[128];
int val, rc;
 
@@ -922,7 +922,7 @@ static ssize_t unstable_stats_store(struct kobject *kobj,
 
return count;
 }
-LUSTRE_RW_ATTR(unstable_stats);
+LPROC_SEQ_FOPS(ll_unstable_stats);
 
 static ssize_t root_squash_show(struct kobject *kobj, struct attribute *attr,
char *buf)
@@ -995,6 +995,7 @@ static struct lprocfs_vars lprocfs_llite_obd_vars[] = {
/* { "filegroups",   lprocfs_rd_filegroups,  0, 0 }, */
{ "max_cached_mb",&ll_max_cached_mb_fops, NULL },
{ "statahead_stats",  &ll_statahead_stats_fops, NULL, 0 },
+   { "unstable_stats",   &ll_unstable_stats_fops, NULL },
{ "sbi_flags",&ll_sbi_flags_fops, NULL, 0 },
{ .name =   "nosquash_nids",
  .fops =   &ll_nosquash_nids_fops  },
@@ -1026,7 +1027,6 @@ static struct attribute *llite_attrs[] = {
&lustre_attr_max_easize.attr,
&lustre_attr_default_easize.attr,
&lustre_attr_xattr_cache.attr,
-   &lustre_attr_unstable_stats.attr,
&lustre_attr_root_squash.attr,
NULL,
 };
-- 
2.7.4

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


Re: [PATCH 57/80] staging: lustre: osc: revise unstable pages accounting

2016-10-16 Thread Oleg Drokin

On Oct 16, 2016, at 11:14 AM, Greg Kroah-Hartman wrote:

> Digging up an old email...
> 
> On Tue, Aug 16, 2016 at 04:19:10PM -0400, James Simmons wrote:
>> From: Jinshan Xiong 
>> 
>> A few changes are made in this patch for unstable pages tracking:
>> 
>> 1. Remove kernel NFS unstable pages tracking because it killed
>>   performance
>> 2. Track unstable pages as part of LRU cache. Otherwise Lustre
>>   can use much more memory than max_cached_mb
>> 3. Remove obd_unstable_pages tracking to avoid using global
>>   atomic counter
>> 4. Make unstable pages track optional. Tracking unstable pages is
>>   turned off by default, and can be controlled by
>>   llite.*.unstable_stats.
>> 
>> Signed-off-by: Jinshan Xiong 
>> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4841
>> Reviewed-on: http://review.whamcloud.com/10003
>> Reviewed-by: Andreas Dilger 
>> Reviewed-by: Lai Siyao 
>> Reviewed-by: Oleg Drokin 
>> Signed-off-by: James Simmons 
>> ---
>> drivers/staging/lustre/lustre/include/cl_object.h  |   35 +++-
>> .../staging/lustre/lustre/include/obd_support.h|1 -
>> drivers/staging/lustre/lustre/llite/lproc_llite.c  |   41 -
>> drivers/staging/lustre/lustre/obdclass/class_obd.c |2 -
>> drivers/staging/lustre/lustre/osc/osc_cache.c  |   96 +-
>> drivers/staging/lustre/lustre/osc/osc_internal.h   |2 +-
>> drivers/staging/lustre/lustre/osc/osc_page.c   |  208 
>> +---
>> drivers/staging/lustre/lustre/osc/osc_request.c|   13 +-
>> 8 files changed, 253 insertions(+), 145 deletions(-)
>> 
>> diff --git a/drivers/staging/lustre/lustre/include/cl_object.h 
>> b/drivers/staging/lustre/lustre/include/cl_object.h
>> index d269b32..ec6cf7c 100644
>> --- a/drivers/staging/lustre/lustre/include/cl_object.h
>> +++ b/drivers/staging/lustre/lustre/include/cl_object.h
>> @@ -1039,23 +1039,32 @@ do { 
>>   \
>>  }\
>> } while (0)
>> 
>> -static inline int __page_in_use(const struct cl_page *page, int refc)
>> -{
>> -if (page->cp_type == CPT_CACHEABLE)
>> -++refc;
>> -LASSERT(atomic_read(&page->cp_ref) > 0);
>> -return (atomic_read(&page->cp_ref) > refc);
>> -}
>> -
>> -#define cl_page_in_use(pg)   __page_in_use(pg, 1)
>> -#define cl_page_in_use_noref(pg) __page_in_use(pg, 0)
>> -
>> static inline struct page *cl_page_vmpage(struct cl_page *page)
>> {
>>  LASSERT(page->cp_vmpage);
>>  return page->cp_vmpage;
>> }
>> 
>> +/**
>> + * Check if a cl_page is in use.
>> + *
>> + * Client cache holds a refcount, this refcount will be dropped when
>> + * the page is taken out of cache, see vvp_page_delete().
>> + */
>> +static inline bool __page_in_use(const struct cl_page *page, int refc)
>> +{
>> +return (atomic_read(&page->cp_ref) > refc + 1);
>> +}
>> +
>> +/**
>> + * Caller itself holds a refcount of cl_page.
>> + */
>> +#define cl_page_in_use(pg)   __page_in_use(pg, 1)
>> +/**
>> + * Caller doesn't hold a refcount.
>> + */
>> +#define cl_page_in_use_noref(pg) __page_in_use(pg, 0)
>> +
>> /** @} cl_page */
>> 
>> /** \addtogroup cl_lock cl_lock
>> @@ -2331,6 +2340,10 @@ struct cl_client_cache {
>>   */
>>  spinlock_t  ccc_lru_lock;
>>  /**
>> + * Set if unstable check is enabled
>> + */
>> +unsigned intccc_unstable_check:1;
>> +/**
>>   * # of unstable pages for this mount point
>>   */
>>  atomic_tccc_unstable_nr;
>> diff --git a/drivers/staging/lustre/lustre/include/obd_support.h 
>> b/drivers/staging/lustre/lustre/include/obd_support.h
>> index 26fdff6..a11fff1 100644
>> --- a/drivers/staging/lustre/lustre/include/obd_support.h
>> +++ b/drivers/staging/lustre/lustre/include/obd_support.h
>> @@ -54,7 +54,6 @@ extern int at_early_margin;
>> extern int at_extra;
>> extern unsigned int obd_sync_filter;
>> extern unsigned int obd_max_dirty_pages;
>> -extern atomic_t obd_unstable_pages;
>> extern atomic_t obd_dirty_pages;
>> extern atomic_t obd_dirty_transit_pages;
>> extern char obd_jobid_var[];
>> diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c 
>> b/drivers/staging/lustre/lustre/llite/lproc_llite.c
>> index 2f1f389..5f8e78d 100644
>> --- a/drivers/staging/lustre/lustre/llite/lproc_llite.c
>> +++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c
>> @@ -828,10 +828,45 @@ static ssize_t unstable_stats_show(struct kobject 
>> *kobj,
>>  pages = atomic_read(&cache->ccc_unstable_nr);
>>  mb = (pages * PAGE_SIZE) >> 20;
>> 
>> -return sprintf(buf, "unstable_pages: %8d\n"
>> -"unstable_mb:%8d\n", pages, mb);
>> +return sprintf(buf, "unstable_check: %8d\n"
>> +"unstable_pages: %8d\n"
>> +"unstable_mb:%8d\n",
>> +cache->ccc_unstable_check, pages, mb);
>> }
>> -LUSTRE_RO_ATTR(unstable_stats);
>>

Re: [PATCH 0/5] Replace data type declarations with variables of same types in several source files.

2016-10-16 Thread Sergio Paracuellos



El 2016年10月16日 a las 10:24, Alexander Alemayhu escribió:

On Mon, Oct 10, 2016 at 04:02:17PM +0200, Sergio Paracuellos wrote:

This patch series replaces several sizeof(struct XXX) stuff in favour
of sizeof(var) which is the preferred one.



Why not squash this series into one patch? The commit messages are fairly
similar and the changes are focused into one area. Would be better with one
commit, IMO.



Commit messages are similar but applies to different files. That was the 
reason of sending the patchset and not only one patch. If it had been 
better to send only one patch please, let me know to be correct next 
time. The patchset seems that has been already added to the staging branch.


Thanks in advance.

Cheers,
Sergio Paracuellos



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


[PATCH] staging: dgnc: Replace CamelCase namings with underscores.

2016-10-16 Thread Pankaj Bharadiya
Replace CamelCase names with underscores to comply with the standard
kernel coding style.

Signed-off-by: Pankaj Bharadiya 
---
 drivers/staging/dgnc/dgnc_tty.c | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index ef9a45b..1a21902 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -45,7 +45,7 @@
 /*
  * internal variables
  */
-static unsigned char   *dgnc_TmpWriteBuf;
+static unsigned char   *dgnc_tmp_write_buf;
 
 /*
  * Default transparent print information.
@@ -69,7 +69,7 @@
  * This defines a raw port at 9600 baud, 8 data bits, no parity,
  * 1 stop bit.
  */
-static struct ktermios DgncDefaultTermios = {
+static struct ktermios dgnc_default_termios = {
.c_iflag =  (DEFAULT_IFLAGS),   /* iflags */
.c_oflag =  (DEFAULT_OFLAGS),   /* oflags */
.c_cflag =  (DEFAULT_CFLAGS),   /* cflags */
@@ -160,9 +160,9 @@ int dgnc_tty_preinit(void)
 * is only called during module load, (not in interrupt context),
 * and with no locks held.
 */
-   dgnc_TmpWriteBuf = kmalloc(WRITEBUFLEN, GFP_KERNEL);
+   dgnc_tmp_write_buf = kmalloc(WRITEBUFLEN, GFP_KERNEL);
 
-   if (!dgnc_TmpWriteBuf)
+   if (!dgnc_tmp_write_buf)
return -ENOMEM;
 
return 0;
@@ -194,7 +194,7 @@ int dgnc_tty_register(struct dgnc_board *brd)
brd->serial_driver->minor_start = 0;
brd->serial_driver->type = TTY_DRIVER_TYPE_SERIAL;
brd->serial_driver->subtype = SERIAL_TYPE_NORMAL;
-   brd->serial_driver->init_termios = DgncDefaultTermios;
+   brd->serial_driver->init_termios = dgnc_default_termios;
brd->serial_driver->driver_name = DRVSTR;
 
/*
@@ -233,7 +233,7 @@ int dgnc_tty_register(struct dgnc_board *brd)
brd->print_driver->minor_start = 0x80;
brd->print_driver->type = TTY_DRIVER_TYPE_SERIAL;
brd->print_driver->subtype = SERIAL_TYPE_NORMAL;
-   brd->print_driver->init_termios = DgncDefaultTermios;
+   brd->print_driver->init_termios = dgnc_default_termios;
brd->print_driver->driver_name = DRVSTR;
 
/*
@@ -371,8 +371,8 @@ int dgnc_tty_init(struct dgnc_board *brd)
  */
 void dgnc_tty_post_uninit(void)
 {
-   kfree(dgnc_TmpWriteBuf);
-   dgnc_TmpWriteBuf = NULL;
+   kfree(dgnc_tmp_write_buf);
+   dgnc_tmp_write_buf = NULL;
 }
 
 /*
@@ -1543,7 +1543,7 @@ static int dgnc_tty_write_room(struct tty_struct *tty)
int ret = 0;
unsigned long flags;
 
-   if (!tty || !dgnc_TmpWriteBuf)
+   if (!tty || !dgnc_tmp_write_buf)
return 0;
 
un = tty->driver_data;
@@ -1623,7 +1623,7 @@ static int dgnc_tty_write(struct tty_struct *tty,
ushort tmask;
uint remain;
 
-   if (!tty || !dgnc_TmpWriteBuf)
+   if (!tty || !dgnc_tmp_write_buf)
return 0;
 
un = tty->driver_data;
-- 
1.9.1

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


[PATCH 1/3] staging: ks7010: Fix conditional statements coding style

2016-10-16 Thread Carlos Maiolino
Fix coding style issues in if statements braces, specifically:

WARNING: braces {} are not necessary for single statement blocks
WARNING: braces {} are not necessary for any arm of this statement
CHECK: braces {} should be used on all arms of this statement

Signed-off-by: Carlos Maiolino 
---
 drivers/staging/ks7010/ks_hostif.c | 30 +-
 1 file changed, 13 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index c57ca58..e0a5eda 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -97,11 +97,10 @@ int ks_wlan_do_power_save(struct ks_wlan_private *priv)
 {
DPRINTK(4, "psstatus.status=%d\n", atomic_read(&priv->psstatus.status));
 
-   if ((priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS) {
+   if ((priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS)
hostif_sme_enqueue(priv, SME_POW_MNGMT_REQUEST);
-   } else {
+   else
priv->dev_state = DEVICE_STATE_READY;
-   }
return 0;
 }
 
@@ -705,15 +704,13 @@ void hostif_mib_set_confirm(struct ks_wlan_private *priv)
break;
case DOT11_GMK1_TSC:
DPRINTK(2, "DOT11_GMK1_TSC:mib_status=%d\n", (int)mib_status);
-   if (atomic_read(&priv->psstatus.snooze_guard)) {
+   if (atomic_read(&priv->psstatus.snooze_guard))
atomic_set(&priv->psstatus.snooze_guard, 0);
-   }
break;
case DOT11_GMK2_TSC:
DPRINTK(2, "DOT11_GMK2_TSC:mib_status=%d\n", (int)mib_status);
-   if (atomic_read(&priv->psstatus.snooze_guard)) {
+   if (atomic_read(&priv->psstatus.snooze_guard))
atomic_set(&priv->psstatus.snooze_guard, 0);
-   }
break;
case LOCAL_PMK:
DPRINTK(2, "LOCAL_PMK:mib_status=%d\n", (int)mib_status);
@@ -2172,8 +2169,9 @@ void hostif_sme_mode_setup(struct ks_wlan_private *priv)
else
rate_octet[i] =
priv->reg.rate_set.body[i];
-   } else
+   } else {
break;
+   }
}
 
} else {/* D_11G_ONLY_MODE or D_11BG_COMPATIBLE_MODE */
@@ -2187,8 +2185,9 @@ void hostif_sme_mode_setup(struct ks_wlan_private *priv)
else
rate_octet[i] =
priv->reg.rate_set.body[i];
-   } else
+   } else {
break;
+   }
}
}
rate_size = i;
@@ -2461,9 +2460,8 @@ void hostif_sme_execute(struct ks_wlan_private *priv, int 
event)
DPRINTK(3, "event=%d\n", event);
switch (event) {
case SME_START:
-   if (priv->dev_state == DEVICE_STATE_BOOT) {
+   if (priv->dev_state == DEVICE_STATE_BOOT)
hostif_mib_get_request(priv, DOT11_MAC_ADDRESS);
-   }
break;
case SME_MULTICAST_REQUEST:
hostif_sme_multicast_set(priv);
@@ -2508,14 +2506,12 @@ void hostif_sme_execute(struct ks_wlan_private *priv, 
int event)
}
break;
case SME_GET_MAC_ADDRESS:
-   if (priv->dev_state == DEVICE_STATE_BOOT) {
+   if (priv->dev_state == DEVICE_STATE_BOOT)
hostif_mib_get_request(priv, DOT11_PRODUCT_VERSION);
-   }
break;
case SME_GET_PRODUCT_VERSION:
-   if (priv->dev_state == DEVICE_STATE_BOOT) {
+   if (priv->dev_state == DEVICE_STATE_BOOT)
priv->dev_state = DEVICE_STATE_PREINIT;
-   }
break;
case SME_STOP_REQUEST:
hostif_stop_request(priv);
@@ -2594,9 +2590,9 @@ void hostif_sme_execute(struct ks_wlan_private *priv, int 
event)
/* for power save */
atomic_set(&priv->psstatus.snooze_guard, 0);
atomic_set(&priv->psstatus.confirm_wait, 0);
-   if (priv->dev_state == DEVICE_STATE_PREINIT) {
+   if (priv->dev_state == DEVICE_STATE_PREINIT)
priv->dev_state = DEVICE_STATE_INIT;
-   }
+
/* wake_up_interruptible_all(&priv->confirm_wait); */
complete(&priv->confirm_wait);
break;
-- 
2.7.4

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


[PATCH 0/3] staging: ks7010: Coding style fixes

2016-10-16 Thread Carlos Maiolino
A small patchset fixing some coding style errors identified by checkpatch.pl

Greg. I splitted the single patch into 3 different patches now, hope I set it
right now :)

Also added a blank line before the signed-off.

Cheers

Carlos Maiolino (3):
  staging: ks7010: Fix conditional statements coding style
  staging: ks7010: Fix coding style spacing issues
  staging: ks7010: add missing blank lines

 drivers/staging/ks7010/ks_hostif.c | 238 +++--
 1 file changed, 120 insertions(+), 118 deletions(-)

-- 
2.7.4

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


[PATCH 3/3] staging: ks7010: add missing blank lines

2016-10-16 Thread Carlos Maiolino
Use blank lines to separate variable declarations from statements, fixing the
following checkpatch.pl issue:

WARNING: Missing a blank line after declarations

Signed-off-by: Carlos Maiolino 
---
 drivers/staging/ks7010/ks_hostif.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index 7a6cac2..1a301ef 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -765,6 +765,7 @@ void hostif_start_confirm(struct ks_wlan_private *priv)
 {
 #ifdef WPS
union iwreq_data wrqu;
+
wrqu.data.length = 0;
wrqu.data.flags = 0;
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
@@ -786,6 +787,7 @@ void hostif_connect_indication(struct ks_wlan_private *priv)
unsigned int old_status = priv->connect_status;
struct net_device *netdev = priv->net_dev;
union iwreq_data wrqu0;
+
connect_code = get_WORD(priv);
 
switch (connect_code) {
@@ -925,6 +927,7 @@ static
 void hostif_infrastructure_set_confirm(struct ks_wlan_private *priv)
 {
uint16_t result_code;
+
DPRINTK(3, "\n");
result_code = get_WORD(priv);
DPRINTK(3, "result code = %d\n", result_code);
@@ -990,6 +993,7 @@ void hostif_bss_scan_confirm(struct ks_wlan_private *priv)
unsigned int result_code;
struct net_device *dev = priv->net_dev;
union iwreq_data wrqu;
+
result_code = get_DWORD(priv);
DPRINTK(2, "result=%d :: scan_ind_count=%d\n", result_code,
priv->scan_ind_count);
@@ -1888,6 +1892,7 @@ static
 void hostif_sme_set_wep(struct ks_wlan_private *priv, int type)
 {
uint32_t val;
+
switch (type) {
case SME_WEP_INDEX_REQUEST:
val = cpu_to_le32((uint32_t)(priv->reg.wep_index));
@@ -2364,6 +2369,7 @@ static
 void hostif_sme_set_key(struct ks_wlan_private *priv, int type)
 {
uint32_t val;
+
switch (type) {
case SME_SET_FLAG:
val = cpu_to_le32((uint32_t)(priv->reg.privacy_invoked));
-- 
2.7.4

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


[PATCH 2/3] staging: ks7010: Fix coding style spacing issues

2016-10-16 Thread Carlos Maiolino
Fix the following checkpatch.pl spacing errors/warnings:

CHECK: No space is necessary after a cast
WARNING: please, no spaces at the start of a line
WARNING: please, no spaces at the start of a line
ERROR: space prohibited after that open parenthesis '('
ERROR: space prohibited before that close parenthesis ')'
ERROR: exactly one space required after that #ifdef
ERROR: space prohibited after that '&' (ctx:WxW)

Signed-off-by: Carlos Maiolino 
---
 drivers/staging/ks7010/ks_hostif.c | 202 ++---
 1 file changed, 101 insertions(+), 101 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index e0a5eda..7a6cac2 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -23,11 +23,11 @@
 
 /* macro */
 #define inc_smeqhead(priv) \
-( priv->sme_i.qhead = (priv->sme_i.qhead + 1) % SME_EVENT_BUFF_SIZE )
+   (priv->sme_i.qhead = (priv->sme_i.qhead + 1) % SME_EVENT_BUFF_SIZE)
 #define inc_smeqtail(priv) \
-( priv->sme_i.qtail = (priv->sme_i.qtail + 1) % SME_EVENT_BUFF_SIZE )
+   (priv->sme_i.qtail = (priv->sme_i.qtail + 1) % SME_EVENT_BUFF_SIZE)
 #define cnt_smeqbody(priv) \
-(((priv->sme_i.qtail + SME_EVENT_BUFF_SIZE) - (priv->sme_i.qhead)) % 
SME_EVENT_BUFF_SIZE )
+   (((priv->sme_i.qtail + SME_EVENT_BUFF_SIZE) - (priv->sme_i.qhead)) % 
SME_EVENT_BUFF_SIZE)
 
 #define KS_WLAN_MEM_FLAG (GFP_ATOMIC)
 
@@ -763,7 +763,7 @@ void hostif_sleep_confirm(struct ks_wlan_private *priv)
 static
 void hostif_start_confirm(struct ks_wlan_private *priv)
 {
-#ifdef  WPS
+#ifdef WPS
union iwreq_data wrqu;
wrqu.data.length = 0;
wrqu.data.flags = 0;
@@ -1238,37 +1238,37 @@ int hostif_data_request(struct ks_wlan_private *priv, 
struct sk_buff *packet)
&& !(priv->wpa.key[1].key_len)
&& !(priv->wpa.key[2].key_len)
&& !(priv->wpa.key[3].key_len)) {
-   pp->auth_type = cpu_to_le16((uint16_t) TYPE_AUTH);  
/* no encryption */
+   pp->auth_type = cpu_to_le16((uint16_t)TYPE_AUTH);   
/* no encryption */
} else {
if (priv->wpa.pairwise_suite == IW_AUTH_CIPHER_TKIP) {
-   MichaelMICFunction(&michel_mic, (uint8_t *) 
priv->wpa.key[0].tx_mic_key, (uint8_t *) & pp->data[0], (int)packet_len, 
(uint8_t) 0,   /* priority */
-  (uint8_t *) michel_mic.
+   MichaelMICFunction(&michel_mic, (uint8_t 
*)priv->wpa.key[0].tx_mic_key, (uint8_t *)&pp->data[0], (int)packet_len, 
(uint8_t)0,   /* priority */
+  (uint8_t *)michel_mic.
   Result);
memcpy(p, michel_mic.Result, 8);
length += 8;
packet_len += 8;
p += 8;
pp->auth_type =
-   cpu_to_le16((uint16_t) TYPE_DATA);
+   cpu_to_le16((uint16_t)TYPE_DATA);
 
} else if (priv->wpa.pairwise_suite ==
   IW_AUTH_CIPHER_CCMP) {
pp->auth_type =
-   cpu_to_le16((uint16_t) TYPE_DATA);
+   cpu_to_le16((uint16_t)TYPE_DATA);
}
}
} else {
if (eth_proto == ETHER_PROTOCOL_TYPE_EAP)
-   pp->auth_type = cpu_to_le16((uint16_t) TYPE_AUTH);
+   pp->auth_type = cpu_to_le16((uint16_t)TYPE_AUTH);
else
-   pp->auth_type = cpu_to_le16((uint16_t) TYPE_DATA);
+   pp->auth_type = cpu_to_le16((uint16_t)TYPE_DATA);
}
 
/* header value set */
pp->header.size =
cpu_to_le16((uint16_t)
(sizeof(*pp) - sizeof(pp->header.size) + packet_len));
-   pp->header.event = cpu_to_le16((uint16_t) HIF_DATA_REQ);
+   pp->header.event = cpu_to_le16((uint16_t)HIF_DATA_REQ);
 
/* tx request */
result =
@@ -1311,9 +1311,9 @@ void hostif_mib_get_request(struct ks_wlan_private *priv,
return;
}
pp->header.size =
-   cpu_to_le16((uint16_t) (sizeof(*pp) - sizeof(pp->header.size)));
-   pp->header.event = cpu_to_le16((uint16_t) HIF_MIB_GET_REQ);
-   pp->mib_attribute = cpu_to_le32((uint32_t) mib_attribute);
+   cpu_to_le16((uint16_t)(sizeof(*pp) - sizeof(pp->header.size)));
+   pp->header.event = cpu_to_le16((uint16_t)HIF_MIB_GET_REQ);
+   pp->mib_attribute = cpu_to_le32((uint32_t)mib_attribute);
 
/* send to device request */
ps_confirm_wait_inc(priv);
@@ -1344,10 +

URGENT REPLY FOR MORE DETAILS

2016-10-16 Thread Wilfred Kabore


Hello Dear,

Greetings and hope this email finds you well?

I am Dr. Wilfred Kabore, the  chief Medical consultant at a reputable clinic 
here in Ouagadougou, Burkina Faso and I have a Patient who hails from the 
Republic of Philippines but unfortunately is in coma right now due to 
complications from a Cancer disease and she has the sum of $4.7 Million United 
States (Four Million seven Hundred Thousand) Dollars she wants me to guide you 
on, so that her Bank can transfer it to you for charity purposes.

Please, I will like you to contact me for further details as this is a very 
sensitive issue that needs urgent attention from you.

Best Regards,

Dr. Wilfred Kabore on behalf of
Mrs. Sismer Shirley Acojedo
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: dgnc: dgnc_tty: Add missing static keyword.

2016-10-16 Thread Cathal Mullaney
Fixed sparse warning; function not declared static.

Signed-off-by: Cathal Mullaney 
---
 drivers/staging/dgnc/dgnc_tty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index 953d931..ef9a45b 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -930,7 +930,7 @@ void dgnc_wakeup_writes(struct channel_t *ch)
spin_unlock_irqrestore(&ch->ch_lock, flags);
 }
 
-struct dgnc_board *find_board_by_major(unsigned int major)
+static struct dgnc_board *find_board_by_major(unsigned int major)
 {
int i;
 
-- 
2.7.4

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


Re: [PATCH] staging: greybus: audio: Rename cport with intf_id

2016-10-16 Thread Vaibhav Agarwal
On Sun, Oct 16, 2016 at 3:29 PM, Pankaj Bharadiya
 wrote:
> gb_audio_manager_module_descriptor's cport field is actually used to
> manage and pass interface id to user space.
>
> Thus rename gb_audio_manager_module_descriptor's 'cport' field and
> few other things to avoid confusion.
>
> Signed-off-by: Pankaj Bharadiya 
> ---
>  drivers/staging/greybus/audio_manager.h|  2 +-
>  drivers/staging/greybus/audio_manager_module.c | 20 ++--
>  drivers/staging/greybus/audio_manager_sysfs.c  |  4 ++--
>  drivers/staging/greybus/audio_module.c |  2 +-
>  4 files changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/staging/greybus/audio_manager.h 
> b/drivers/staging/greybus/audio_manager.h
> index c4ca097..056088e 100644
> --- a/drivers/staging/greybus/audio_manager.h
> +++ b/drivers/staging/greybus/audio_manager.h
> @@ -21,7 +21,7 @@ struct gb_audio_manager_module_descriptor {
> int slot;
> int vid;
> int pid;
> -   int cport;
> +   int intf_id;
> unsigned int ip_devices;
> unsigned int op_devices;
>  };
> diff --git a/drivers/staging/greybus/audio_manager_module.c 
> b/drivers/staging/greybus/audio_manager_module.c
> index a10e96a..2bf40a9 100644
> --- a/drivers/staging/greybus/audio_manager_module.c
> +++ b/drivers/staging/greybus/audio_manager_module.c
> @@ -111,16 +111,16 @@ static ssize_t gb_audio_module_pid_show(
>  static struct gb_audio_manager_module_attribute 
> gb_audio_module_pid_attribute =
> __ATTR(pid, 0664, gb_audio_module_pid_show, NULL);
>
> -static ssize_t gb_audio_module_cport_show(
> +static ssize_t gb_audio_module_intf_id_show(
> struct gb_audio_manager_module *module,
> struct gb_audio_manager_module_attribute *attr, char *buf)
>  {
> -   return sprintf(buf, "%d", module->desc.cport);
> +   return sprintf(buf, "%d", module->desc.intf_id);
>  }
>
>  static struct gb_audio_manager_module_attribute
> -   gb_audio_module_cport_attribute =
> -   __ATTR(cport, 0664, gb_audio_module_cport_show, NULL);
> +   gb_audio_module_intf_id_attribute =
> +   __ATTR(intf_id, 0664, gb_audio_module_intf_id_show, NULL);
>
>  static ssize_t gb_audio_module_ip_devices_show(
> struct gb_audio_manager_module *module,
> @@ -149,7 +149,7 @@ static ssize_t gb_audio_module_op_devices_show(
> &gb_audio_module_slot_attribute.attr,
> &gb_audio_module_vid_attribute.attr,
> &gb_audio_module_pid_attribute.attr,
> -   &gb_audio_module_cport_attribute.attr,
> +   &gb_audio_module_intf_id_attribute.attr,
> &gb_audio_module_ip_devices_attribute.attr,
> &gb_audio_module_op_devices_attribute.attr,
> NULL,   /* need to NULL terminate the list of attributes */
> @@ -167,7 +167,7 @@ static void send_add_uevent(struct 
> gb_audio_manager_module *module)
> char slot_string[64];
> char vid_string[64];
> char pid_string[64];
> -   char cport_string[64];
> +   char intf_id_string[64];
> char ip_devices_string[64];
> char op_devices_string[64];
>
> @@ -176,7 +176,7 @@ static void send_add_uevent(struct 
> gb_audio_manager_module *module)
> slot_string,
> vid_string,
> pid_string,
> -   cport_string,
> +   intf_id_string,
> ip_devices_string,
> op_devices_string,
> NULL
> @@ -186,7 +186,7 @@ static void send_add_uevent(struct 
> gb_audio_manager_module *module)
> snprintf(slot_string, 64, "SLOT=%d", module->desc.slot);
> snprintf(vid_string, 64, "VID=%d", module->desc.vid);
> snprintf(pid_string, 64, "PID=%d", module->desc.pid);
> -   snprintf(cport_string, 64, "CPORT=%d", module->desc.cport);
> +   snprintf(intf_id_string, 64, "INTF_ID=%d", module->desc.intf_id);
> snprintf(ip_devices_string, 64, "I/P DEVICES=0x%X",
>  module->desc.ip_devices);
> snprintf(op_devices_string, 64, "O/P DEVICES=0x%X",
> @@ -246,13 +246,13 @@ int gb_audio_manager_module_create(
>
>  void gb_audio_manager_module_dump(struct gb_audio_manager_module *module)
>  {
> -   pr_info("audio module #%d name=%s slot=%d vid=%d pid=%d cport=%d i/p 
> devices=0x%X o/p devices=0x%X\n",
> +   pr_info("audio module #%d name=%s slot=%d vid=%d pid=%d intf_id=%d 
> i/p devices=0x%X o/p devices=0x%X\n",
> module->id,
> module->desc.name,
> module->desc.slot,
> module->desc.vid,
> module->desc.pid,
> -   module->desc.cport,
> +   module->desc.intf_id,
> module->desc.ip_devices,
> module->desc.op_devices);
>  }
> diff --git a/drivers/staging/greybus/audio_manager_sysfs.c 
> b/drivers/staging/greybus/audio_manager_sysfs.c
> index d8bf859..feb195d 100644

Re: [PATCH] staging: greybus: audio: Rename cport with intf_id

2016-10-16 Thread Viresh Kumar
On Sun, Oct 16, 2016 at 3:29 PM, Pankaj Bharadiya
 wrote:
> gb_audio_manager_module_descriptor's cport field is actually used to
> manage and pass interface id to user space.
>
> Thus rename gb_audio_manager_module_descriptor's 'cport' field and
> few other things to avoid confusion.
>
> Signed-off-by: Pankaj Bharadiya 
> ---
>  drivers/staging/greybus/audio_manager.h|  2 +-
>  drivers/staging/greybus/audio_manager_module.c | 20 ++--
>  drivers/staging/greybus/audio_manager_sysfs.c  |  4 ++--
>  drivers/staging/greybus/audio_module.c |  2 +-
>  4 files changed, 14 insertions(+), 14 deletions(-)

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


Re: [patch] greybus: fix a leak on error in gb_module_create()

2016-10-16 Thread Viresh Kumar
On Sat, Oct 15, 2016 at 12:48 AM, Dan Carpenter
 wrote:
> We should release ->interfaces[0] as well.
>
> Fixes: b15d97d77017 ("greybus: core: add module abstraction")
> Signed-off-by: Dan Carpenter 

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