Skip to content

Commit 880b005

Browse files
author
David S. Miller
committed
[TIPC]: Fix 64-bit build warnings.
When storing u32 values in a pointer, need to do some long casts to keep GCC happy. Signed-off-by: David S. Miller <[email protected]>
1 parent e86eaa3 commit 880b005

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

net/tipc/bcast.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ static inline u32 buf_seqno(struct sk_buff *buf)
114114

115115
static inline u32 bcbuf_acks(struct sk_buff *buf)
116116
{
117-
return (u32)TIPC_SKB_CB(buf)->handle;
117+
return (u32)(unsigned long)TIPC_SKB_CB(buf)->handle;
118118
}
119119

120120
static inline void bcbuf_set_acks(struct sk_buff *buf, u32 acks)
121121
{
122-
TIPC_SKB_CB(buf)->handle = (void *)acks;
122+
TIPC_SKB_CB(buf)->handle = (void *)(unsigned long)acks;
123123
}
124124

125125
static inline void bcbuf_decr_acks(struct sk_buff *buf)

net/tipc/port.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,8 @@ int tipc_connect2port(u32 ref, struct tipc_portid const *peer)
12341234
p_ptr->publ.connected = 1;
12351235
k_start_timer(&p_ptr->timer, p_ptr->probing_interval);
12361236

1237-
nodesub_subscribe(&p_ptr->subscription,peer->node, (void *)ref,
1237+
nodesub_subscribe(&p_ptr->subscription,peer->node,
1238+
(void *)(unsigned long)ref,
12381239
(net_ev_handler)port_handle_node_down);
12391240
res = TIPC_OK;
12401241
exit:

net/tipc/subscr.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,10 @@ static void subscr_conn_shutdown_event(void *usr_handle,
329329
unsigned int size,
330330
int reason)
331331
{
332-
struct subscriber *subscriber = ref_lock((u32)usr_handle);
332+
struct subscriber *subscriber;
333333
spinlock_t *subscriber_lock;
334334

335+
subscriber = ref_lock((u32)(unsigned long)usr_handle);
335336
if (subscriber == NULL)
336337
return;
337338

@@ -350,9 +351,10 @@ static void subscr_conn_msg_event(void *usr_handle,
350351
const unchar *data,
351352
u32 size)
352353
{
353-
struct subscriber *subscriber = ref_lock((u32)usr_handle);
354+
struct subscriber *subscriber;
354355
spinlock_t *subscriber_lock;
355356

357+
subscriber = ref_lock((u32)(unsigned long)usr_handle);
356358
if (subscriber == NULL)
357359
return;
358360

@@ -409,7 +411,7 @@ static void subscr_named_msg_event(void *usr_handle,
409411
/* Establish a connection to subscriber */
410412

411413
tipc_createport(topsrv.user_ref,
412-
(void *)subscriber->ref,
414+
(void *)(unsigned long)subscriber->ref,
413415
importance,
414416
0,
415417
0,

0 commit comments

Comments
 (0)