diff mbox

[02/14] qla2xxx: Fix crash due to wrong casting of reg for ISP27XX.

Message ID 1428606008-14976-3-git-send-email-himanshu.madhani@qlogic.com (mailing list archive)
State New, archived
Headers show

Commit Message

Himanshu Madhani April 9, 2015, 6:59 p.m. UTC
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
---
 drivers/scsi/qla2xxx/qla_tmpl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Bart Van Assche April 10, 2015, 5:59 a.m. UTC | #1
On 04/09/15 20:59, Himanshu Madhani wrote:
> Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
> Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
> ---
>   drivers/scsi/qla2xxx/qla_tmpl.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/scsi/qla2xxx/qla_tmpl.c b/drivers/scsi/qla2xxx/qla_tmpl.c
> index a8c0c73..7a92f60 100644
> --- a/drivers/scsi/qla2xxx/qla_tmpl.c
> +++ b/drivers/scsi/qla2xxx/qla_tmpl.c
> @@ -190,7 +190,7 @@ static inline void
>   qla27xx_write_reg(__iomem struct device_reg_24xx *reg,
>   	uint offset, uint32_t data, void *buf)
>   {
> -	__iomem void *window = reg + offset;
> +	__iomem void *window = (void *)reg + offset;
>
>   	if (buf) {
>   		WRT_REG_DWORD(window, data);
>

Hello Himanshu,

The above patch introduces a new sparse warning since an __iomem 
annotation is missing from the cast. Had you noticed that I had already 
posted a fix for this crash in January that does not introduce a new 
sparse warning ? See also http://thread.gmane.org/gmane.linux.scsi/98426.

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hannes Reinecke April 10, 2015, 6:31 a.m. UTC | #2
On 04/09/2015 08:59 PM, Himanshu Madhani wrote:
> Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
> Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
> ---
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
diff mbox

Patch

diff --git a/drivers/scsi/qla2xxx/qla_tmpl.c b/drivers/scsi/qla2xxx/qla_tmpl.c
index a8c0c73..7a92f60 100644
--- a/drivers/scsi/qla2xxx/qla_tmpl.c
+++ b/drivers/scsi/qla2xxx/qla_tmpl.c
@@ -190,7 +190,7 @@  static inline void
 qla27xx_write_reg(__iomem struct device_reg_24xx *reg,
 	uint offset, uint32_t data, void *buf)
 {
-	__iomem void *window = reg + offset;
+	__iomem void *window = (void *)reg + offset;
 
 	if (buf) {
 		WRT_REG_DWORD(window, data);