Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1295437 > unrolled thread

[PATCH] staging-slicoss: Use a signed return type for slic_card_locate()

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2015-12-19 20:40 +0100
Last post2015-12-22 15:20 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] staging-slicoss: Use a signed return type for  slic_card_locate() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-19 20:40 +0100
    Re: [PATCH] staging-slicoss: Use a signed return type for  slic_card_locate() Dan Carpenter <dan.carpenter@oracle.com> - 2015-12-19 21:30 +0100
      [PATCH v2] staging-slicoss: Use a signed return type for  slic_card_locate() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-22 15:20 +0100

#1295437 — [PATCH] staging-slicoss: Use a signed return type for slic_card_locate()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2015-12-19 20:40 +0100
Subject[PATCH] staging-slicoss: Use a signed return type for slic_card_locate()
Message-ID<qHvwd-7mb-11@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 19 Dec 2015 20:30:39 +0100

The return type "u32" was used by the slic_card_locate() function
despite of the aspect that it will eventually return a negative
error code.
Improve this implementation detail by using the type "s32" instead.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/staging/slicoss/slicoss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index b23a2d1..9ba0e4b 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -2953,7 +2953,7 @@ static const struct net_device_ops slic_netdev_ops = {
 	.ndo_change_mtu		= eth_change_mtu,
 };
 
-static u32 slic_card_locate(struct adapter *adapter)
+static s32 slic_card_locate(struct adapter *adapter)
 {
 	struct sliccard *card = slic_global.slic_card;
 	struct physcard *physcard = slic_global.phys_card;
-- 
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1295454

FromDan Carpenter <dan.carpenter@oracle.com>
Date2015-12-19 21:30 +0100
Message-ID<qHwiC-7SO-11@gated-at.bofh.it>
In reply to#1295437
It returns zero or negative error codes.  The callers expect int.  It is
harmless.  It should just be int.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1296803 — [PATCH v2] staging-slicoss: Use a signed return type for slic_card_locate()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2015-12-22 15:20 +0100
Subject[PATCH v2] staging-slicoss: Use a signed return type for slic_card_locate()
Message-ID<qIvXc-50w-11@gated-at.bofh.it>
In reply to#1295454
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 22 Dec 2015 15:05:16 +0100

The return type "u32" was used by the slic_card_locate() function
even though it will eventually return a negative error code.
Improve this implementation detail by using the type "int" instead.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/staging/slicoss/slicoss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index b23a2d1..156e57f 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -2953,7 +2953,7 @@ static const struct net_device_ops slic_netdev_ops = {
 	.ndo_change_mtu		= eth_change_mtu,
 };
 
-static u32 slic_card_locate(struct adapter *adapter)
+static int slic_card_locate(struct adapter *adapter)
 {
 	struct sliccard *card = slic_global.slic_card;
 	struct physcard *physcard = slic_global.phys_card;
-- 
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web