[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20120519033821.GA2425@localhost.localdomain>
Date: Sat, 19 May 2012 11:38:21 +0800
From: Aaron Lu <aaron.lu@....com>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: "James E.J. Bottomley" <JBottomley@...allels.com>,
Alan Stern <stern@...land.harvard.edu>,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org, Aaron Lu <aaron.lwe@...il.com>
Subject: Re: [patch] [SCSI] scsi_pm: passing wrong pointer to resume()
> From: Dan Carpenter [dan.carpenter@...cle.com]
> To: James E.J. Bottomley; Lu, Aaron
> Cc: linux-scsi@...r.kernel.org; linux-kernel@...r.kernel.org; kernel-janitors@...r.kernel.org; Alan Stern
> Subject: [patch] [SCSI] scsi_pm: passing wrong pointer to resume()
>
> This gets caught by GCC:
> drivers/scsi/scsi_pm.c:30:5: warning: passing argument 1 of
> ‘scsi_device_resume’ from incompatible pointer type
> [enabled by default]
Thanks for pointing this out.
I've posted v2 the other day and James is aware of this already:
http://marc.info/?l=linux-scsi&m=133706440112890&w=2
>
> It probably would have been caught in testing as well, but it's on an
> error path.
I'm dealing with such error so developed this patch. But there are other
changes too in my code, so I prepared this patch in another clean repo
and made the mistake, sorry for not testing it before submit.
-Aaron
>
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
> ---
> I haven't tested this. :/ Sorry for that.
>
> diff --git a/drivers/scsi/scsi_pm.c b/drivers/scsi/scsi_pm.c
> index 9bd2c41..d4201de 100644
> --- a/drivers/scsi/scsi_pm.c
> +++ b/drivers/scsi/scsi_pm.c
> @@ -27,7 +27,7 @@ static int scsi_dev_type_suspend(struct device *dev, pm_message_t msg)
> if (drv && drv->suspend) {
> err = drv->suspend(dev, msg);
> if (err)
> - scsi_device_resume(dev);
> + scsi_device_resume(to_scsi_device(dev));
> }
> }
> dev_dbg(dev, "scsi suspend: %d\n", err);
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists