All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] switchtec: fix some error codes
@ 2017-03-13 10:52 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2017-03-13 10:52 UTC (permalink / raw)
  To: Kurt Schwemmer, Logan Gunthorpe
  Cc: Stephen Bates, Bjorn Helgaas, linux-pci, kernel-janitors

We shouldn't be changing these negative error codes to positive.

Fixes: dbdb73b1e2c0 ("MicroSemi Switchtec management interface driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
index 82ae08956457..fcde98161d9a 100644
--- a/drivers/pci/switch/switchtec.c
+++ b/drivers/pci/switch/switchtec.c
@@ -656,7 +656,7 @@ static ssize_t switchtec_dev_write(struct file *filp, const char __user *data,
 
 	rc = lock_mutex_and_test_alive(stdev);
 	if (rc)
-		return -rc;
+		return rc;
 
 	if (stuser->state != MRPC_IDLE) {
 		rc = -EBADE;
@@ -700,7 +700,7 @@ static ssize_t switchtec_dev_read(struct file *filp, char __user *data,
 
 	rc = lock_mutex_and_test_alive(stdev);
 	if (rc)
-		return -rc;
+		return rc;
 
 	if (stuser->state = MRPC_IDLE) {
 		mutex_unlock(&stdev->mrpc_mutex);
@@ -722,7 +722,7 @@ static ssize_t switchtec_dev_read(struct file *filp, char __user *data,
 
 	rc = lock_mutex_and_test_alive(stdev);
 	if (rc)
-		return -rc;
+		return rc;
 
 	if (stuser->state != MRPC_DONE) {
 		mutex_unlock(&stdev->mrpc_mutex);

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

* [PATCH 2/2] switchtec: fix some error codes
@ 2017-03-13 10:52 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2017-03-13 10:52 UTC (permalink / raw)
  To: Kurt Schwemmer, Logan Gunthorpe
  Cc: Stephen Bates, Bjorn Helgaas, linux-pci, kernel-janitors

We shouldn't be changing these negative error codes to positive.

Fixes: dbdb73b1e2c0 ("MicroSemi Switchtec management interface driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
index 82ae08956457..fcde98161d9a 100644
--- a/drivers/pci/switch/switchtec.c
+++ b/drivers/pci/switch/switchtec.c
@@ -656,7 +656,7 @@ static ssize_t switchtec_dev_write(struct file *filp, const char __user *data,
 
 	rc = lock_mutex_and_test_alive(stdev);
 	if (rc)
-		return -rc;
+		return rc;
 
 	if (stuser->state != MRPC_IDLE) {
 		rc = -EBADE;
@@ -700,7 +700,7 @@ static ssize_t switchtec_dev_read(struct file *filp, char __user *data,
 
 	rc = lock_mutex_and_test_alive(stdev);
 	if (rc)
-		return -rc;
+		return rc;
 
 	if (stuser->state == MRPC_IDLE) {
 		mutex_unlock(&stdev->mrpc_mutex);
@@ -722,7 +722,7 @@ static ssize_t switchtec_dev_read(struct file *filp, char __user *data,
 
 	rc = lock_mutex_and_test_alive(stdev);
 	if (rc)
-		return -rc;
+		return rc;
 
 	if (stuser->state != MRPC_DONE) {
 		mutex_unlock(&stdev->mrpc_mutex);

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

end of thread, other threads:[~2017-03-13 10:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-13 10:52 [PATCH 2/2] switchtec: fix some error codes Dan Carpenter
2017-03-13 10:52 ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.