Skip to contentSkip to conversation

qla2xx: annotate structs and function prototypes

PATCH New Harvey Harrison 1 participant 1 message Feb 20, 2009

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

PATCH 1/1 qla2xx: annotate structs and function prototypes

There should be no functional changes, this is just cleaning up the endian noise a bit (> 1000 warnings).

---
Not quite finished yet, but the patch was getting so large I wanted to get some feedback before continuing.

 drivers/scsi/qla2xxx/qla_attr.c |    4 +-
 drivers/scsi/qla2xxx/qla_dbg.c  |   31 ++--
 drivers/scsi/qla2xxx/qla_dbg.h  |  332 +++++++++++++++++++-------------------
 drivers/scsi/qla2xxx/qla_def.h  |  102 ++++++------
 drivers/scsi/qla2xxx/qla_fw.h   |  106 ++++++------
 drivers/scsi/qla2xxx/qla_iocb.c |    5 +-
 drivers/scsi/qla2xxx/qla_sup.c  |   15 +-
 7 files changed, 297 insertions(+), 298 deletions(-)
drivers/scsi/qla2xxx/qla_attr.c +2 -2
index f4c5722..19a7422 100644
@@ -116,10 +116,10 @@ qla2x00_sysfs_write_nvram(struct kobject *kobj,
 
 	/* Checksum NVRAM. */
 	if (IS_FWI2_CAPABLE(ha)) {
-		uint32_t *iter;
+		__le32 *iter;
 		uint32_t chksum;
 
-		iter = (uint32_t *)buf;
+		iter = (__le32 *)buf;
 		chksum = 0;
 		for (cnt = 0; cnt < ((count >> 2) - 1); cnt++)
 			chksum += le32_to_cpu(*iter++);
drivers/scsi/qla2xxx/qla_dbg.c +15 -16
index 2a4e412..c281b3a 100644
@@ -40,7 +40,7 @@ qla2xxx_copy_queues(struct qla_hw_data *ha, void *ptr)
 }
 
 static int
-qla24xx_dump_ram(struct qla_hw_data *ha, uint32_t addr, uint32_t *ram,
+qla24xx_dump_ram(struct qla_hw_data *ha, uint32_t addr, __be32 *ram,
     uint32_t ram_dwords, void **nxt)
 {
 	int rval;
@@ -114,7 +114,7 @@ qla24xx_dump_ram(struct qla_hw_data *ha, uint32_t addr, uint32_t *ram,
 }
 
 static int
-qla24xx_dump_memory(struct qla_hw_data *ha, uint32_t *code_ram,
+qla24xx_dump_memory(struct qla_hw_data *ha, __be32 *code_ram,
     uint32_t cram_size, void **nxt)
 {
 	int rval;
@@ -129,9 +129,9 @@ qla24xx_dump_memory(struct qla_hw_data *ha, uint32_t *code_ram,
 	    ha->fw_memory_size - 0x100000 + 1, nxt);
 }
 
-static uint32_t *
+static __be32 *
 qla24xx_read_window(struct device_reg_24xx __iomem *reg, uint32_t iobase,
-    uint32_t count, uint32_t *buf)
+    uint32_t count, __be32 *buf)
 {
 	uint32_t __iomem *dmp_reg;
 
@@ -217,7 +217,7 @@ qla24xx_soft_reset(struct qla_hw_data *ha)
 }
 
 static int
-qla2xxx_dump_ram(struct qla_hw_data *ha, uint32_t addr, uint16_t *ram,
+qla2xxx_dump_ram(struct qla_hw_data *ha, uint32_t addr, __be16 *ram,
     uint16_t ram_words, void **nxt)
 {
 	int rval;
@@ -302,7 +302,7 @@ qla2xxx_dump_ram(struct qla_hw_data *ha, uint32_t addr, uint16_t *ram,
 
 static inline void
 qla2xxx_read_window(struct device_reg_2xxx __iomem *reg, uint32_t count,
-    uint16_t *buf)
+    __be16 *buf)
 {
 	uint16_t __iomem *dmp_reg = &reg->u.isp2300.fb_cmd;
 
@@ -321,10 +321,10 @@ qla24xx_copy_eft(struct qla_hw_data *ha, void *ptr)
 }
 
 static inline void *
-qla25xx_copy_fce(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain)
+qla25xx_copy_fce(struct qla_hw_data *ha, void *ptr, __be32 **last_chain)
 {
 	uint32_t cnt;
-	uint32_t *iter_reg;
+	__be32 *iter_reg;
 	struct qla2xxx_fce_chain *fcec = ptr;
 
 	if (!ha->fce)
@@ -348,7 +348,7 @@ qla25xx_copy_fce(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain)
 }
 
 static inline void *
-qla25xx_copy_mq(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain)
+qla25xx_copy_mq(struct qla_hw_data *ha, void *ptr, __be32 **last_chain)
 {
 	uint32_t cnt, que_idx;
 	uint8_t req_cnt, rsp_cnt, que_cnt;
@@ -368,8 +368,7 @@ qla25xx_copy_mq(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain)
 	que_cnt = req_cnt > rsp_cnt ? req_cnt : rsp_cnt;
 	mq->count = htonl(que_cnt);
 	for (cnt = 0; cnt < que_cnt; cnt++) {
-		reg = (struct device_reg_25xxmq *) ((void *)
-			ha->mqiobase + cnt * QLA_QUE_PAGE);
+		reg = ((void __iomem *)ha->mqiobase + cnt * QLA_QUE_PAGE);
 		que_idx = cnt * 4;
 		mq->qregs[que_idx] = htonl(RD_REG_DWORD(&reg->req_q_in));
 		mq->qregs[que_idx+1] = htonl(RD_REG_DWORD(&reg->req_q_out));
@@ -766,7 +765,7 @@ qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
 	struct qla_hw_data *ha = vha->hw;
 	struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
 	uint32_t __iomem *dmp_reg;
-	uint32_t	*iter_reg;
+	__be32	*iter_reg;
 	uint16_t __iomem *mbx_reg;
 	unsigned long	flags;
 	struct qla24xx_fw_dump *fw;
@@ -1013,13 +1012,13 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
 	struct qla_hw_data *ha = vha->hw;
 	struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
 	uint32_t __iomem *dmp_reg;
-	uint32_t	*iter_reg;
+	__be32	*iter_reg;
 	uint16_t __iomem *mbx_reg;
 	unsigned long	flags;
 	struct qla25xx_fw_dump *fw;
 	uint32_t	ext_mem_cnt;
 	void		*nxt, *nxt_chain;
-	uint32_t	*last_chain = NULL;
+	__be32	*last_chain = NULL;
 	struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
 
 	risc_address = ext_mem_cnt = 0;
@@ -1334,13 +1333,13 @@ qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
 	struct qla_hw_data *ha = vha->hw;
 	struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
 	uint32_t __iomem *dmp_reg;
-	uint32_t	*iter_reg;
+	__be32	*iter_reg;
 	uint16_t __iomem *mbx_reg;
 	unsigned long	flags;
 	struct qla81xx_fw_dump *fw;
 	uint32_t	ext_mem_cnt;
 	void		*nxt, *nxt_chain;
-	uint32_t	*last_chain = NULL;
+	__be32	*last_chain = NULL;
 	struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
 
 	risc_address = ext_mem_cnt = 0;
drivers/scsi/qla2xxx/qla_dbg.h +166 -166

372 lines not on this page · raw message

drivers/scsi/qla2xxx/qla_def.h +51 -51

231 lines not on this page · raw message

drivers/scsi/qla2xxx/qla_fw.h +53 -53

289 lines not on this page · raw message

drivers/scsi/qla2xxx/qla_iocb.c +2 -3
index 8df3d04..9c1a2bf 100644
@@ -164,8 +164,7 @@ void qla2x00_build_scsi_iocbs_32(srb_t *sp, cmd_entry_t *cmd_pkt,
 	cmd = sp->cmd;
 
 	/* Update entry type to indicate Command Type 2 IOCB */
-	*((uint32_t *)(&cmd_pkt->entry_type)) =
-	    cpu_to_le32(COMMAND_TYPE);
+	*((__le32 *)(&cmd_pkt->entry_type)) = cpu_to_le32(COMMAND_TYPE);
 
 	/* No data transfer */
 	if (!scsi_bufflen(cmd) || cmd->sc_data_direction == DMA_NONE) {
@@ -636,7 +635,7 @@ qla24xx_build_scsi_iocbs(srb_t *sp, struct cmd_type_7 *cmd_pkt,
     uint16_t tot_dsds)
 {
 	uint16_t	avail_dsds;
-	uint32_t	*cur_dsd;
+	__le32	*cur_dsd;
 	scsi_qla_host_t	*vha;
 	struct scsi_cmnd *cmd;
 	struct scatterlist *sg;
drivers/scsi/qla2xxx/qla_sup.c +8 -7
index c82c62c..1f4f89c 100644
@@ -239,7 +239,7 @@ qla2x00_write_nvram_word(struct qla_hw_data *ha, uint32_t addr, uint16_t data)
 
 static int
 qla2x00_write_nvram_word_tmo(struct qla_hw_data *ha, uint32_t addr,
-	uint16_t data, uint32_t tmo)
+	__le16 data, uint32_t tmo)
 {
 	int ret, count;
 	uint16_t word;
@@ -306,7 +306,7 @@ qla2x00_clear_nvram_protection(struct qla_hw_data *ha)
 	int ret, stat;
 	struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
 	uint32_t word, wait_cnt;
-	uint16_t wprot, wprot_old;
+	__le16 wprot, wprot_old;
 
 	/* Clear NVRAM write protection. */
 	ret = QLA_FUNCTION_FAILED;
@@ -545,7 +545,8 @@ qla2xxx_find_flt_start(scsi_qla_host_t *vha, uint32_t *start)
 	uint32_t pcihdr, pcids;
 	uint32_t *dcode;
 	uint8_t *buf, *bcode, last_image;
-	uint16_t cnt, chksum, *wptr;
+	uint16_t cnt, chksum;
+	__le16 *wptr;
 	struct qla_flt_location *fltl;
 	struct qla_hw_data *ha = vha->hw;
 	struct req_que *req = ha->req_q_map[0];
@@ -639,7 +640,7 @@ qla2xxx_get_flt_info(scsi_qla_host_t *vha, uint32_t flt_addr)
 		{ FA_NPIV_CONF1_ADDR_24, FA_NPIV_CONF1_ADDR,
 			FA_NPIV_CONF1_ADDR_81 };
 	uint32_t def;
-	uint16_t *wptr;
+	__le16 *wptr;
 	uint16_t cnt, chksum;
 	uint32_t start;
 	struct qla_flt_header *flt;
@@ -648,7 +649,7 @@ qla2xxx_get_flt_info(scsi_qla_host_t *vha, uint32_t flt_addr)
 	struct req_que *req = ha->req_q_map[0];
 
 	ha->flt_region_flt = flt_addr;
-	wptr = (uint16_t *)req->ring;
+	wptr = (__le16 *)req->ring;
 	flt = (struct qla_flt_header *)req->ring;
 	region = (struct qla_flt_region *)&flt[1];
 	ha->isp_ops->read_optrom(vha, (uint8_t *)req->ring,
@@ -740,14 +741,14 @@ qla2xxx_get_fdt_info(scsi_qla_host_t *vha)
 #define FLASH_BLK_SIZE_64K	0x10000
 	const char *loc, *locations[] = { "MID", "FDT" };
 	uint16_t cnt, chksum;
-	uint16_t *wptr;
+	__le16 *wptr;
 	struct qla_fdt_layout *fdt;
 	uint8_t	man_id, flash_id;
 	uint16_t mid, fid;
 	struct qla_hw_data *ha = vha->hw;
 	struct req_que *req = ha->req_q_map[0];
 
-	wptr = (uint16_t *)req->ring;
+	wptr = (__le16 *)req->ring;
 	fdt = (struct qla_fdt_layout *)req->ring;
 	ha->isp_ops->read_optrom(vha, (uint8_t *)req->ring,
 	    ha->flt_region_fdt << 2, OPTROM_BURST_SIZE);
Signature · 1 line
1.6.2.rc1.175.g96b8a