From: Su Hui <suhui@nfschina.com>
To: dan.carpenter@linaro.org, hare@suse.com, jejb@linux.ibm.com,
martin.petersen@oracle.com
Cc: Su Hui <suhui@nfschina.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH v2 1/3] scsi: aic7xxx: return negative error codes in ahc_linux_register_host()
Date: Fri, 1 Dec 2023 10:59:54 +0800 [thread overview]
Message-ID: <20231201025955.1584260-2-suhui@nfschina.com> (raw)
In-Reply-To: <20231201025955.1584260-1-suhui@nfschina.com>
ahc_linux_register_host() return both positive and negative error code,
it's better to make this function only return negative error codes.
Signed-off-by: Su Hui <suhui@nfschina.com>
---
drivers/scsi/aic7xxx/aic7xxx_osm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index 4ae0a1c4d374..b0c4f2345321 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -1085,7 +1085,7 @@ ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *templa
template->name = ahc->description;
host = scsi_host_alloc(template, sizeof(struct ahc_softc *));
if (host == NULL)
- return (ENOMEM);
+ return -ENOMEM;
*((struct ahc_softc **)host->hostdata) = ahc;
ahc->platform_data->host = host;
--
2.30.2
next prev parent reply other threads:[~2023-12-01 3:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-01 2:59 [PATCH v2 0/3] scsi: aic7xxx: fix some problem of return value Su Hui
2023-12-01 2:59 ` Su Hui [this message]
2023-12-01 2:59 ` [PATCH v2 2/3] scsi: aic7xxx: return ahc_linux_register_host()'s value rather than zero Su Hui
2023-12-01 2:59 ` [PATCH v2 3/3] scsi: aic7xxx: return negative error codes in aic7770_probe() Su Hui
2023-12-03 10:34 ` Christophe JAILLET
2023-12-03 10:36 ` Marion & Christophe JAILLET
2023-12-01 7:53 ` [PATCH v2 0/3] scsi: aic7xxx: fix some problem of return value Dan Carpenter
2023-12-05 3:33 ` Su Hui
2023-12-05 8:14 ` Dan Carpenter
2023-12-05 8:28 ` Su Hui
2023-12-06 2:18 ` Martin K. Petersen
2023-12-14 4:29 ` Martin K. Petersen
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=20231201025955.1584260-2-suhui@nfschina.com \
--to=suhui@nfschina.com \
--cc=dan.carpenter@linaro.org \
--cc=hare@suse.com \
--cc=jejb@linux.ibm.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®