Skip to content

Commit 8ee18e2

Browse files
tititiou36davem330
authored andcommitted
caif: Fix bitmap data type in "struct caifsock"
Bitmap are "unsigned long", so use it instead of a "u32" to make things more explicit. While at it, remove some useless cast (and leading spaces) when using the bitmap API. Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 030f21b commit 8ee18e2

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

net/caif/caif_socket.c

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ enum caif_states {
4747
struct caifsock {
4848
struct sock sk; /* must be first member */
4949
struct cflayer layer;
50-
u32 flow_state;
50+
unsigned long flow_state;
5151
struct caif_connect_request conn_req;
5252
struct mutex readlock;
5353
struct dentry *debugfs_socket_dir;
@@ -56,38 +56,32 @@ struct caifsock {
5656

5757
static int rx_flow_is_on(struct caifsock *cf_sk)
5858
{
59-
return test_bit(RX_FLOW_ON_BIT,
60-
(void *) &cf_sk->flow_state);
59+
return test_bit(RX_FLOW_ON_BIT, &cf_sk->flow_state);
6160
}
6261

6362
static int tx_flow_is_on(struct caifsock *cf_sk)
6463
{
65-
return test_bit(TX_FLOW_ON_BIT,
66-
(void *) &cf_sk->flow_state);
64+
return test_bit(TX_FLOW_ON_BIT, &cf_sk->flow_state);
6765
}
6866

6967
static void set_rx_flow_off(struct caifsock *cf_sk)
7068
{
71-
clear_bit(RX_FLOW_ON_BIT,
72-
(void *) &cf_sk->flow_state);
69+
clear_bit(RX_FLOW_ON_BIT, &cf_sk->flow_state);
7370
}
7471

7572
static void set_rx_flow_on(struct caifsock *cf_sk)
7673
{
77-
set_bit(RX_FLOW_ON_BIT,
78-
(void *) &cf_sk->flow_state);
74+
set_bit(RX_FLOW_ON_BIT, &cf_sk->flow_state);
7975
}
8076

8177
static void set_tx_flow_off(struct caifsock *cf_sk)
8278
{
83-
clear_bit(TX_FLOW_ON_BIT,
84-
(void *) &cf_sk->flow_state);
79+
clear_bit(TX_FLOW_ON_BIT, &cf_sk->flow_state);
8580
}
8681

8782
static void set_tx_flow_on(struct caifsock *cf_sk)
8883
{
89-
set_bit(TX_FLOW_ON_BIT,
90-
(void *) &cf_sk->flow_state);
84+
set_bit(TX_FLOW_ON_BIT, &cf_sk->flow_state);
9185
}
9286

9387
static void caif_read_lock(struct sock *sk)

0 commit comments

Comments
 (0)