Skip to contentSkip to conversation

qla4xxx: remove some bogus casts

PATCH In review Dan Carpenter 3 participants 6 messages Aug 17, 2015 – Jan 26, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qla4xxx: remove some bogus casts

These casts are wrong and unnecessary. They annoy static checkers because they imply we are planning to write sizeof(long) bytes to a sizeof(u32) buffer which would corrupt memory.

drivers/scsi/qla4xxx/ql4_init.c +6 -12
index 4180d6d..d97ea5d 100644
@@ -101,19 +101,13 @@ int qla4xxx_init_rings(struct scsi_qla_host *ha)
 	ha->response_ptr = &ha->response_ring[ha->response_out];
 
 	if (is_qla8022(ha)) {
-		writel(0,
-		    (unsigned long  __iomem *)&ha->qla4_82xx_reg->req_q_out);
-		writel(0,
-		    (unsigned long  __iomem *)&ha->qla4_82xx_reg->rsp_q_in);
-		writel(0,
-		    (unsigned long  __iomem *)&ha->qla4_82xx_reg->rsp_q_out);
+		writel(0, &ha->qla4_82xx_reg->req_q_out);
+		writel(0, &ha->qla4_82xx_reg->rsp_q_in);
+		writel(0, &ha->qla4_82xx_reg->rsp_q_out);
 	} else if (is_qla8032(ha) || is_qla8042(ha)) {
-		writel(0,
-		       (unsigned long __iomem *)&ha->qla4_83xx_reg->req_q_in);
-		writel(0,
-		       (unsigned long __iomem *)&ha->qla4_83xx_reg->rsp_q_in);
-		writel(0,
-		       (unsigned long __iomem *)&ha->qla4_83xx_reg->rsp_q_out);
+		writel(0, &ha->qla4_83xx_reg->req_q_in);
+		writel(0, &ha->qla4_83xx_reg->rsp_q_in);
+		writel(0, &ha->qla4_83xx_reg->rsp_q_out);
 	} else {
 		/*
 		 * Initialize DMA Shadow registers.  The firmware is really
#1 lore raw
Quoted 3 lines · Dan Carpenter

These casts are wrong and unnecessary. They annoy static checkers because they imply we are planning to write sizeof(long) bytes to a sizeof(u32) buffer which would corrupt memory.

Hello Dan,

Can you verify whether that patch is still needed after having applied the patch series I posted in July (and that was acknowledged by QLogic):
http://thread.gmane.org/gmane.linux.scsi/103135 ?

Thanks,

Bart.

#2 lore raw
Quoted 11 lines · Bart Van Assche
Quoted 3 lines · Dan Carpenter

These casts are wrong and unnecessary. They annoy static checkers because they imply we are planning to write sizeof(long) bytes to a sizeof(u32) buffer which would corrupt memory.

Hello Dan,

Can you verify whether that patch is still needed after having applied the patch series I posted in July (and that was acknowledged by QLogic): http://thread.gmane.org/gmane.linux.scsi/103135 ?

I think it is needed still?

regards,
dan carpenter

Reviewed-by
#3 lore raw
Quoted 6 lines · Dan Carpenter
Quoted 5 lines · Bart Van Assche
Quoted 3 lines · Dan Carpenter

These casts are wrong and unnecessary. They annoy static checkers because they imply we are planning to write sizeof(long) bytes to a sizeof(u32) buffer which would corrupt memory.

Quoted 8 lines
Quoted 6 lines

Hello Dan,

Can you verify whether that patch is still needed after having applied the patch series I posted in July (and that was acknowledged by QLogic): http://thread.gmane.org/gmane.linux.scsi/103135 ?

I think it is needed still?

Hello Dan,

You are right, this patch is indeed needed. Hence:

#4 lore raw
Quoted 14 lines · Bart Van Assche
Quoted 13 lines · Dan Carpenter
Quoted 11 lines · Bart Van Assche
Quoted 3 lines · Dan Carpenter

These casts are wrong and unnecessary. They annoy static checkers because they imply we are planning to write sizeof(long) bytes to a sizeof(u32) buffer which would corrupt memory.

Hello Dan,

Can you verify whether that patch is still needed after having applied the patch series I posted in July (and that was acknowledged by QLogic): http://thread.gmane.org/gmane.linux.scsi/103135 ?

Quoted 7 lines
Quoted 1 line

I think it is needed still?

Hello Dan,

You are right, this patch is indeed needed. Hence:

Hello Martin,

Do you need more reviews to queue this patch?

Thanks,

Bart.

#5 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Bart" == Bart Van Assche <[email protected]> writes:

Hi Bart,

Bart> Do you need more reviews to queue this patch?

It's more than a month old and consequently it doesn't exist :). Please repost.

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering