public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] staging : Comedi : comedi_fops : Fixed the return error code
       [not found] <55868B64.5030004@yahoo.com>
@ 2015-06-22  9:37 ` Ian Abbott
  2015-06-22 11:22   ` Sudip Mukherjee
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Abbott @ 2015-06-22  9:37 UTC (permalink / raw)
  To: Santosh, hsweeten; +Cc: gregkh, linux-kernel, devel

On 21/06/15 11:01, Santosh wrote:
> This patch fixes the checkpatch.pl warning:
>
> WARNING: ENOSYS means 'invalid syscall nr' and nothing else
>
> Regards,
>
> Santosh Pai
>
>
> 0001-staging-Comedi-comedi_fops-Fixed-the-return-error-co.patch

Greg doesn't usually take patches in attachments.

>  From 502464417255edb52a1db71146e2f33e67df87ce Mon Sep 17 00:00:00 2001
> From: sanpai<santhosh.pai88@yahoo.com>
> 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<santhosh.pai88@yahoo.com>
> ---
>   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;

Why -EPERM?  I think either -ENODEV or -ENXIO would be better.

>   			goto out;
>   		}
>   		if (dev->open) {
> -- 1.7.9.5
>


-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] staging : Comedi : comedi_fops : Fixed the return error code
  2015-06-22  9:37 ` [PATCH] staging : Comedi : comedi_fops : Fixed the return error code Ian Abbott
@ 2015-06-22 11:22   ` Sudip Mukherjee
  0 siblings, 0 replies; 5+ messages in thread
From: Sudip Mukherjee @ 2015-06-22 11:22 UTC (permalink / raw)
  To: Ian Abbott; +Cc: Santosh, hsweeten, devel, gregkh, linux-kernel

On Mon, Jun 22, 2015 at 10:37:43AM +0100, Ian Abbott wrote:
> On 21/06/15 11:01, Santosh wrote:
> >This patch fixes the checkpatch.pl warning:
> >
> >WARNING: ENOSYS means 'invalid syscall nr' and nothing else
> >
> >Regards,
> >
> >Santosh Pai
> >
> >
> >0001-staging-Comedi-comedi_fops-Fixed-the-return-error-co.patch
> 
> Greg doesn't usually take patches in attachments.
> 
> > From 502464417255edb52a1db71146e2f33e67df87ce Mon Sep 17 00:00:00 2001
> >From: sanpai<santhosh.pai88@yahoo.com>
> >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<santhosh.pai88@yahoo.com>
And your Signed-off-by name is not matching with your email From: header
name. Please use your real name in both places. I don't think "sanpai" is
your real name.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] staging: Comedi: comedi_fops: Fixed the return error code
  2015-06-29  9:28 Subject: [PATCH 1/2] staging : Comedi : comedi_fops : Fixed the return error, code Ian Abbott
@ 2015-06-29  9:41 ` Ian Abbott
  2015-06-29  9:43   ` Ian Abbott
  2015-06-29  9:44 ` Ian Abbott
  1 sibling, 1 reply; 5+ messages in thread
From: Ian Abbott @ 2015-06-29  9:41 UTC (permalink / raw)
  To: Santhosh Pai, sudipm.mukherjee
  Cc: hsweeten, abbotti, devel, gregkh, linux-kernel

From: Santhosh Pai <santhosh.pai88@yahoo.com>

From: Santhosh Pai <santhosh.pai88@yahoo.com>

This patch fixes the checkpatch.pl warning:

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

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.

[IA - combined two of santhosh's changes to the error return value!]

Signed-off-by: santhosh pai <santhosh.pai88@yahoo.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
---
 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..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 = -ENOSYS;
+			rc = -ENXIO;
 			goto out;
 		}
 		if (dev->open) {
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] staging: Comedi: comedi_fops: Fixed the return error code
  2015-06-29  9:41 ` [PATCH] staging: Comedi: comedi_fops: Fixed the return error code Ian Abbott
@ 2015-06-29  9:43   ` Ian Abbott
  0 siblings, 0 replies; 5+ messages in thread
From: Ian Abbott @ 2015-06-29  9:43 UTC (permalink / raw)
  To: Santhosh Pai, sudipm.mukherjee; +Cc: hsweeten, devel, gregkh, linux-kernel

On 29/06/15 10:41, Ian Abbott wrote:
> From: Santhosh Pai <santhosh.pai88@yahoo.com>
>
> From: Santhosh Pai <santhosh.pai88@yahoo.com>

Oops.  I managed to screw it up as well.  I'll repost it.


-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] staging: Comedi: comedi_fops: Fixed the return error code
  2015-06-29  9:28 Subject: [PATCH 1/2] staging : Comedi : comedi_fops : Fixed the return error, code Ian Abbott
  2015-06-29  9:41 ` [PATCH] staging: Comedi: comedi_fops: Fixed the return error code Ian Abbott
@ 2015-06-29  9:44 ` Ian Abbott
  1 sibling, 0 replies; 5+ messages in thread
From: Ian Abbott @ 2015-06-29  9:44 UTC (permalink / raw)
  To: Santhosh Pai, sudipm.mukherjee
  Cc: hsweeten, abbotti, devel, gregkh, linux-kernel

From: Santhosh Pai <santhosh.pai88@yahoo.com>

This patch fixes the checkpatch.pl warning:

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

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.

[IA - combined two of santhosh's changes to the error return value!]

Signed-off-by: santhosh pai <santhosh.pai88@yahoo.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
---
 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..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 = -ENOSYS;
+			rc = -ENXIO;
 			goto out;
 		}
 		if (dev->open) {
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-06-29  9:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <55868B64.5030004@yahoo.com>
2015-06-22  9:37 ` [PATCH] staging : Comedi : comedi_fops : Fixed the return error code Ian Abbott
2015-06-22 11:22   ` Sudip Mukherjee
2015-06-29  9:28 Subject: [PATCH 1/2] staging : Comedi : comedi_fops : Fixed the return error, code Ian Abbott
2015-06-29  9:41 ` [PATCH] staging: Comedi: comedi_fops: Fixed the return error code Ian Abbott
2015-06-29  9:43   ` Ian Abbott
2015-06-29  9:44 ` Ian Abbott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox