aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/csiostor/csio_attr.c
diff options
context:
space:
mode:
authorNaresh Kumar Inna <naresh@chelsio.com>2012-11-20 07:45:40 -0500
committerJames Bottomley <JBottomley@Parallels.com>2012-11-30 10:32:10 -0500
commit5036f0a0ecd31fc94360a944b352d082e1182b04 (patch)
tree98d5b957f1cd88b70b4965cf7dc16dc7862d0e42 /drivers/scsi/csiostor/csio_attr.c
parent68d91cbd5267e15a7c6da1415a1c65a9506aed96 (diff)
[SCSI] csiostor: Fix sparse warnings.
This patch fixes sparse warnings related to endian-ness, which were reported by the 0-day kernel build and testing tool. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Naresh Kumar Inna <naresh@chelsio.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/csiostor/csio_attr.c')
-rw-r--r--drivers/scsi/csiostor/csio_attr.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/scsi/csiostor/csio_attr.c b/drivers/scsi/csiostor/csio_attr.c
index c8cf85785db2..065a87ace623 100644
--- a/drivers/scsi/csiostor/csio_attr.c
+++ b/drivers/scsi/csiostor/csio_attr.c
@@ -89,7 +89,7 @@ csio_reg_rnode(struct csio_rnode *rn)
89 spin_unlock_irq(shost->host_lock); 89 spin_unlock_irq(shost->host_lock);
90 90
91 sp = &rn->rn_sparm; 91 sp = &rn->rn_sparm;
92 rport->maxframe_size = sp->csp.sp_bb_data; 92 rport->maxframe_size = ntohs(sp->csp.sp_bb_data);
93 if (ntohs(sp->clsp[2].cp_class) & FC_CPC_VALID) 93 if (ntohs(sp->clsp[2].cp_class) & FC_CPC_VALID)
94 rport->supported_classes = FC_COS_CLASS3; 94 rport->supported_classes = FC_COS_CLASS3;
95 else 95 else
@@ -192,7 +192,7 @@ csio_fchost_attr_init(struct csio_lnode *ln)
192 fc_host_supported_speeds(shost) = FC_PORTSPEED_10GBIT | 192 fc_host_supported_speeds(shost) = FC_PORTSPEED_10GBIT |
193 FC_PORTSPEED_1GBIT; 193 FC_PORTSPEED_1GBIT;
194 194
195 fc_host_maxframe_size(shost) = ln->ln_sparm.csp.sp_bb_data; 195 fc_host_maxframe_size(shost) = ntohs(ln->ln_sparm.csp.sp_bb_data);
196 memset(fc_host_supported_fc4s(shost), 0, 196 memset(fc_host_supported_fc4s(shost), 0,
197 sizeof(fc_host_supported_fc4s(shost))); 197 sizeof(fc_host_supported_fc4s(shost)));
198 fc_host_supported_fc4s(shost)[7] = 1; 198 fc_host_supported_fc4s(shost)[7] = 1;
@@ -325,23 +325,23 @@ csio_get_stats(struct Scsi_Host *shost)
325 memset(&fcoe_port_stats, 0, sizeof(struct fw_fcoe_port_stats)); 325 memset(&fcoe_port_stats, 0, sizeof(struct fw_fcoe_port_stats));
326 csio_get_phy_port_stats(hw, ln->portid, &fcoe_port_stats); 326 csio_get_phy_port_stats(hw, ln->portid, &fcoe_port_stats);
327 327
328 fhs->tx_frames += (fcoe_port_stats.tx_bcast_frames + 328 fhs->tx_frames += (be64_to_cpu(fcoe_port_stats.tx_bcast_frames) +
329 fcoe_port_stats.tx_mcast_frames + 329 be64_to_cpu(fcoe_port_stats.tx_mcast_frames) +
330 fcoe_port_stats.tx_ucast_frames + 330 be64_to_cpu(fcoe_port_stats.tx_ucast_frames) +
331 fcoe_port_stats.tx_offload_frames); 331 be64_to_cpu(fcoe_port_stats.tx_offload_frames));
332 fhs->tx_words += (fcoe_port_stats.tx_bcast_bytes + 332 fhs->tx_words += (be64_to_cpu(fcoe_port_stats.tx_bcast_bytes) +
333 fcoe_port_stats.tx_mcast_bytes + 333 be64_to_cpu(fcoe_port_stats.tx_mcast_bytes) +
334 fcoe_port_stats.tx_ucast_bytes + 334 be64_to_cpu(fcoe_port_stats.tx_ucast_bytes) +
335 fcoe_port_stats.tx_offload_bytes) / 335 be64_to_cpu(fcoe_port_stats.tx_offload_bytes)) /
336 CSIO_WORD_TO_BYTE; 336 CSIO_WORD_TO_BYTE;
337 fhs->rx_frames += (fcoe_port_stats.rx_bcast_frames + 337 fhs->rx_frames += (be64_to_cpu(fcoe_port_stats.rx_bcast_frames) +
338 fcoe_port_stats.rx_mcast_frames + 338 be64_to_cpu(fcoe_port_stats.rx_mcast_frames) +
339 fcoe_port_stats.rx_ucast_frames); 339 be64_to_cpu(fcoe_port_stats.rx_ucast_frames));
340 fhs->rx_words += (fcoe_port_stats.rx_bcast_bytes + 340 fhs->rx_words += (be64_to_cpu(fcoe_port_stats.rx_bcast_bytes) +
341 fcoe_port_stats.rx_mcast_bytes + 341 be64_to_cpu(fcoe_port_stats.rx_mcast_bytes) +
342 fcoe_port_stats.rx_ucast_bytes) / 342 be64_to_cpu(fcoe_port_stats.rx_ucast_bytes)) /
343 CSIO_WORD_TO_BYTE; 343 CSIO_WORD_TO_BYTE;
344 fhs->error_frames += fcoe_port_stats.rx_err_frames; 344 fhs->error_frames += be64_to_cpu(fcoe_port_stats.rx_err_frames);
345 fhs->fcp_input_requests += ln->stats.n_input_requests; 345 fhs->fcp_input_requests += ln->stats.n_input_requests;
346 fhs->fcp_output_requests += ln->stats.n_output_requests; 346 fhs->fcp_output_requests += ln->stats.n_output_requests;
347 fhs->fcp_control_requests += ln->stats.n_control_requests; 347 fhs->fcp_control_requests += ln->stats.n_control_requests;