From patchwork Sat Dec 19 18:44:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 7890641 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1EE8FBEEED for ; Sat, 19 Dec 2015 18:45:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4299E2047D for ; Sat, 19 Dec 2015 18:45:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5D76F20519 for ; Sat, 19 Dec 2015 18:45:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933359AbbLSSo1 (ORCPT ); Sat, 19 Dec 2015 13:44:27 -0500 Received: from mout.web.de ([212.227.17.11]:49614 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932750AbbLSSoZ (ORCPT ); Sat, 19 Dec 2015 13:44:25 -0500 Received: from [192.168.1.3] ([78.53.50.164]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0LshSX-1aKzTP1d1N-012HWb; Sat, 19 Dec 2015 19:44:10 +0100 To: linux-scsi@vger.kernel.org, Dick Kennedy , "James E. J. Bottomley" , James Smart , "Martin K. Petersen" Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Subject: [PATCH] SCSI-lpfc: Use a signed return type for two functions X-Enigmail-Draft-Status: N1110 Message-ID: <5675A576.8020008@users.sourceforge.net> Date: Sat, 19 Dec 2015 19:44:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 X-Provags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EcB/zR17R9P40DsTtGtLOMF/7ZeuW109 XDmO4Og Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring 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 --- 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) {