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


Groups > linux.kernel > #1295433 > unrolled thread

[PATCH] SCSI-lpfc: Use a signed return type for two functions

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

Back to article view | Back to linux.kernel


Contents

  [PATCH] SCSI-lpfc: Use a signed return type for two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-19 19:50 +0100
    Re: [PATCH] SCSI-lpfc: Use a signed return type for two functions Dan Carpenter <dan.carpenter@oracle.com> - 2015-12-19 21:20 +0100

#1295433 — [PATCH] SCSI-lpfc: Use a signed return type for two functions

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2015-12-19 19:50 +0100
Subject[PATCH] SCSI-lpfc: Use a signed return type for two functions
Message-ID<qHuJQ-6Om-7@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 19 Dec 2015 19:32:27 +0100

The return type "size_t" was used by the functions "lpfc_wwn_set"
and "lpfc_oas_lun_state_set" despite of the aspect that they will
eventually return a negative error code.
Improve this implementation detail by using the type "ssize_t" instead.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/scsi/lpfc/lpfc_attr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index f6446d7..777960e 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -2089,7 +2089,7 @@ static char *lpfc_soft_wwn_key = "C99G71SL8032A";
  * -EINVAL if the buffer does not contain a valid wwn
  * 0 success
  **/
-static size_t
+static ssize_t
 lpfc_wwn_set(const char *buf, size_t cnt, char wwn[])
 {
 	unsigned int i, j;
@@ -2570,7 +2570,7 @@ static DEVICE_ATTR(lpfc_xlane_lun_status, S_IRUGO,
  * -EPERM OAS is not enabled or not supported by this port.
  *
  */
-static size_t
+static ssize_t
 lpfc_oas_lun_state_set(struct lpfc_hba *phba, uint8_t vpt_wwpn[],
 		       uint8_t tgt_wwpn[], uint64_t lun, uint32_t oas_state)
 {
-- 
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]


#1295451

FromDan Carpenter <dan.carpenter@oracle.com>
Date2015-12-19 21:20 +0100
Message-ID<qHw8W-7P7-21@gated-at.bofh.it>
In reply to#1295433
It returns zero or negative error codes.  The callers expect int.  The
current code is harmless.  It should return an 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] | [standalone]


Back to top | Article view | linux.kernel


csiph-web