[PATCH] staging : Comedi : comedi_fops : Fixed the return error code

2015-06-21 Thread Santosh
This patch fixes the checkpatch.pl warning:

WARNING: ENOSYS means 'invalid syscall nr' and nothing else

Regards,

Santosh Pai

>From 502464417255edb52a1db71146e2f33e67df87ce Mon Sep 17 00:00:00 2001
From: sanpai 
Date: Sun, 21 Jun 2015 15:05:00 +0530
Subject: [PATCH] staging : Comedi : comedi_fops : Fixed the return error code

try_module_get fails when the reference count of the module is not
allowed to be incremented ,and hence -EPERM is returned.

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

diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 985d94b..d6a37e9 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2606,7 +2606,7 @@ static int comedi_open(struct inode *inode, struct file *file)
 	}
 	if (dev->attached && dev->use_count == 0) {
 		if (!try_module_get(dev->driver->module)) {
-			rc = -ENOSYS;
+			rc = -EPERM;
 			goto out;
 		}
 		if (dev->open) {
-- 
1.7.9.5

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


, [PATCH 2/2] staging : Comedi : comedi_fops : Fixed the return error, code, try_module_get fails when the reference count of the module is not, allowed to be incremented ,and hence -ENXIO is returne

2015-06-23 Thread Santosh

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


[PATCH 2/2] staging : Comedi : comedi_fops : Fixed the return error code

2015-06-24 Thread Santosh
  try_module_get fails when the reference count of the module is not
  allowed to be incremented ,and hence -ENXIO is returned indicating
  no device or address.

Signed-off-by: santhosh pai 
---
 drivers/staging/comedi/comedi_fops.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/comedi_fops.c 
b/drivers/staging/comedi/comedi_fops.c
index d6a37e9..1ab443c 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2606,7 +2606,7 @@ static int comedi_open(struct inode *inode, struct file 
*file)
}
if (dev->attached && dev->use_count == 0) {
if (!try_module_get(dev->driver->module)) {
-   rc = -EPERM;
+   rc = -ENXIO;
goto out;
}
if (dev->open) {
-- 
1.7.9.5

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


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

2016-01-30 Thread Santosh Madiraju
From: madiraju 

Removed unnecessary spaces to match coding style.

Signed-off-by: Santosh Madiraju  
---
 drivers/staging/xgifb/XGI_main_26.c | 22 ++
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c 
b/drivers/staging/xgifb/XGI_main_26.c
index 89f5b55..4978737 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -1989,7 +1989,6 @@ static int xgifb_probe(struct pci_dev *pdev,
&fb_info->var.vsync_len,
&fb_info->var.sync,
&fb_info->var.vmode)) {
-
if ((fb_info->var.vmode & FB_VMODE_MASK) ==
FB_VMODE_INTERLACED) {
fb_info->var.yres <<= 1;
@@ -1999,10 +1998,7 @@ static int xgifb_probe(struct pci_dev *pdev,
fb_info->var.pixclock >>= 1;
fb_info->var.yres >>= 1;
fb_info->var.yres_virtual >>= 1;
-   }
-
-   }
-
+   } }
fb_info->flags = FBINFO_FLAG_DEFAULT;
fb_info->screen_base = xgifb_info->video_vbase;
fb_info->fbops = &XGIfb_ops;
@@ -2064,33 +2060,27 @@ static struct pci_driver xgifb_driver = {
.remove = xgifb_remove
 };
 
-
-
 /*/
 /*  MODULE   */
 /*/
 
 module_param(mode, charp, 0);
-MODULE_PARM_DESC(mode,
-   "Selects the desired default display mode in the format XxYxDepth (eg. 
1024x768x16).");
+MODULE_PARM_DESC(mode, "Selects the desired default display mode in the format 
XxYxDepth (eg. 1024x768x16).");
 
 module_param(forcecrt2type, charp, 0);
-MODULE_PARM_DESC(forcecrt2type,
-   "Force the second display output type. Possible values are NONE, LCD, 
TV, VGA, SVIDEO or COMPOSITE.");
+MODULE_PARM_DESC(forcecrt2type, "Force the second display output type. 
Possible values are NONE, LCD, TV, VGA, SVIDEO or COMPOSITE.");
 
 module_param(vesa, int, 0);
-MODULE_PARM_DESC(vesa,
-   "Selects the desired default display mode by VESA mode number (eg. 
0x117).");
+MODULE_PARM_DESC(vesa, "Selects the desired default display mode by VESA mode 
number (eg. 0x117).");
 
 module_param(filter, int, 0);
-MODULE_PARM_DESC(filter,
-   "Selects TV flicker filter type (only for systems with a SiS301 video 
bridge). Possible values 0-7. Default: [no filter]).");
+MODULE_PARM_DESC(filter, "Selects TV flicker filter type (only for systems 
with a SiS301 video bridge). Possible values 0-7. Default: [no filter]).");
 
 static int __init xgifb_init(void)
 {
char *option = NULL;
 
-   if (forcecrt2type != NULL)
+   if (!forcecrt2type)
XGIfb_search_crt2type(forcecrt2type);
if (fb_get_options("xgifb", &option))
return -ENODEV;
-- 
1.9.1

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


Re: [PATCH 3/3] tools: hv: Check return value of poll call

2013-06-27 Thread Santosh Y
On Thu, Jun 27, 2013 at 5:22 PM, Tomas Hozza  wrote:
> Check return value of poll call and if it fails print error to the
> system log. If errno is EINVAL then exit with non-zero value otherwise
> continue the while loop and call poll again.
>
> Signed-off-by: Tomas Hozza 
> ---
>  tools/hv/hv_vss_daemon.c | 11 ++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c
> index 6c4d2f1..826d499 100644
> --- a/tools/hv/hv_vss_daemon.c
> +++ b/tools/hv/hv_vss_daemon.c
> @@ -204,7 +204,16 @@ int main(void)
> socklen_t addr_l = sizeof(addr);
> pfd.events = POLLIN;
> pfd.revents = 0;
> -   poll(&pfd, 1, -1);
> +
> +   if (poll(&pfd, 1, -1) < 0) {

>From the description it seems that this is a typo. It should be 'while'?

> +   syslog(LOG_ERR, "poll failed; error:%d %s", errno, 
> strerror(errno));
> +   if (errno == EINVAL) {
> +   close(fd);
> +   exit(EXIT_FAILURE);
> +   }
> +   else
> +   continue;
> +   }
>
> len = recvfrom(fd, vss_recv_buffer, sizeof(vss_recv_buffer), 
> 0,
> addr_p, &addr_l);
> --
> 1.8.1.4
>
> _______
> devel mailing list
> de...@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



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


[PATCH] staging: android: ashmem.c: Declared file operation with const keyword

2023-03-05 Thread Santosh Mahto
Warning found by checkpatch.pl script.

Signed-off-by: Santosh Mahto 
---
 drivers/staging/android/ashmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
index c05a214191da..f9cfa15b785f 100644
--- a/drivers/staging/android/ashmem.c
+++ b/drivers/staging/android/ashmem.c
@@ -367,7 +367,7 @@ ashmem_vmfile_get_unmapped_area(struct file *file, unsigned 
long addr,
 
 static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
 {
-   static struct file_operations vmfile_fops;
+   static const struct file_operations vmfile_fops;
struct ashmem_area *asma = file->private_data;
int ret = 0;
 
-- 
2.25.1

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