From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-scsi@vger.kernel.org,
Dick Kennedy <dick.kennedy@avagotech.com>,
"James E. J. Bottomley" <JBottomley@odin.com>,
James Smart <james.smart@avagotech.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org,
Julia Lawall <julia.lawall@lip6.fr>
Subject: [PATCH] SCSI-lpfc: Use a signed return type for two functions
Date: Sat, 19 Dec 2015 18:44:06 +0000 [thread overview]
Message-ID: <5675A576.8020008@users.sourceforge.net> (raw)
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
WARNING: multiple messages have this Message-ID (diff)
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-scsi@vger.kernel.org,
Dick Kennedy <dick.kennedy@avagotech.com>,
"James E. J. Bottomley" <JBottomley@odin.com>,
James Smart <james.smart@avagotech.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org,
Julia Lawall <julia.lawall@lip6.fr>
Subject: [PATCH] SCSI-lpfc: Use a signed return type for two functions
Date: Sat, 19 Dec 2015 19:44:06 +0100 [thread overview]
Message-ID: <5675A576.8020008@users.sourceforge.net> (raw)
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
next reply other threads:[~2015-12-19 18:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-19 18:44 SF Markus Elfring [this message]
2015-12-19 18:44 ` [PATCH] SCSI-lpfc: Use a signed return type for two functions SF Markus Elfring
2015-12-19 20:17 ` Dan Carpenter
2015-12-19 20:17 ` Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5675A576.8020008@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=JBottomley@odin.com \
--cc=dick.kennedy@avagotech.com \
--cc=james.smart@avagotech.com \
--cc=julia.lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.