mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
net: Remove casts to same type
Adding casts of objects to the same type is unnecessary and confusing for a human reader. For example, this cast: int y; int *p = (int *)&y; I used the coccinelle script below to find and remove these unnecessary casts. I manually removed the conversions this script produces of casts with __force and __user. @@ type T; T *p; @@ - (T *)p + p Signed-off-by: Joe Perches <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
29a6b6c060
commit
e3192690a3
14 changed files with 32 additions and 36 deletions
|
|
@ -592,7 +592,7 @@ static void init_prb_bdqc(struct packet_sock *po,
|
|||
p1->knxt_seq_num = 1;
|
||||
p1->pkbdq = pg_vec;
|
||||
pbd = (struct tpacket_block_desc *)pg_vec[0].buffer;
|
||||
p1->pkblk_start = (char *)pg_vec[0].buffer;
|
||||
p1->pkblk_start = pg_vec[0].buffer;
|
||||
p1->kblk_size = req_u->req3.tp_block_size;
|
||||
p1->knum_blocks = req_u->req3.tp_block_nr;
|
||||
p1->hdrlen = po->tp_hdrlen;
|
||||
|
|
@ -824,8 +824,7 @@ static void prb_open_block(struct tpacket_kbdq_core *pkc1,
|
|||
h1->ts_first_pkt.ts_sec = ts.tv_sec;
|
||||
h1->ts_first_pkt.ts_nsec = ts.tv_nsec;
|
||||
pkc1->pkblk_start = (char *)pbd1;
|
||||
pkc1->nxt_offset = (char *)(pkc1->pkblk_start +
|
||||
BLK_PLUS_PRIV(pkc1->blk_sizeof_priv));
|
||||
pkc1->nxt_offset = pkc1->pkblk_start + BLK_PLUS_PRIV(pkc1->blk_sizeof_priv);
|
||||
BLOCK_O2FP(pbd1) = (__u32)BLK_PLUS_PRIV(pkc1->blk_sizeof_priv);
|
||||
BLOCK_O2PRIV(pbd1) = BLK_HDR_LEN;
|
||||
pbd1->version = pkc1->version;
|
||||
|
|
@ -1018,7 +1017,7 @@ static void *__packet_lookup_frame_in_block(struct packet_sock *po,
|
|||
struct tpacket_block_desc *pbd;
|
||||
char *curr, *end;
|
||||
|
||||
pkc = GET_PBDQC_FROM_RB(((struct packet_ring_buffer *)&po->rx_ring));
|
||||
pkc = GET_PBDQC_FROM_RB(&po->rx_ring);
|
||||
pbd = GET_CURR_PBLOCK_DESC_FROM_CORE(pkc);
|
||||
|
||||
/* Queue is frozen when user space is lagging behind */
|
||||
|
|
@ -1044,7 +1043,7 @@ static void *__packet_lookup_frame_in_block(struct packet_sock *po,
|
|||
smp_mb();
|
||||
curr = pkc->nxt_offset;
|
||||
pkc->skb = skb;
|
||||
end = (char *) ((char *)pbd + pkc->kblk_size);
|
||||
end = (char *)pbd + pkc->kblk_size;
|
||||
|
||||
/* first try the current block */
|
||||
if (curr+TOTAL_PKT_LEN_INCL_ALIGN(len) < end) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue