Skip to contentSkip to conversation

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

PATCH In review Ian Abbott 1 participant 5 messages Jun 29, 2015 1 message not in the archive Staging

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Ian Abbott

author
#1 lore raw
Quoted 22 lines · Santhosh Pai

From 9ea09e194d6ccdd0b229b408df1c86b43b1fdd7d Mon Sep 17 00:00:00 2001
From: santhosh pai <[email protected]>
Date: Mon, 22 Jun 2015 23:26:33 +0530
Subject: [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 returned indicating no device or address.

---
  drivers/staging/comedi/comedi_fops.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/comedi/comedi_fops.c +0 -0
index d6a37e9..1ab443c 100644

drivers/staging/comedi/comedi_fops.c static int comedi_open(struct inode *inode, struct file *file) · line 2612

Quoted 8 lines
drivers/staging/comedi/comedi_fops.c +1 -1
@@ -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) {

The patch itself is okay, but all the stuff around the patch is a bit weird, such as:

1. all those email headers in the commit message
2. useless indentation in the commit message
3. subject line in commit message says "PATCH 2/2", but email subject line says "PATCH 1/2"
4. stray comma in email subject line
5. spaces before colon in subject lines

This is taking too long, so I'll post a cleaned-up version.

Signature · 2 lines
-=( Ian Abbott @ MEV Ltd.    E-mail: <[email protected]> )=-
-=(                          Web: http://www.mev.co.uk/  )=-
author
#2 lore raw
Quoted 38 lines · Ian Abbott
Quoted 31 lines · Santhosh Pai

From 9ea09e194d6ccdd0b229b408df1c86b43b1fdd7d Mon Sep 17 00:00:00 2001
From: santhosh pai <[email protected]>
Date: Mon, 22 Jun 2015 23:26:33 +0530
Subject: [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 returned indicating no device or address.

---
  drivers/staging/comedi/comedi_fops.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/comedi/comedi_fops.c +1 -1
index d6a37e9..1ab443c 100644
@@ -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;
          }
Quoted 2 lines
          if (dev->open) {

The patch itself is okay, but all the stuff around the patch is a bit weird, such as:

Quoted 6 lines

1. all those email headers in the commit message
2. useless indentation in the commit message
3. subject line in commit message says "PATCH 2/2", but email subject line says "PATCH 1/2"
4. stray comma in email subject line
5. spaces before colon in subject lines

Actually, the patch doesn't apply, because it's on top of your other patch that changed -ENOSYS to -EPERM.

Quoted 3 lines

This is taking too long, so I'll post a cleaned-up version.

I'll combine your two changes to the error return value into a single patch.

Signature · 2 lines
-=( Ian Abbott @ MEV Ltd.    E-mail: <[email protected]> )=-
-=(                          Web: http://www.mev.co.uk/  )=-
author
#3 lore raw

PATCH 1/1 staging: Comedi: comedi_fops: Fixed the return error code

From: Santhosh Pai <[email protected]>

From: Santhosh Pai <[email protected]>

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!]

---
 drivers/staging/comedi/comedi_fops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/comedi/comedi_fops.c +1 -1
index 985d94b..1ab443c 100644
@@ -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) {
Signature · 1 line
2.1.4
author
#4 lore raw

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

Quoted 3 lines · Ian Abbott

From: Santhosh Pai <[email protected]>

From: Santhosh Pai <[email protected]>

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

Signature · 2 lines
-=( Ian Abbott @ MEV Ltd.    E-mail: <[email protected]> )=-
-=(                          Web: http://www.mev.co.uk/  )=-
author
#5 lore raw

PATCH 1/1 staging: Comedi: comedi_fops: Fixed the return error code

In reply to Ian Abbott

From: Santhosh Pai <[email protected]>

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!]

---
 drivers/staging/comedi/comedi_fops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/comedi/comedi_fops.c +1 -1
index 985d94b..1ab443c 100644
@@ -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) {
Signature · 1 line
2.1.4