scsi: aic7xxx: Return negative error codes in ahc_linux_register_host()
authorSu Hui <suhui@nfschina.com>
Fri, 1 Dec 2023 02:59:54 +0000 (10:59 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 6 Dec 2023 02:18:40 +0000 (21:18 -0500)
ahc_linux_register_host() returns both positive and negative error codes.
It's better to make this function only return negative error codes.

Signed-off-by: Su Hui <suhui@nfschina.com>
Link: https://lore.kernel.org/r/20231201025955.1584260-2-suhui@nfschina.com
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/aic7xxx/aic7xxx_osm.c

index 4ae0a1c4d37488006fdf604ed838a2a76d6bb613..b0c4f2345321533794eb713f25f9136e42f58ae7 100644 (file)
@@ -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;