Skip to contentSkip to conversation

qla2xxx: Fix qla27xx_write_reg()

RFC PATCH New Bart Van Assche 1 participant 1 message Jan 14, 2015

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

RFC PATCH 1/1 qla2xxx: Fix qla27xx_write_reg()

The second argument passed to qla27xx_write_reg() is a byte offset. This means that this function must read data from (void *)reg + offset instead of (void *)reg + sizeof(*reg) * offset. Found this via source reading. Untested.

---
 drivers/scsi/qla2xxx/qla_tmpl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qla2xxx/qla_tmpl.c +1 -1
index a8c0c73..7a92f60 100644
@@ -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 __iomem *)reg + offset;
 
 	if (buf) {
 		WRT_REG_DWORD(window, data);
Signature · 1 line
2.1.2