Commit 8638b77f authored by Jubin John's avatar Jubin John Committed by Doug Ledford

staging/rdma/hfi1: Add spaces around binary operators

Add spaces around binary operators.

Fixes checkpatch check:
CHECK: spaces preferred around that 'x'
where x is a binary operator
Reviewed-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: default avatarIra Weiny <ira.weiny@intel.com>
Reviewed-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: default avatarJubin John <jubin.john@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 0358a440
This diff is collapsed.
...@@ -750,7 +750,7 @@ void hfi1_dbg_ibdev_init(struct hfi1_ibdev *ibd) ...@@ -750,7 +750,7 @@ void hfi1_dbg_ibdev_init(struct hfi1_ibdev *ibd)
ppd, ppd,
&port_cntr_ops[i].ops, &port_cntr_ops[i].ops,
port_cntr_ops[i].ops.write == NULL ? port_cntr_ops[i].ops.write == NULL ?
S_IRUGO : S_IRUGO|S_IWUSR); S_IRUGO : S_IRUGO | S_IWUSR);
} }
} }
......
...@@ -702,7 +702,7 @@ static inline int process_rcv_packet(struct hfi1_packet *packet, int thread) ...@@ -702,7 +702,7 @@ static inline int process_rcv_packet(struct hfi1_packet *packet, int thread)
*/ */
prefetch_range(packet->ebuf, prefetch_range(packet->ebuf,
packet->tlen - ((packet->rcd->rcvhdrqentsize - packet->tlen - ((packet->rcd->rcvhdrqentsize -
(rhf_hdrq_offset(packet->rhf)+2)) * 4)); (rhf_hdrq_offset(packet->rhf) + 2)) * 4));
} }
/* /*
......
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
/* sleep length while waiting for controller */ /* sleep length while waiting for controller */
#define WAIT_SLEEP_US 100 /* must be larger than 5 (see usage) */ #define WAIT_SLEEP_US 100 /* must be larger than 5 (see usage) */
#define COUNT_DELAY_SEC(n) ((n) * (1000000/WAIT_SLEEP_US)) #define COUNT_DELAY_SEC(n) ((n) * (1000000 / WAIT_SLEEP_US))
/* GPIO pins */ /* GPIO pins */
#define EPROM_WP_N (1ull << 14) /* EPROM write line */ #define EPROM_WP_N (1ull << 14) /* EPROM write line */
...@@ -254,7 +254,7 @@ static void read_page(struct hfi1_devdata *dd, u32 offset, u32 *result) ...@@ -254,7 +254,7 @@ static void read_page(struct hfi1_devdata *dd, u32 offset, u32 *result)
int i; int i;
write_csr(dd, ASIC_EEP_ADDR_CMD, CMD_READ_DATA(offset)); write_csr(dd, ASIC_EEP_ADDR_CMD, CMD_READ_DATA(offset));
for (i = 0; i < EP_PAGE_SIZE/sizeof(u32); i++) for (i = 0; i < EP_PAGE_SIZE / sizeof(u32); i++)
result[i] = (u32)read_csr(dd, ASIC_EEP_DATA); result[i] = (u32)read_csr(dd, ASIC_EEP_DATA);
write_csr(dd, ASIC_EEP_ADDR_CMD, CMD_NOP); /* close open page */ write_csr(dd, ASIC_EEP_ADDR_CMD, CMD_NOP); /* close open page */
} }
...@@ -265,7 +265,7 @@ static void read_page(struct hfi1_devdata *dd, u32 offset, u32 *result) ...@@ -265,7 +265,7 @@ static void read_page(struct hfi1_devdata *dd, u32 offset, u32 *result)
static int read_length(struct hfi1_devdata *dd, u32 start, u32 len, u64 addr) static int read_length(struct hfi1_devdata *dd, u32 start, u32 len, u64 addr)
{ {
u32 offset; u32 offset;
u32 buffer[EP_PAGE_SIZE/sizeof(u32)]; u32 buffer[EP_PAGE_SIZE / sizeof(u32)];
int ret = 0; int ret = 0;
/* reject anything not on an EPROM page boundary */ /* reject anything not on an EPROM page boundary */
...@@ -296,7 +296,7 @@ static int write_page(struct hfi1_devdata *dd, u32 offset, u32 *data) ...@@ -296,7 +296,7 @@ static int write_page(struct hfi1_devdata *dd, u32 offset, u32 *data)
write_csr(dd, ASIC_EEP_ADDR_CMD, CMD_WRITE_ENABLE); write_csr(dd, ASIC_EEP_ADDR_CMD, CMD_WRITE_ENABLE);
write_csr(dd, ASIC_EEP_DATA, data[0]); write_csr(dd, ASIC_EEP_DATA, data[0]);
write_csr(dd, ASIC_EEP_ADDR_CMD, CMD_PAGE_PROGRAM(offset)); write_csr(dd, ASIC_EEP_ADDR_CMD, CMD_PAGE_PROGRAM(offset));
for (i = 1; i < EP_PAGE_SIZE/sizeof(u32); i++) for (i = 1; i < EP_PAGE_SIZE / sizeof(u32); i++)
write_csr(dd, ASIC_EEP_DATA, data[i]); write_csr(dd, ASIC_EEP_DATA, data[i]);
/* will close the open page */ /* will close the open page */
return wait_for_not_busy(dd); return wait_for_not_busy(dd);
...@@ -308,7 +308,7 @@ static int write_page(struct hfi1_devdata *dd, u32 offset, u32 *data) ...@@ -308,7 +308,7 @@ static int write_page(struct hfi1_devdata *dd, u32 offset, u32 *data)
static int write_length(struct hfi1_devdata *dd, u32 start, u32 len, u64 addr) static int write_length(struct hfi1_devdata *dd, u32 start, u32 len, u64 addr)
{ {
u32 offset; u32 offset;
u32 buffer[EP_PAGE_SIZE/sizeof(u32)]; u32 buffer[EP_PAGE_SIZE / sizeof(u32)];
int ret = 0; int ret = 0;
/* reject anything not on an EPROM page boundary */ /* reject anything not on an EPROM page boundary */
......
...@@ -393,17 +393,17 @@ static int verify_css_header(struct hfi1_devdata *dd, struct css_header *css) ...@@ -393,17 +393,17 @@ static int verify_css_header(struct hfi1_devdata *dd, struct css_header *css)
/* verify CSS header fields (most sizes are in DW, so add /4) */ /* verify CSS header fields (most sizes are in DW, so add /4) */
if (invalid_header(dd, "module_type", css->module_type, CSS_MODULE_TYPE) if (invalid_header(dd, "module_type", css->module_type, CSS_MODULE_TYPE)
|| invalid_header(dd, "header_len", css->header_len, || invalid_header(dd, "header_len", css->header_len,
(sizeof(struct firmware_file)/4)) (sizeof(struct firmware_file) / 4))
|| invalid_header(dd, "header_version", || invalid_header(dd, "header_version",
css->header_version, CSS_HEADER_VERSION) css->header_version, CSS_HEADER_VERSION)
|| invalid_header(dd, "module_vendor", || invalid_header(dd, "module_vendor",
css->module_vendor, CSS_MODULE_VENDOR) css->module_vendor, CSS_MODULE_VENDOR)
|| invalid_header(dd, "key_size", || invalid_header(dd, "key_size",
css->key_size, KEY_SIZE/4) css->key_size, KEY_SIZE / 4)
|| invalid_header(dd, "modulus_size", || invalid_header(dd, "modulus_size",
css->modulus_size, KEY_SIZE/4) css->modulus_size, KEY_SIZE / 4)
|| invalid_header(dd, "exponent_size", || invalid_header(dd, "exponent_size",
css->exponent_size, EXPONENT_SIZE/4)) { css->exponent_size, EXPONENT_SIZE / 4)) {
return -EINVAL; return -EINVAL;
} }
return 0; return 0;
...@@ -488,7 +488,7 @@ static int obtain_one_firmware(struct hfi1_devdata *dd, const char *name, ...@@ -488,7 +488,7 @@ static int obtain_one_firmware(struct hfi1_devdata *dd, const char *name,
ret = verify_css_header(dd, css); ret = verify_css_header(dd, css);
if (ret) { if (ret) {
dd_dev_info(dd, "Invalid CSS header for \"%s\"\n", name); dd_dev_info(dd, "Invalid CSS header for \"%s\"\n", name);
} else if ((css->size*4) == fdet->fw->size) { } else if ((css->size * 4) == fdet->fw->size) {
/* non-augmented firmware file */ /* non-augmented firmware file */
struct firmware_file *ff = (struct firmware_file *) struct firmware_file *ff = (struct firmware_file *)
fdet->fw->data; fdet->fw->data;
...@@ -513,7 +513,7 @@ static int obtain_one_firmware(struct hfi1_devdata *dd, const char *name, ...@@ -513,7 +513,7 @@ static int obtain_one_firmware(struct hfi1_devdata *dd, const char *name,
dd_dev_err(dd, "driver is unable to validate firmware without r2 and mu (not in firmware file)\n"); dd_dev_err(dd, "driver is unable to validate firmware without r2 and mu (not in firmware file)\n");
ret = -EINVAL; ret = -EINVAL;
} }
} else if ((css->size*4) + AUGMENT_SIZE == fdet->fw->size) { } else if ((css->size * 4) + AUGMENT_SIZE == fdet->fw->size) {
/* augmented firmware file */ /* augmented firmware file */
struct augmented_firmware_file *aff = struct augmented_firmware_file *aff =
(struct augmented_firmware_file *)fdet->fw->data; (struct augmented_firmware_file *)fdet->fw->data;
...@@ -536,7 +536,7 @@ static int obtain_one_firmware(struct hfi1_devdata *dd, const char *name, ...@@ -536,7 +536,7 @@ static int obtain_one_firmware(struct hfi1_devdata *dd, const char *name,
/* css->size check failed */ /* css->size check failed */
dd_dev_err(dd, dd_dev_err(dd,
"invalid firmware header field size: expected 0x%lx or 0x%lx, actual 0x%x\n", "invalid firmware header field size: expected 0x%lx or 0x%lx, actual 0x%x\n",
fdet->fw->size/4, (fdet->fw->size - AUGMENT_SIZE)/4, fdet->fw->size / 4, (fdet->fw->size - AUGMENT_SIZE) / 4,
css->size); css->size);
ret = -EINVAL; ret = -EINVAL;
...@@ -780,7 +780,7 @@ static int retry_firmware(struct hfi1_devdata *dd, int load_result) ...@@ -780,7 +780,7 @@ static int retry_firmware(struct hfi1_devdata *dd, int load_result)
static void write_rsa_data(struct hfi1_devdata *dd, int what, static void write_rsa_data(struct hfi1_devdata *dd, int what,
const u8 *data, int nbytes) const u8 *data, int nbytes)
{ {
int qw_size = nbytes/8; int qw_size = nbytes / 8;
int i; int i;
if (((unsigned long)data & 0x7) == 0) { if (((unsigned long)data & 0x7) == 0) {
...@@ -788,14 +788,14 @@ static void write_rsa_data(struct hfi1_devdata *dd, int what, ...@@ -788,14 +788,14 @@ static void write_rsa_data(struct hfi1_devdata *dd, int what,
u64 *ptr = (u64 *)data; u64 *ptr = (u64 *)data;
for (i = 0; i < qw_size; i++, ptr++) for (i = 0; i < qw_size; i++, ptr++)
write_csr(dd, what + (8*i), *ptr); write_csr(dd, what + (8 * i), *ptr);
} else { } else {
/* not aligned */ /* not aligned */
for (i = 0; i < qw_size; i++, data += 8) { for (i = 0; i < qw_size; i++, data += 8) {
u64 value; u64 value;
memcpy(&value, data, 8); memcpy(&value, data, 8);
write_csr(dd, what + (8*i), value); write_csr(dd, what + (8 * i), value);
} }
} }
} }
...@@ -808,7 +808,7 @@ static void write_streamed_rsa_data(struct hfi1_devdata *dd, int what, ...@@ -808,7 +808,7 @@ static void write_streamed_rsa_data(struct hfi1_devdata *dd, int what,
const u8 *data, int nbytes) const u8 *data, int nbytes)
{ {
u64 *ptr = (u64 *)data; u64 *ptr = (u64 *)data;
int qw_size = nbytes/8; int qw_size = nbytes / 8;
for (; qw_size > 0; qw_size--, ptr++) for (; qw_size > 0; qw_size--, ptr++)
write_csr(dd, what, *ptr); write_csr(dd, what, *ptr);
...@@ -1743,8 +1743,8 @@ int get_platform_config_field(struct hfi1_devdata *dd, ...@@ -1743,8 +1743,8 @@ int get_platform_config_field(struct hfi1_devdata *dd,
if (len < field_len_bits) if (len < field_len_bits)
return -EINVAL; return -EINVAL;
seek = field_start_bits/8; seek = field_start_bits / 8;
wlen = field_len_bits/8; wlen = field_len_bits / 8;
src_ptr = (u32 *)((u8 *)src_ptr + seek); src_ptr = (u32 *)((u8 *)src_ptr + seek);
...@@ -1783,7 +1783,7 @@ int get_platform_config_field(struct hfi1_devdata *dd, ...@@ -1783,7 +1783,7 @@ int get_platform_config_field(struct hfi1_devdata *dd,
if (!src_ptr || len < field_len_bits) if (!src_ptr || len < field_len_bits)
return -EINVAL; return -EINVAL;
src_ptr += (field_start_bits/32); src_ptr += (field_start_bits / 32);
*data = (*src_ptr >> (field_start_bits % 32)) & *data = (*src_ptr >> (field_start_bits % 32)) &
((1 << field_len_bits) - 1); ((1 << field_len_bits) - 1);
......
...@@ -718,7 +718,7 @@ struct hfi1_pportdata { ...@@ -718,7 +718,7 @@ struct hfi1_pportdata {
/* begin congestion log related entries /* begin congestion log related entries
* cc_log_lock protects all congestion log related data */ * cc_log_lock protects all congestion log related data */
spinlock_t cc_log_lock ____cacheline_aligned_in_smp; spinlock_t cc_log_lock ____cacheline_aligned_in_smp;
u8 threshold_cong_event_map[OPA_MAX_SLS/8]; u8 threshold_cong_event_map[OPA_MAX_SLS / 8];
u16 threshold_event_counter; u16 threshold_event_counter;
struct opa_hfi1_cong_log_event_internal cc_events[OPA_CONG_LOG_ELEMS]; struct opa_hfi1_cong_log_event_internal cc_events[OPA_CONG_LOG_ELEMS];
int cc_log_idx; /* index for logging events */ int cc_log_idx; /* index for logging events */
......
...@@ -166,7 +166,7 @@ void handle_linkup_change(struct hfi1_devdata *dd, u32 linkup) ...@@ -166,7 +166,7 @@ void handle_linkup_change(struct hfi1_devdata *dd, u32 linkup)
reset_link_credits(dd); reset_link_credits(dd);
/* freeze after a link down to guarantee a clean egress */ /* freeze after a link down to guarantee a clean egress */
start_freeze_handling(ppd, FREEZE_SELF|FREEZE_LINK_DOWN); start_freeze_handling(ppd, FREEZE_SELF | FREEZE_LINK_DOWN);
ev = IB_EVENT_PORT_ERR; ev = IB_EVENT_PORT_ERR;
......
...@@ -534,7 +534,7 @@ static int __subn_get_opa_portinfo(struct opa_smp *smp, u32 am, u8 *data, ...@@ -534,7 +534,7 @@ static int __subn_get_opa_portinfo(struct opa_smp *smp, u32 am, u8 *data,
ppd = dd->pport + (port - 1); ppd = dd->pport + (port - 1);
ibp = &ppd->ibport_data; ibp = &ppd->ibport_data;
if (ppd->vls_supported/2 > ARRAY_SIZE(pi->neigh_mtu.pvlx_to_mtu) || if (ppd->vls_supported / 2 > ARRAY_SIZE(pi->neigh_mtu.pvlx_to_mtu) ||
ppd->vls_supported > ARRAY_SIZE(dd->vld)) { ppd->vls_supported > ARRAY_SIZE(dd->vld)) {
smp->status |= IB_SMP_INVALID_FIELD; smp->status |= IB_SMP_INVALID_FIELD;
return reply((struct ib_mad_hdr *)smp); return reply((struct ib_mad_hdr *)smp);
...@@ -600,13 +600,13 @@ static int __subn_get_opa_portinfo(struct opa_smp *smp, u32 am, u8 *data, ...@@ -600,13 +600,13 @@ static int __subn_get_opa_portinfo(struct opa_smp *smp, u32 am, u8 *data,
for (i = 0; i < ppd->vls_supported; i++) { for (i = 0; i < ppd->vls_supported; i++) {
mtu = mtu_to_enum(dd->vld[i].mtu, HFI1_DEFAULT_ACTIVE_MTU); mtu = mtu_to_enum(dd->vld[i].mtu, HFI1_DEFAULT_ACTIVE_MTU);
if ((i % 2) == 0) if ((i % 2) == 0)
pi->neigh_mtu.pvlx_to_mtu[i/2] |= (mtu << 4); pi->neigh_mtu.pvlx_to_mtu[i / 2] |= (mtu << 4);
else else
pi->neigh_mtu.pvlx_to_mtu[i/2] |= mtu; pi->neigh_mtu.pvlx_to_mtu[i / 2] |= mtu;
} }
/* don't forget VL 15 */ /* don't forget VL 15 */
mtu = mtu_to_enum(dd->vld[15].mtu, 2048); mtu = mtu_to_enum(dd->vld[15].mtu, 2048);
pi->neigh_mtu.pvlx_to_mtu[15/2] |= mtu; pi->neigh_mtu.pvlx_to_mtu[15 / 2] |= mtu;
pi->smsl = ibp->rvp.sm_sl & OPA_PI_MASK_SMSL; pi->smsl = ibp->rvp.sm_sl & OPA_PI_MASK_SMSL;
pi->operational_vls = hfi1_get_ib_cfg(ppd, HFI1_IB_CFG_OP_VLS); pi->operational_vls = hfi1_get_ib_cfg(ppd, HFI1_IB_CFG_OP_VLS);
pi->partenforce_filterraw |= pi->partenforce_filterraw |=
...@@ -744,7 +744,7 @@ static int __subn_get_opa_pkeytable(struct opa_smp *smp, u32 am, u8 *data, ...@@ -744,7 +744,7 @@ static int __subn_get_opa_pkeytable(struct opa_smp *smp, u32 am, u8 *data,
return reply((struct ib_mad_hdr *)smp); return reply((struct ib_mad_hdr *)smp);
} }
n_blocks_avail = (u16) (npkeys/OPA_PARTITION_TABLE_BLK_SIZE) + 1; n_blocks_avail = (u16) (npkeys / OPA_PARTITION_TABLE_BLK_SIZE) + 1;
size = (n_blocks_req * OPA_PARTITION_TABLE_BLK_SIZE) * sizeof(u16); size = (n_blocks_req * OPA_PARTITION_TABLE_BLK_SIZE) * sizeof(u16);
...@@ -1207,17 +1207,17 @@ static int __subn_set_opa_portinfo(struct opa_smp *smp, u32 am, u8 *data, ...@@ -1207,17 +1207,17 @@ static int __subn_set_opa_portinfo(struct opa_smp *smp, u32 am, u8 *data,
(void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_VL_HIGH_LIMIT, (void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_VL_HIGH_LIMIT,
ibp->rvp.vl_high_limit); ibp->rvp.vl_high_limit);
if (ppd->vls_supported/2 > ARRAY_SIZE(pi->neigh_mtu.pvlx_to_mtu) || if (ppd->vls_supported / 2 > ARRAY_SIZE(pi->neigh_mtu.pvlx_to_mtu) ||
ppd->vls_supported > ARRAY_SIZE(dd->vld)) { ppd->vls_supported > ARRAY_SIZE(dd->vld)) {
smp->status |= IB_SMP_INVALID_FIELD; smp->status |= IB_SMP_INVALID_FIELD;
return reply((struct ib_mad_hdr *)smp); return reply((struct ib_mad_hdr *)smp);
} }
for (i = 0; i < ppd->vls_supported; i++) { for (i = 0; i < ppd->vls_supported; i++) {
if ((i % 2) == 0) if ((i % 2) == 0)
mtu = enum_to_mtu((pi->neigh_mtu.pvlx_to_mtu[i/2] >> 4) mtu = enum_to_mtu((pi->neigh_mtu.pvlx_to_mtu[i / 2] >> 4)
& 0xF); & 0xF);
else else
mtu = enum_to_mtu(pi->neigh_mtu.pvlx_to_mtu[i/2] & 0xF); mtu = enum_to_mtu(pi->neigh_mtu.pvlx_to_mtu[i / 2] & 0xF);
if (mtu == 0xffff) { if (mtu == 0xffff) {
pr_warn("SubnSet(OPA_PortInfo) mtu invalid %d (0x%x)\n", pr_warn("SubnSet(OPA_PortInfo) mtu invalid %d (0x%x)\n",
mtu, mtu,
...@@ -1236,7 +1236,7 @@ static int __subn_set_opa_portinfo(struct opa_smp *smp, u32 am, u8 *data, ...@@ -1236,7 +1236,7 @@ static int __subn_set_opa_portinfo(struct opa_smp *smp, u32 am, u8 *data,
/* As per OPAV1 spec: VL15 must support and be configured /* As per OPAV1 spec: VL15 must support and be configured
* for operation with a 2048 or larger MTU. * for operation with a 2048 or larger MTU.
*/ */
mtu = enum_to_mtu(pi->neigh_mtu.pvlx_to_mtu[15/2] & 0xF); mtu = enum_to_mtu(pi->neigh_mtu.pvlx_to_mtu[15 / 2] & 0xF);
if (mtu < 2048 || mtu == 0xffff) if (mtu < 2048 || mtu == 0xffff)
mtu = 2048; mtu = 2048;
if (dd->vld[15].mtu != mtu) { if (dd->vld[15].mtu != mtu) {
...@@ -1419,7 +1419,7 @@ static int __subn_set_opa_pkeytable(struct opa_smp *smp, u32 am, u8 *data, ...@@ -1419,7 +1419,7 @@ static int __subn_set_opa_pkeytable(struct opa_smp *smp, u32 am, u8 *data,
return reply((struct ib_mad_hdr *)smp); return reply((struct ib_mad_hdr *)smp);
} }
n_blocks_avail = (u16)(npkeys/OPA_PARTITION_TABLE_BLK_SIZE) + 1; n_blocks_avail = (u16)(npkeys / OPA_PARTITION_TABLE_BLK_SIZE) + 1;
if (start_block + n_blocks_sent > n_blocks_avail || if (start_block + n_blocks_sent > n_blocks_avail ||
n_blocks_sent > OPA_NUM_PKEY_BLOCKS_PER_SMP) { n_blocks_sent > OPA_NUM_PKEY_BLOCKS_PER_SMP) {
...@@ -3460,7 +3460,7 @@ static int __subn_get_opa_cc_table(struct opa_smp *smp, u32 am, u8 *data, ...@@ -3460,7 +3460,7 @@ static int __subn_get_opa_cc_table(struct opa_smp *smp, u32 am, u8 *data,
rcu_read_unlock(); rcu_read_unlock();
if (resp_len) if (resp_len)
*resp_len += sizeof(u16)*(IB_CCT_ENTRIES * n_blocks + 1); *resp_len += sizeof(u16) * (IB_CCT_ENTRIES * n_blocks + 1);
return reply((struct ib_mad_hdr *)smp); return reply((struct ib_mad_hdr *)smp);
} }
......
...@@ -267,7 +267,7 @@ struct opa_hfi1_cong_log { ...@@ -267,7 +267,7 @@ struct opa_hfi1_cong_log {
u8 congestion_flags; u8 congestion_flags;
__be16 threshold_event_counter; __be16 threshold_event_counter;
__be32 current_time_stamp; __be32 current_time_stamp;
u8 threshold_cong_event_map[OPA_MAX_SLS/8]; u8 threshold_cong_event_map[OPA_MAX_SLS / 8];
struct opa_hfi1_cong_log_event events[OPA_CONG_LOG_ELEMS]; struct opa_hfi1_cong_log_event events[OPA_CONG_LOG_ELEMS];
} __packed; } __packed;
......
...@@ -840,7 +840,7 @@ static void write_gasket_interrupt(struct hfi1_devdata *dd, int index, ...@@ -840,7 +840,7 @@ static void write_gasket_interrupt(struct hfi1_devdata *dd, int index,
{ {
write_csr(dd, ASIC_PCIE_SD_INTRPT_LIST + (index * 8), write_csr(dd, ASIC_PCIE_SD_INTRPT_LIST + (index * 8),
(((u64)code << ASIC_PCIE_SD_INTRPT_LIST_INTRPT_CODE_SHIFT) (((u64)code << ASIC_PCIE_SD_INTRPT_LIST_INTRPT_CODE_SHIFT)
|((u64)data << ASIC_PCIE_SD_INTRPT_LIST_INTRPT_DATA_SHIFT))); | ((u64)data << ASIC_PCIE_SD_INTRPT_LIST_INTRPT_DATA_SHIFT)));
} }
/* /*
......
...@@ -101,7 +101,7 @@ void pio_send_control(struct hfi1_devdata *dd, int op) ...@@ -101,7 +101,7 @@ void pio_send_control(struct hfi1_devdata *dd, int op)
/* Fall through */ /* Fall through */
case PSC_DATA_VL_ENABLE: case PSC_DATA_VL_ENABLE:
/* Disallow sending on VLs not enabled */ /* Disallow sending on VLs not enabled */
mask = (((~0ull)<<num_vls) & SEND_CTRL_UNSUPPORTED_VL_MASK)<< mask = (((~0ull) << num_vls) & SEND_CTRL_UNSUPPORTED_VL_MASK) <<
SEND_CTRL_UNSUPPORTED_VL_SHIFT; SEND_CTRL_UNSUPPORTED_VL_SHIFT;
reg = (reg & ~SEND_CTRL_UNSUPPORTED_VL_SMASK) | mask; reg = (reg & ~SEND_CTRL_UNSUPPORTED_VL_SMASK) | mask;
break; break;
...@@ -1346,7 +1346,7 @@ void sc_stop(struct send_context *sc, int flag) ...@@ -1346,7 +1346,7 @@ void sc_stop(struct send_context *sc, int flag)
wake_up(&sc->halt_wait); wake_up(&sc->halt_wait);
} }
#define BLOCK_DWORDS (PIO_BLOCK_SIZE/sizeof(u32)) #define BLOCK_DWORDS (PIO_BLOCK_SIZE / sizeof(u32))
#define dwords_to_blocks(x) DIV_ROUND_UP(x, BLOCK_DWORDS) #define dwords_to_blocks(x) DIV_ROUND_UP(x, BLOCK_DWORDS)
/* /*
......
...@@ -52,9 +52,9 @@ ...@@ -52,9 +52,9 @@
/* additive distance between non-SOP and SOP space */ /* additive distance between non-SOP and SOP space */
#define SOP_DISTANCE (TXE_PIO_SIZE / 2) #define SOP_DISTANCE (TXE_PIO_SIZE / 2)
#define PIO_BLOCK_MASK (PIO_BLOCK_SIZE-1) #define PIO_BLOCK_MASK (PIO_BLOCK_SIZE - 1)
/* number of QUADWORDs in a block */ /* number of QUADWORDs in a block */
#define PIO_BLOCK_QWS (PIO_BLOCK_SIZE/sizeof(u64)) #define PIO_BLOCK_QWS (PIO_BLOCK_SIZE / sizeof(u64))
/** /**
* pio_copy - copy data block to MMIO space * pio_copy - copy data block to MMIO space
...@@ -83,7 +83,7 @@ void pio_copy(struct hfi1_devdata *dd, struct pio_buf *pbuf, u64 pbc, ...@@ -83,7 +83,7 @@ void pio_copy(struct hfi1_devdata *dd, struct pio_buf *pbuf, u64 pbc,
dest += sizeof(u64); dest += sizeof(u64);
/* calculate where the QWORD data ends - in SOP=1 space */ /* calculate where the QWORD data ends - in SOP=1 space */
dend = dest + ((count>>1) * sizeof(u64)); dend = dest + ((count >> 1) * sizeof(u64));
if (dend < send) { if (dend < send) {
/* all QWORD data is within the SOP block, does *not* /* all QWORD data is within the SOP block, does *not*
...@@ -177,7 +177,7 @@ void pio_copy(struct hfi1_devdata *dd, struct pio_buf *pbuf, u64 pbc, ...@@ -177,7 +177,7 @@ void pio_copy(struct hfi1_devdata *dd, struct pio_buf *pbuf, u64 pbc,
* "zero" shift - bit shift used to zero out upper bytes. Input is * "zero" shift - bit shift used to zero out upper bytes. Input is
* the count of LSB bytes to preserve. * the count of LSB bytes to preserve.
*/ */
#define zshift(x) (8 * (8-(x))) #define zshift(x) (8 * (8 - (x)))
/* /*
* "merge" shift - bit shift used to merge with carry bytes. Input is * "merge" shift - bit shift used to merge with carry bytes. Input is
...@@ -244,7 +244,7 @@ static inline void read_extra_bytes(struct pio_buf *pbuf, ...@@ -244,7 +244,7 @@ static inline void read_extra_bytes(struct pio_buf *pbuf,
pbuf->carry.val64 |= (((*(u64 *)from) pbuf->carry.val64 |= (((*(u64 *)from)
>> mshift(off)) >> mshift(off))
<< zshift(xbytes)) << zshift(xbytes))
>> zshift(xbytes+pbuf->carry_bytes); >> zshift(xbytes + pbuf->carry_bytes);
off = 0; off = 0;
pbuf->carry_bytes += xbytes; pbuf->carry_bytes += xbytes;
nbytes -= xbytes; nbytes -= xbytes;
...@@ -411,7 +411,7 @@ static inline void merge_write8( ...@@ -411,7 +411,7 @@ static inline void merge_write8(
jcopy(&pbuf->carry.val8[pbuf->carry_bytes], src, remainder); jcopy(&pbuf->carry.val8[pbuf->carry_bytes], src, remainder);
writeq(pbuf->carry.val64, dest); writeq(pbuf->carry.val64, dest);
jcopy(&pbuf->carry.val8[0], src+remainder, pbuf->carry_bytes); jcopy(&pbuf->carry.val8[0], src + remainder, pbuf->carry_bytes);
} }
/* /*
...@@ -463,7 +463,7 @@ void seg_pio_copy_start(struct pio_buf *pbuf, u64 pbc, ...@@ -463,7 +463,7 @@ void seg_pio_copy_start(struct pio_buf *pbuf, u64 pbc,
dest += sizeof(u64); dest += sizeof(u64);
/* calculate where the QWORD data ends - in SOP=1 space */ /* calculate where the QWORD data ends - in SOP=1 space */
dend = dest + ((nbytes>>3) * sizeof(u64)); dend = dest + ((nbytes >> 3) * sizeof(u64));
if (dend < send) { if (dend < send) {
/* all QWORD data is within the SOP block, does *not* /* all QWORD data is within the SOP block, does *not*
...@@ -645,7 +645,7 @@ static void mid_copy_straight(struct pio_buf *pbuf, ...@@ -645,7 +645,7 @@ static void mid_copy_straight(struct pio_buf *pbuf,
void __iomem *dend; /* 8-byte data end */ void __iomem *dend; /* 8-byte data end */
/* calculate 8-byte data end */ /* calculate 8-byte data end */
dend = dest + ((nbytes>>3) * sizeof(u64)); dend = dest + ((nbytes >> 3) * sizeof(u64));
if (pbuf->qw_written < PIO_BLOCK_QWS) { if (pbuf->qw_written < PIO_BLOCK_QWS) {
/* /*
...@@ -713,7 +713,7 @@ static void mid_copy_straight(struct pio_buf *pbuf, ...@@ -713,7 +713,7 @@ static void mid_copy_straight(struct pio_buf *pbuf,
/* we know carry_bytes was zero on entry to this routine */ /* we know carry_bytes was zero on entry to this routine */
read_low_bytes(pbuf, from, nbytes & 0x7); read_low_bytes(pbuf, from, nbytes & 0x7);
pbuf->qw_written += nbytes>>3; pbuf->qw_written += nbytes >> 3;
} }
/* /*
......
...@@ -339,7 +339,7 @@ int refresh_qsfp_cache(struct hfi1_pportdata *ppd, struct qsfp_data *cp) ...@@ -339,7 +339,7 @@ int refresh_qsfp_cache(struct hfi1_pportdata *ppd, struct qsfp_data *cp)
u8 *cache = &cp->cache[0]; u8 *cache = &cp->cache[0];
/* ensure sane contents on invalid reads, for cable swaps */ /* ensure sane contents on invalid reads, for cable swaps */
memset(cache, 0, (QSFP_MAX_NUM_PAGES*128)); memset(cache, 0, (QSFP_MAX_NUM_PAGES * 128));
spin_lock_irqsave(&ppd->qsfp_info.qsfp_lock, flags); spin_lock_irqsave(&ppd->qsfp_info.qsfp_lock, flags);
ppd->qsfp_info.cache_valid = 0; ppd->qsfp_info.cache_valid = 0;
spin_unlock_irqrestore(&ppd->qsfp_info.qsfp_lock, flags); spin_unlock_irqrestore(&ppd->qsfp_info.qsfp_lock, flags);
...@@ -420,7 +420,7 @@ int refresh_qsfp_cache(struct hfi1_pportdata *ppd, struct qsfp_data *cp) ...@@ -420,7 +420,7 @@ int refresh_qsfp_cache(struct hfi1_pportdata *ppd, struct qsfp_data *cp)
return 0; return 0;
bail: bail:
memset(cache, 0, (QSFP_MAX_NUM_PAGES*128)); memset(cache, 0, (QSFP_MAX_NUM_PAGES * 128));
return ret; return ret;
} }
...@@ -564,7 +564,7 @@ int qsfp_dump(struct hfi1_pportdata *ppd, char *buf, int len) ...@@ -564,7 +564,7 @@ int qsfp_dump(struct hfi1_pportdata *ppd, char *buf, int len)
memcpy(bin_buff, &cache[bidx], QSFP_DUMP_CHUNK); memcpy(bin_buff, &cache[bidx], QSFP_DUMP_CHUNK);
for (iidx = 0; iidx < QSFP_DUMP_CHUNK; ++iidx) { for (iidx = 0; iidx < QSFP_DUMP_CHUNK; ++iidx) {
sofar += scnprintf(buf + sofar, len-sofar, sofar += scnprintf(buf + sofar, len - sofar,
" %02X", bin_buff[iidx]); " %02X", bin_buff[iidx]);
} }
sofar += scnprintf(buf + sofar, len - sofar, "\n"); sofar += scnprintf(buf + sofar, len - sofar, "\n");
......
...@@ -214,7 +214,7 @@ struct qsfp_data { ...@@ -214,7 +214,7 @@ struct qsfp_data {
/* Helps to find our way */ /* Helps to find our way */
struct hfi1_pportdata *ppd; struct hfi1_pportdata *ppd;
struct work_struct qsfp_work; struct work_struct qsfp_work;
u8 cache[QSFP_MAX_NUM_PAGES*128]; u8 cache[QSFP_MAX_NUM_PAGES * 128];
spinlock_t qsfp_lock; spinlock_t qsfp_lock;
u8 check_interrupt_flags; u8 check_interrupt_flags;
u8 reset_needed; u8 reset_needed;
......
...@@ -1992,7 +1992,7 @@ static void log_cca_event(struct hfi1_pportdata *ppd, u8 sl, u32 rlid, ...@@ -1992,7 +1992,7 @@ static void log_cca_event(struct hfi1_pportdata *ppd, u8 sl, u32 rlid,
spin_lock_irqsave(&ppd->cc_log_lock, flags); spin_lock_irqsave(&ppd->cc_log_lock, flags);
ppd->threshold_cong_event_map[sl/8] |= 1 << (sl % 8); ppd->threshold_cong_event_map[sl / 8] |= 1 << (sl % 8);
ppd->threshold_event_counter++; ppd->threshold_event_counter++;
cc_event = &ppd->cc_events[ppd->cc_log_idx++]; cc_event = &ppd->cc_events[ppd->cc_log_idx++];
......
...@@ -1020,7 +1020,7 @@ int sdma_init(struct hfi1_devdata *dd, u8 port) ...@@ -1020,7 +1020,7 @@ int sdma_init(struct hfi1_devdata *dd, u8 port)
dd->chip_sdma_mem_size); dd->chip_sdma_mem_size);
per_sdma_credits = per_sdma_credits =
dd->chip_sdma_mem_size/(num_engines * SDMA_BLOCK_SIZE); dd->chip_sdma_mem_size / (num_engines * SDMA_BLOCK_SIZE);
/* set up freeze waitqueue */ /* set up freeze waitqueue */
init_waitqueue_head(&dd->sdma_unfreeze_wq); init_waitqueue_head(&dd->sdma_unfreeze_wq);
...@@ -1625,10 +1625,10 @@ static void sdma_setlengen(struct sdma_engine *sde) ...@@ -1625,10 +1625,10 @@ static void sdma_setlengen(struct sdma_engine *sde)
* generation counter. * generation counter.
*/ */
write_sde_csr(sde, SD(LEN_GEN), write_sde_csr(sde, SD(LEN_GEN),
(sde->descq_cnt/64) << SD(LEN_GEN_LENGTH_SHIFT) (sde->descq_cnt / 64) << SD(LEN_GEN_LENGTH_SHIFT)
); );
write_sde_csr(sde, SD(LEN_GEN), write_sde_csr(sde, SD(LEN_GEN),
((sde->descq_cnt/64) << SD(LEN_GEN_LENGTH_SHIFT)) ((sde->descq_cnt / 64) << SD(LEN_GEN_LENGTH_SHIFT))
| (4ULL << SD(LEN_GEN_GENERATION_SHIFT)) | (4ULL << SD(LEN_GEN_GENERATION_SHIFT))
); );
} }
...@@ -3057,5 +3057,5 @@ void _sdma_engine_progress_schedule( ...@@ -3057,5 +3057,5 @@ void _sdma_engine_progress_schedule(
trace_hfi1_sdma_engine_progress(sde, sde->progress_mask); trace_hfi1_sdma_engine_progress(sde, sde->progress_mask);
/* assume we have selected a good cpu */ /* assume we have selected a good cpu */
write_csr(sde->dd, write_csr(sde->dd,
CCE_INT_FORCE + (8*(IS_SDMA_START/64)), sde->progress_mask); CCE_INT_FORCE + (8 * (IS_SDMA_START / 64)), sde->progress_mask);
} }
...@@ -682,7 +682,7 @@ static inline void _sdma_close_tx(struct hfi1_devdata *dd, ...@@ -682,7 +682,7 @@ static inline void _sdma_close_tx(struct hfi1_devdata *dd,
dd->default_desc1; dd->default_desc1;
if (tx->flags & SDMA_TXREQ_F_URGENT) if (tx->flags & SDMA_TXREQ_F_URGENT)
tx->descp[tx->num_desc].qw[1] |= tx->descp[tx->num_desc].qw[1] |=
(SDMA_DESC1_HEAD_TO_HOST_FLAG| (SDMA_DESC1_HEAD_TO_HOST_FLAG |
SDMA_DESC1_INT_REQ_FLAG); SDMA_DESC1_INT_REQ_FLAG);
} }
......
...@@ -1204,7 +1204,7 @@ static int set_txreq_header(struct user_sdma_request *req, ...@@ -1204,7 +1204,7 @@ static int set_txreq_header(struct user_sdma_request *req,
/* Set ACK request on last packet */ /* Set ACK request on last packet */
if (unlikely(tx->flags & TXREQ_FLAGS_REQ_LAST_PKT)) if (unlikely(tx->flags & TXREQ_FLAGS_REQ_LAST_PKT))
hdr->bth[2] |= cpu_to_be32(1UL<<31); hdr->bth[2] |= cpu_to_be32(1UL << 31);
/* Set the new offset */ /* Set the new offset */
hdr->kdeth.swdata[6] = cpu_to_le32(req->koffset); hdr->kdeth.swdata[6] = cpu_to_le32(req->koffset);
......
...@@ -874,7 +874,7 @@ int hfi1_verbs_send_pio(struct rvt_qp *qp, struct hfi1_pkt_state *ps, ...@@ -874,7 +874,7 @@ int hfi1_verbs_send_pio(struct rvt_qp *qp, struct hfi1_pkt_state *ps,
pio_copy(ppd->dd, pbuf, pbc, hdr, hdrwords); pio_copy(ppd->dd, pbuf, pbc, hdr, hdrwords);
} else { } else {
if (ss) { if (ss) {
seg_pio_copy_start(pbuf, pbc, hdr, hdrwords*4); seg_pio_copy_start(pbuf, pbc, hdr, hdrwords * 4);
while (len) { while (len) {
void *addr = ss->sge.vaddr; void *addr = ss->sge.vaddr;
u32 slen = ss->sge.length; u32 slen = ss->sge.length;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment