Commit a787bde8 authored by Shraddha Barke's avatar Shraddha Barke Committed by Greg Kroah-Hartman

Staging: rdma: hfi1: Remove unnecessary cast on void pointer

void pointers do not need to be cast to other pointer types.

The semantic patch used to find this:

@r@
expression x;
void* e;
type T;
identifier f;
@@

(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)
Signed-off-by: default avatarShraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0d04cd19
...@@ -1295,7 +1295,7 @@ static inline u64 read_write_csr(const struct hfi1_devdata *dd, u32 csr, ...@@ -1295,7 +1295,7 @@ static inline u64 read_write_csr(const struct hfi1_devdata *dd, u32 csr,
static u64 dev_access_u32_csr(const struct cntr_entry *entry, static u64 dev_access_u32_csr(const struct cntr_entry *entry,
void *context, int vl, int mode, u64 data) void *context, int vl, int mode, u64 data)
{ {
struct hfi1_devdata *dd = (struct hfi1_devdata *)context; struct hfi1_devdata *dd = context;
if (vl != CNTR_INVALID_VL) if (vl != CNTR_INVALID_VL)
return 0; return 0;
...@@ -1305,7 +1305,7 @@ static u64 dev_access_u32_csr(const struct cntr_entry *entry, ...@@ -1305,7 +1305,7 @@ static u64 dev_access_u32_csr(const struct cntr_entry *entry,
static u64 dev_access_u64_csr(const struct cntr_entry *entry, void *context, static u64 dev_access_u64_csr(const struct cntr_entry *entry, void *context,
int vl, int mode, u64 data) int vl, int mode, u64 data)
{ {
struct hfi1_devdata *dd = (struct hfi1_devdata *)context; struct hfi1_devdata *dd = context;
u64 val = 0; u64 val = 0;
u64 csr = entry->csr; u64 csr = entry->csr;
...@@ -1326,7 +1326,7 @@ static u64 dev_access_u64_csr(const struct cntr_entry *entry, void *context, ...@@ -1326,7 +1326,7 @@ static u64 dev_access_u64_csr(const struct cntr_entry *entry, void *context,
static u64 dc_access_lcb_cntr(const struct cntr_entry *entry, void *context, static u64 dc_access_lcb_cntr(const struct cntr_entry *entry, void *context,
int vl, int mode, u64 data) int vl, int mode, u64 data)
{ {
struct hfi1_devdata *dd = (struct hfi1_devdata *)context; struct hfi1_devdata *dd = context;
u32 csr = entry->csr; u32 csr = entry->csr;
int ret = 0; int ret = 0;
...@@ -1350,7 +1350,7 @@ static u64 dc_access_lcb_cntr(const struct cntr_entry *entry, void *context, ...@@ -1350,7 +1350,7 @@ static u64 dc_access_lcb_cntr(const struct cntr_entry *entry, void *context,
static u64 port_access_u32_csr(const struct cntr_entry *entry, void *context, static u64 port_access_u32_csr(const struct cntr_entry *entry, void *context,
int vl, int mode, u64 data) int vl, int mode, u64 data)
{ {
struct hfi1_pportdata *ppd = (struct hfi1_pportdata *)context; struct hfi1_pportdata *ppd = context;
if (vl != CNTR_INVALID_VL) if (vl != CNTR_INVALID_VL)
return 0; return 0;
...@@ -1360,7 +1360,7 @@ static u64 port_access_u32_csr(const struct cntr_entry *entry, void *context, ...@@ -1360,7 +1360,7 @@ static u64 port_access_u32_csr(const struct cntr_entry *entry, void *context,
static u64 port_access_u64_csr(const struct cntr_entry *entry, static u64 port_access_u64_csr(const struct cntr_entry *entry,
void *context, int vl, int mode, u64 data) void *context, int vl, int mode, u64 data)
{ {
struct hfi1_pportdata *ppd = (struct hfi1_pportdata *)context; struct hfi1_pportdata *ppd = context;
u64 val; u64 val;
u64 csr = entry->csr; u64 csr = entry->csr;
...@@ -1400,7 +1400,7 @@ static inline u64 read_write_sw(struct hfi1_devdata *dd, u64 *cntr, int mode, ...@@ -1400,7 +1400,7 @@ static inline u64 read_write_sw(struct hfi1_devdata *dd, u64 *cntr, int mode,
static u64 access_sw_link_dn_cnt(const struct cntr_entry *entry, void *context, static u64 access_sw_link_dn_cnt(const struct cntr_entry *entry, void *context,
int vl, int mode, u64 data) int vl, int mode, u64 data)
{ {
struct hfi1_pportdata *ppd = (struct hfi1_pportdata *)context; struct hfi1_pportdata *ppd = context;
if (vl != CNTR_INVALID_VL) if (vl != CNTR_INVALID_VL)
return 0; return 0;
...@@ -1410,7 +1410,7 @@ static u64 access_sw_link_dn_cnt(const struct cntr_entry *entry, void *context, ...@@ -1410,7 +1410,7 @@ static u64 access_sw_link_dn_cnt(const struct cntr_entry *entry, void *context,
static u64 access_sw_link_up_cnt(const struct cntr_entry *entry, void *context, static u64 access_sw_link_up_cnt(const struct cntr_entry *entry, void *context,
int vl, int mode, u64 data) int vl, int mode, u64 data)
{ {
struct hfi1_pportdata *ppd = (struct hfi1_pportdata *)context; struct hfi1_pportdata *ppd = context;
if (vl != CNTR_INVALID_VL) if (vl != CNTR_INVALID_VL)
return 0; return 0;
...@@ -1420,7 +1420,7 @@ static u64 access_sw_link_up_cnt(const struct cntr_entry *entry, void *context, ...@@ -1420,7 +1420,7 @@ static u64 access_sw_link_up_cnt(const struct cntr_entry *entry, void *context,
static u64 access_sw_xmit_discards(const struct cntr_entry *entry, static u64 access_sw_xmit_discards(const struct cntr_entry *entry,
void *context, int vl, int mode, u64 data) void *context, int vl, int mode, u64 data)
{ {
struct hfi1_pportdata *ppd = (struct hfi1_pportdata *)context; struct hfi1_pportdata *ppd = context;
if (vl != CNTR_INVALID_VL) if (vl != CNTR_INVALID_VL)
return 0; return 0;
...@@ -1431,7 +1431,7 @@ static u64 access_sw_xmit_discards(const struct cntr_entry *entry, ...@@ -1431,7 +1431,7 @@ static u64 access_sw_xmit_discards(const struct cntr_entry *entry,
static u64 access_xmit_constraint_errs(const struct cntr_entry *entry, static u64 access_xmit_constraint_errs(const struct cntr_entry *entry,
void *context, int vl, int mode, u64 data) void *context, int vl, int mode, u64 data)
{ {
struct hfi1_pportdata *ppd = (struct hfi1_pportdata *)context; struct hfi1_pportdata *ppd = context;
if (vl != CNTR_INVALID_VL) if (vl != CNTR_INVALID_VL)
return 0; return 0;
...@@ -1443,7 +1443,7 @@ static u64 access_xmit_constraint_errs(const struct cntr_entry *entry, ...@@ -1443,7 +1443,7 @@ static u64 access_xmit_constraint_errs(const struct cntr_entry *entry,
static u64 access_rcv_constraint_errs(const struct cntr_entry *entry, static u64 access_rcv_constraint_errs(const struct cntr_entry *entry,
void *context, int vl, int mode, u64 data) void *context, int vl, int mode, u64 data)
{ {
struct hfi1_pportdata *ppd = (struct hfi1_pportdata *)context; struct hfi1_pportdata *ppd = context;
if (vl != CNTR_INVALID_VL) if (vl != CNTR_INVALID_VL)
return 0; return 0;
...@@ -1491,7 +1491,7 @@ static u64 read_write_cpu(struct hfi1_devdata *dd, u64 *z_val, ...@@ -1491,7 +1491,7 @@ static u64 read_write_cpu(struct hfi1_devdata *dd, u64 *z_val,
static u64 access_sw_cpu_intr(const struct cntr_entry *entry, static u64 access_sw_cpu_intr(const struct cntr_entry *entry,
void *context, int vl, int mode, u64 data) void *context, int vl, int mode, u64 data)
{ {
struct hfi1_devdata *dd = (struct hfi1_devdata *)context; struct hfi1_devdata *dd = context;
return read_write_cpu(dd, &dd->z_int_counter, dd->int_counter, vl, return read_write_cpu(dd, &dd->z_int_counter, dd->int_counter, vl,
mode, data); mode, data);
...@@ -1500,7 +1500,7 @@ static u64 access_sw_cpu_intr(const struct cntr_entry *entry, ...@@ -1500,7 +1500,7 @@ static u64 access_sw_cpu_intr(const struct cntr_entry *entry,
static u64 access_sw_cpu_rcv_limit(const struct cntr_entry *entry, static u64 access_sw_cpu_rcv_limit(const struct cntr_entry *entry,
void *context, int vl, int mode, u64 data) void *context, int vl, int mode, u64 data)
{ {
struct hfi1_devdata *dd = (struct hfi1_devdata *)context; struct hfi1_devdata *dd = context;
return read_write_cpu(dd, &dd->z_rcv_limit, dd->rcv_limit, vl, return read_write_cpu(dd, &dd->z_rcv_limit, dd->rcv_limit, vl,
mode, data); mode, data);
...@@ -1509,7 +1509,7 @@ static u64 access_sw_cpu_rcv_limit(const struct cntr_entry *entry, ...@@ -1509,7 +1509,7 @@ static u64 access_sw_cpu_rcv_limit(const struct cntr_entry *entry,
static u64 access_sw_pio_wait(const struct cntr_entry *entry, static u64 access_sw_pio_wait(const struct cntr_entry *entry,
void *context, int vl, int mode, u64 data) void *context, int vl, int mode, u64 data)
{ {
struct hfi1_devdata *dd = (struct hfi1_devdata *)context; struct hfi1_devdata *dd = context;
return dd->verbs_dev.n_piowait; return dd->verbs_dev.n_piowait;
} }
...@@ -1517,7 +1517,7 @@ static u64 access_sw_pio_wait(const struct cntr_entry *entry, ...@@ -1517,7 +1517,7 @@ static u64 access_sw_pio_wait(const struct cntr_entry *entry,
static u64 access_sw_vtx_wait(const struct cntr_entry *entry, static u64 access_sw_vtx_wait(const struct cntr_entry *entry,
void *context, int vl, int mode, u64 data) void *context, int vl, int mode, u64 data)
{ {
struct hfi1_devdata *dd = (struct hfi1_devdata *)context; struct hfi1_devdata *dd = context;
return dd->verbs_dev.n_txwait; return dd->verbs_dev.n_txwait;
} }
...@@ -1525,7 +1525,7 @@ static u64 access_sw_vtx_wait(const struct cntr_entry *entry, ...@@ -1525,7 +1525,7 @@ static u64 access_sw_vtx_wait(const struct cntr_entry *entry,
static u64 access_sw_kmem_wait(const struct cntr_entry *entry, static u64 access_sw_kmem_wait(const struct cntr_entry *entry,
void *context, int vl, int mode, u64 data) void *context, int vl, int mode, u64 data)
{ {
struct hfi1_devdata *dd = (struct hfi1_devdata *)context; struct hfi1_devdata *dd = context;
return dd->verbs_dev.n_kmem_wait; return dd->verbs_dev.n_kmem_wait;
} }
......
...@@ -1438,7 +1438,7 @@ static int __subn_set_opa_pkeytable(struct opa_smp *smp, u32 am, u8 *data, ...@@ -1438,7 +1438,7 @@ static int __subn_set_opa_pkeytable(struct opa_smp *smp, u32 am, u8 *data,
static int get_sc2vlt_tables(struct hfi1_devdata *dd, void *data) static int get_sc2vlt_tables(struct hfi1_devdata *dd, void *data)
{ {
u64 *val = (u64 *)data; u64 *val = data;
*val++ = read_csr(dd, SEND_SC2VLT0); *val++ = read_csr(dd, SEND_SC2VLT0);
*val++ = read_csr(dd, SEND_SC2VLT1); *val++ = read_csr(dd, SEND_SC2VLT1);
...@@ -1457,7 +1457,7 @@ static int get_sc2vlt_tables(struct hfi1_devdata *dd, void *data) ...@@ -1457,7 +1457,7 @@ static int get_sc2vlt_tables(struct hfi1_devdata *dd, void *data)
static void filter_sc2vlt(void *data) static void filter_sc2vlt(void *data)
{ {
int i; int i;
u8 *pd = (u8 *)data; u8 *pd = data;
for (i = 0; i < OPA_MAX_SCS; i++) { for (i = 0; i < OPA_MAX_SCS; i++) {
if (i == 15) if (i == 15)
...@@ -1469,7 +1469,7 @@ static void filter_sc2vlt(void *data) ...@@ -1469,7 +1469,7 @@ static void filter_sc2vlt(void *data)
static int set_sc2vlt_tables(struct hfi1_devdata *dd, void *data) static int set_sc2vlt_tables(struct hfi1_devdata *dd, void *data)
{ {
u64 *val = (u64 *)data; u64 *val = data;
filter_sc2vlt(data); filter_sc2vlt(data);
...@@ -1478,7 +1478,7 @@ static int set_sc2vlt_tables(struct hfi1_devdata *dd, void *data) ...@@ -1478,7 +1478,7 @@ static int set_sc2vlt_tables(struct hfi1_devdata *dd, void *data)
write_csr(dd, SEND_SC2VLT2, *val++); write_csr(dd, SEND_SC2VLT2, *val++);
write_csr(dd, SEND_SC2VLT3, *val++); write_csr(dd, SEND_SC2VLT3, *val++);
write_seqlock_irq(&dd->sc2vl_lock); write_seqlock_irq(&dd->sc2vl_lock);
memcpy(dd->sc2vl, (u64 *)data, sizeof(dd->sc2vl)); memcpy(dd->sc2vl, data, sizeof(dd->sc2vl));
write_sequnlock_irq(&dd->sc2vl_lock); write_sequnlock_irq(&dd->sc2vl_lock);
return 0; return 0;
} }
......
...@@ -1885,7 +1885,7 @@ static void init_ibport(struct hfi1_pportdata *ppd) ...@@ -1885,7 +1885,7 @@ static void init_ibport(struct hfi1_pportdata *ppd)
static void verbs_txreq_kmem_cache_ctor(void *obj) static void verbs_txreq_kmem_cache_ctor(void *obj)
{ {
struct verbs_txreq *tx = (struct verbs_txreq *)obj; struct verbs_txreq *tx = obj;
memset(tx, 0, sizeof(*tx)); memset(tx, 0, sizeof(*tx));
} }
......
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