bfa: fix endianess sparse check warnings
Subsystems (2)
PATCH 2/2 bfa: fix endianess sparse check warnings
First round of fix for the endianess check warnings from make C=2 CF="-D__CHECK_ENDIAN__".
Signed-off-by Maggie <[email protected]>
--- drivers/scsi/bfa/bfa_cb_ioim.h | 2 +- drivers/scsi/bfa/bfa_defs_svc.h | 8 +- drivers/scsi/bfa/bfa_fc.h | 50 ++++---- drivers/scsi/bfa/bfa_fcbuild.c | 44 ++++---- drivers/scsi/bfa/bfa_fcbuild.h | 28 +++--- drivers/scsi/bfa/bfa_fcs.h | 14 +- drivers/scsi/bfa/bfa_fcs_lport.c | 226 +++++++++++++++++++------------------- drivers/scsi/bfa/bfa_fcs_rport.c | 2 +- drivers/scsi/bfa/bfa_ioc.c | 5 +- drivers/scsi/bfa/bfa_ioc.h | 8 +- drivers/scsi/bfa/bfa_port.c | 2 +- drivers/scsi/bfa/bfa_svc.c | 4 +- drivers/scsi/bfa/bfi.h | 4 +- drivers/scsi/bfa/bfi_ms.h | 50 ++++---- 14 files changed, 225 insertions(+), 222 deletions(-)
drivers/scsi/bfa/bfa_cb_ioim.h +1 -1
@@ -32,7 +32,7 @@ static inline lun_t bfad_int_to_lun(u32 luno) {union { -u16 scsi_lun[4 ]; +__be16 scsi_lun[4 ];lun_t bfa_lun; } lun;
drivers/scsi/bfa/bfa_defs_svc.h +4 -4
@@ -34,8 +34,8 @@struct bfa_iocfc_intr_attr_s {u8 coalesce;/* enable/disable coalescing */ u8 rsvd[3 ]; -u16 latency;/* latency in microseconds */ -u16 delay;/* delay in microseconds */ +__be16 latency;/* latency in microseconds */ +__be16 delay;/* delay in microseconds */ };/*
@@ -743,7 +743,7 @@ struct bfa_port_cfg_s {u8 qos_enabled;/* qos enabled or not */ u8 cfg_hardalpa;/* is hard alpa configured */ u8 hardalpa;/* configured hard alpa */ -u16 maxfrsize;/* maximum frame size */ +__be16 maxfrsize;/* maximum frame size */ u8 rx_bbcredit;/* receive buffer credits */ u8 tx_bbcredit;/* transmit buffer credits */ u8 ratelimit;/* ratelimit enabled or not */
@@ -843,7 +843,7 @@ struct bfa_fcport_fcf_s {u8 fka_disabled;/* FKA is disabled */ u8 maxsz_verified;/* FCoE max size verified */ u8 fc_map[3 ];/* FC map */ -u16 vlan;/* FCoE vlan tag/priority */ +__be16 vlan;/* FCoE vlan tag/priority */ u32 fka_adv_per;/* FIP ka advert. period */ mac_t mac;/* FCF mac */ };
drivers/scsi/bfa/bfa_fc.h +25 -25
153 lines not on this page · raw message
drivers/scsi/bfa/bfa_fcbuild.c +22 -22
171 lines not on this page · raw message
drivers/scsi/bfa/bfa_fcbuild.h +14 -14
@@ -138,7 +138,7 @@ u16 fc_fdisc_build(struct fchs_s *buf, struct fc_logi_s *flogi, u32 s_id, u16 pdu_size);u16 fc_flogi_acc_build (struct fchs_s *fchs,struct fc_logi_s *flogi, -u32 s_id,u16 ox_id, +u32 s_id,__be16 ox_id,wwn_t port_name,wwn_t node_name,u16 pdu_size,u16 local_bb_credits);
@@ -186,7 +186,7 @@ u16 fc_plogi_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, u16 pdu_size);u16 fc_adisc_build (struct fchs_s *fchs,struct fc_adisc_s *adisc, -u32 d_id,u32 s_id,u16 ox_id,wwn_t port_name, +u32 d_id,u32 s_id,__be16 ox_id,wwn_t port_name,wwn_t node_name); enum fc_parse_status fc_adisc_parse(struct fchs_s *fchs, void *pld,
@@ -196,20 +196,20 @@ enum fc_parse_status fc_adisc_rsp_parse(struct fc_adisc_s *adisc, int len, wwn_t port_name, wwn_t node_name);u16 fc_adisc_acc_build (struct fchs_s *fchs,struct fc_adisc_s *adisc, -u32 d_id,u32 s_id,u16 ox_id, +u32 d_id,u32 s_id,__be16 ox_id,wwn_t port_name,wwn_t node_name);u16 fc_ls_rjt_build (struct fchs_s *fchs,struct fc_ls_rjt_s *ls_rjt, -u32 d_id,u32 s_id,u16 ox_id, +u32 d_id,u32 s_id,__be16 ox_id,u8 reason_code,u8 reason_code_expl);u16 fc_ls_acc_build (struct fchs_s *fchs,struct fc_els_cmd_s *els_cmd, -u32 d_id,u32 s_id,u16 ox_id); +u32 d_id,u32 s_id,__be16 ox_id);u16 fc_prli_build (struct fchs_s *fchs,void *pld,u32 d_id,u32 s_id,u16 ox_id);enum fc_parse_status fc_prli_rsp_parse (struct fc_prli_s *prli,int len);u16 fc_prli_acc_build (struct fchs_s *fchs,void *pld,u32 d_id, -u32 s_id,u16 ox_id, +u32 s_id,__be16 ox_id,enum bfa_lport_role role); u16 fc_rnid_build(struct fchs_s *fchs, struct fc_rnid_cmd_s *rnid,
@@ -218,7 +218,7 @@ u16 fc_rnid_build(struct fchs_s *fchs, struct fc_rnid_cmd_s *rnid,u16 fc_rnid_acc_build (struct fchs_s *fchs,struct fc_rnid_acc_s *rnid_acc,u32 d_id,u32 s_id, -u16 ox_id,u32 data_format, +__be16 ox_id,u32 data_format,struct fc_rnid_common_id_data_s *common_id_data,struct fc_rnid_general_topology_data_s *gen_topo_data);
@@ -228,7 +228,7 @@ u16 fc_rpsc_build(struct fchs_s *fchs, struct fc_rpsc_cmd_s *rpsc, u32 d_id, u32 s_id, u16 ox_id);u16 fc_rpsc_acc_build (struct fchs_s *fchs,struct fc_rpsc_acc_s *rpsc_acc,u32 d_id,u32 s_id, -u16 ox_id,struct fc_rpsc_speed_info_s *oper_speed); +__be16 ox_id,struct fc_rpsc_speed_info_s *oper_speed);u16 fc_gid_ft_build (struct fchs_s *fchs,void *pld,u32 s_id,u8 fc4_type);
@@ -251,7 +251,7 @@ u16 fc_logo_build(struct fchs_s *fchs, struct fc_logo_s *logo, u32 d_id, u32 s_id, u16 ox_id, wwn_t port_name);u16 fc_logo_acc_build (struct fchs_s *fchs,void *pld,u32 d_id, -u32 s_id,u16 ox_id); +u32 s_id,__be16 ox_id);u16 fc_fdmi_reqhdr_build (struct fchs_s *fchs,void *pyld,u32 s_id,u16 cmd_code);
@@ -261,7 +261,7 @@ u16 fc_gfn_req_build(struct fchs_s *fchs, void *pyld, u32 s_id, wwn_t wwn);void fc_get_fc4type_bitmask (u8 fc4_type,u8 *bit_mask);void fc_els_req_build (struct fchs_s *fchs,u32 d_id,u32 s_id, -u16 ox_id); +__be16 ox_id);enum fc_parse_status fc_els_rsp_parse (struct fchs_s *fchs,int len);
@@ -274,15 +274,15 @@ enum fc_parse_status fc_pdisc_parse(struct fchs_s *fchs, wwn_t node_name, wwn_t port_name);u16 fc_ba_acc_build (struct fchs_s *fchs,struct fc_ba_acc_s *ba_acc,u32 d_id, -u32 s_id,u16 ox_id,u16 rx_id); +u32 s_id,__be16 ox_id,u16 rx_id);int fc_logout_params_pages (struct fchs_s *fc_frame,u8 els_code);u16 fc_tprlo_acc_build (struct fchs_s *fchs,struct fc_tprlo_acc_s *tprlo_acc, -u32 d_id,u32 s_id,u16 ox_id,int num_pages); +u32 d_id,u32 s_id,__be16 ox_id,int num_pages);u16 fc_prlo_acc_build (struct fchs_s *fchs,struct fc_prlo_acc_s *prlo_acc, -u32 d_id,u32 s_id,u16 ox_id,int num_pages); +u32 d_id,u32 s_id,__be16 ox_id,int num_pages);u16 fc_logo_rsp_parse (struct fchs_s *fchs,int len);
@@ -304,7 +304,7 @@ u16 fc_tprlo_build(struct fchs_s *fchs, u32 d_id, u32 s_id,u16 fc_tprlo_rsp_parse (struct fchs_s *fchs,int len);u16 fc_ba_rjt_build (struct fchs_s *fchs,u32 d_id,u32 s_id, -u16 ox_id,u32 reason_code,u32 reason_expl); +__be16 ox_id,u32 reason_code,u32 reason_expl);u16 fc_gnnid_build (struct fchs_s *fchs,void *pyld,u32 s_id,u16 ox_id,u32 port_id);
drivers/scsi/bfa/bfa_fcs.h +7 -7
@@ -109,7 +109,7 @@ struct bfa_fcs_lport_loop_s {struct bfa_fcs_lport_n2n_s {u32 rsvd; -u16 reply_oxid;/* ox_id from the req flogi to be +__be16 reply_oxid;/* ox_id from the req flogi to be *used in flogi acc */ wwn_t rem_port_wwn;/* Attached port's wwn */ };
@@ -406,7 +406,7 @@ struct bfa_fcs_rport_s {struct bfad_rport_s *rp_drv;/* driver peer instance */ u32 pid;/* port ID of rport */ u16 maxfrsize;/* maximum frame size */ -u16 reply_oxid;/* OX_ID of inbound requests */ +__be16 reply_oxid;/* OX_ID of inbound requests */ enum fc_cos fc_cos;/* FC classes of service supp */ bfa_boolean_t cisc;/* CISC capable device */ bfa_boolean_t prlo;/* processing prlo or LOGO */
@@ -471,7 +471,7 @@ void bfa_fcs_rport_plogi_create(struct bfa_fcs_lport_s *port,void bfa_fcs_rport_plogi (struct bfa_fcs_rport_s *rport,struct fchs_s *fchs,struct fc_logi_s *plogi);void bfa_fcs_rport_logo_imp (struct bfa_fcs_rport_s *rport); -void bfa_fcs_rport_prlo (struct bfa_fcs_rport_s *rport,u16 ox_id); +void bfa_fcs_rport_prlo (struct bfa_fcs_rport_s *rport,__be16 ox_id);void bfa_fcs_rport_itnim_ack (struct bfa_fcs_rport_s *rport);void bfa_fcs_rport_itntm_ack (struct bfa_fcs_rport_s *rport);
@@ -618,7 +618,7 @@ struct bfa_fcs_fdmi_hba_attr_s {u8 option_rom_ver[BFA_VERSION_LEN ];u8 fw_version[8 ];u8 os_name[256 ]; -u32 max_ct_pyld; +__be32 max_ct_pyld; };/*
@@ -626,9 +626,9 @@ struct bfa_fcs_fdmi_hba_attr_s {*/ struct bfa_fcs_fdmi_port_attr_s {u8 supp_fc4_types[32 ];/* supported FC4 types */ -u32 supp_speed;/* supported speed */ -u32 curr_speed;/* current Speed */ -u32 max_frm_size;/* max frame size */ +__be32 supp_speed;/* supported speed */ +__be32 curr_speed;/* current Speed */ +__be32 max_frm_size;/* max frame size */ u8 os_device_name[256 ];/* OS device Name */ u8 host_name[256 ];/* host name */ };
drivers/scsi/bfa/bfa_fcs_lport.c +114 -112
359 lines not on this page · raw message
drivers/scsi/bfa/bfa_fcs_rport.c +1 -1
@@ -2594,7 +2594,7 @@ bfa_fcs_rport_set_del_timeout(u8 rport_tmo) bfa_fcs_rport_del_timeout = rport_tmo *1000 ; }void -bfa_fcs_rport_prlo (struct bfa_fcs_rport_s *rport,u16 ox_id) +bfa_fcs_rport_prlo (struct bfa_fcs_rport_s *rport,__be16 ox_id) {bfa_trc (rport->fcs, rport->pid);
drivers/scsi/bfa/bfa_ioc.c +3 -2
@@ -1683,7 +1683,8 @@ bfa_ioc_mbox_hbfail(struct bfa_ioc_s *ioc)static bfa_status_t bfa_ioc_smem_read (struct bfa_ioc_s *ioc,void *tbuf,u32 soff,u32 sz) { -u32 pgnum, loff, r32; +u32 pgnum, loff; +__be32 r32;int i, len;u32 *buf = tbuf;
@@ -1909,7 +1910,7 @@ bfa_ioc_is_initialized(struct bfa_ioc_s *ioc)void bfa_ioc_msgget (struct bfa_ioc_s *ioc,void *mbmsg) { -u32 *msgp = mbmsg; +__be32 *msgp = mbmsg;u32 r32;int i;
drivers/scsi/bfa/bfa_ioc.h +4 -4
@@ -115,8 +115,8 @@ struct bfa_dma_s {static inline void __bfa_dma_addr_set (union bfi_addr_u *dma_addr,u64 pa) { - dma_addr->a32.addr_lo = (u32 ) pa; - dma_addr->a32.addr_hi = (u32) (bfa_os_u32 (pa)); + dma_addr->a32.addr_lo = (__be32 ) pa; + dma_addr->a32.addr_hi = (__be32) (bfa_os_u32 (pa)); }
@@ -125,8 +125,8 @@ __bfa_dma_addr_set(union bfi_addr_u *dma_addr, u64 pa)static inline void __bfa_dma_be_addr_set (union bfi_addr_u *dma_addr,u64 pa) { - dma_addr->a32.addr_lo = (u32 )cpu_to_be32 (pa); - dma_addr->a32.addr_hi = (u32 )cpu_to_be32 (bfa_os_u32 (pa)); + dma_addr->a32.addr_lo =cpu_to_be32 (pa); + dma_addr->a32.addr_hi =cpu_to_be32 (bfa_os_u32 (pa)); }struct bfa_ioc_regs_s {
drivers/scsi/bfa/bfa_port.c +1 -1
@@ -29,7 +29,7 @@ static void bfa_port_stats_swap(struct bfa_port_s *port, union bfa_port_stats_u *stats) { u32 *dip = (u32 *) stats; -u32 t0, t1; +__be32 t0, t1;int i; for (i = 0; i < sizeof(union bfa_port_stats_u)/sizeof(u32);
drivers/scsi/bfa/bfa_svc.c +2 -2
@@ -3127,7 +3127,7 @@ bfa_fcport_qos_stats_swap(struct bfa_qos_stats_s *d, struct bfa_qos_stats_s *s) {u32 *dip = (u32 *) d; -u32 *sip = (u32 *) s; +__be32 *sip = (__be32 *) s;int i;/* Now swap the 32 bit fields */
@@ -3140,7 +3140,7 @@ bfa_fcport_fcoe_stats_swap(struct bfa_fcoe_stats_s *d, struct bfa_fcoe_stats_s *s) {u32 *dip = (u32 *) d; -u32 *sip = (u32 *) s; +__be32 *sip = (__be32 *) s;int i; for (i = 0; i < ((sizeof(struct bfa_fcoe_stats_s))/sizeof(u32));
drivers/scsi/bfa/bfi.h +2 -2
@@ -95,8 +95,8 @@ enum {*/ union bfi_addr_u {struct { -u32 addr_lo; -u32 addr_hi; +__be32 addr_lo; +__be32 addr_hi; } a32; };
drivers/scsi/bfa/bfi_ms.h +25 -25
161 lines not on this page · raw message
Signature · 1 line
1.7.2.1