Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'net-some-build-fixes-and-other-improvements'

Jakub Kicinski says:

====================
net: some build fixes and other improvements

A few unrelated improvements here, mostly trying to make random
configs build and W=1 produce a little less warnings under net/
and drivers net/.

First two patches fix set but not used warnings with W=1.

Next patch fixes 64bit division in sch_taprio.c.

Last two patches are getting rid of some (almost) unused asserts
in skbuff.h.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+15 -18
-2
drivers/net/ethernet/cortina/gemini.c
··· 1235 1235 int txq_num, nfrags; 1236 1236 union dma_rwptr rw; 1237 1237 1238 - SKB_FRAG_ASSERT(skb); 1239 - 1240 1238 if (skb->len >= 0x10000) 1241 1239 goto out_drop_free; 1242 1240
+3 -6
drivers/net/sb1000.c
··· 316 316 card_send_command(const int ioaddr[], const char* name, 317 317 const unsigned char out[], unsigned char in[]) 318 318 { 319 - int status, x; 319 + int status; 320 320 321 321 if ((status = card_wait_for_busy_clear(ioaddr, name))) 322 322 return status; ··· 345 345 out[0], out[1], out[2], out[3], out[4], out[5]); 346 346 } 347 347 348 - if (out[1] == 0x1b) { 349 - x = (out[2] == 0x02); 350 - } else { 348 + if (out[1] != 0x1b) { 351 349 if (out[0] >= 0x80 && in[0] != (out[1] | 0x80)) 352 350 return -EIO; 353 351 } ··· 488 490 static const unsigned char Command0[6] = {0x80, 0x1f, 0x00, 0x00, 0x00, 0x00}; 489 491 490 492 unsigned char st[7]; 491 - int crc, status; 493 + int status; 492 494 493 495 /* check CRC */ 494 496 if ((status = card_send_command(ioaddr, name, Command0, st))) 495 497 return status; 496 498 if (st[1] != st[3] || st[2] != st[4]) 497 499 return -EIO; 498 - crc = st[1] << 8 | st[2]; 499 500 return 0; 500 501 } 501 502
-2
include/linux/skbuff.h
··· 2100 2100 void skb_coalesce_rx_frag(struct sk_buff *skb, int i, int size, 2101 2101 unsigned int truesize); 2102 2102 2103 - #define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags) 2104 - #define SKB_FRAG_ASSERT(skb) BUG_ON(skb_has_frag_list(skb)) 2105 2103 #define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb)) 2106 2104 2107 2105 #ifdef NET_SKBUFF_DATA_USES_OFFSET
+1 -2
net/l2tp/l2tp_ppp.c
··· 1070 1070 { 1071 1071 struct pppol2tp_ioc_stats stats; 1072 1072 struct l2tp_session *session; 1073 - int val; 1074 1073 1075 1074 switch (cmd) { 1076 1075 case PPPIOCGMRU: ··· 1096 1097 if (!session->session_id && !session->peer_session_id) 1097 1098 return -ENOSYS; 1098 1099 1099 - if (get_user(val, (int __user *)arg)) 1100 + if (!access_ok((int __user *)arg, sizeof(int))) 1100 1101 return -EFAULT; 1101 1102 break; 1102 1103
+11 -6
net/sched/sch_taprio.c
··· 13 13 #include <linux/list.h> 14 14 #include <linux/errno.h> 15 15 #include <linux/skbuff.h> 16 + #include <linux/math64.h> 16 17 #include <linux/module.h> 17 18 #include <linux/spinlock.h> 18 19 #include <net/netlink.h> ··· 122 121 123 122 static inline int length_to_duration(struct taprio_sched *q, int len) 124 123 { 125 - return (len * atomic64_read(&q->picos_per_byte)) / 1000; 124 + return div_u64(len * atomic64_read(&q->picos_per_byte), 1000); 125 + } 126 + 127 + static void taprio_set_budget(struct taprio_sched *q, struct sched_entry *entry) 128 + { 129 + atomic_set(&entry->budget, 130 + div64_u64((u64)entry->interval * 1000, 131 + atomic64_read(&q->picos_per_byte))); 126 132 } 127 133 128 134 static struct sk_buff *taprio_dequeue(struct Qdisc *sch) ··· 249 241 close_time = ktime_add_ns(entry->close_time, next->interval); 250 242 251 243 next->close_time = close_time; 252 - atomic_set(&next->budget, 253 - (next->interval * 1000) / atomic64_read(&q->picos_per_byte)); 244 + taprio_set_budget(q, next); 254 245 255 246 first_run: 256 247 rcu_assign_pointer(q->current_entry, next); ··· 582 575 list); 583 576 584 577 first->close_time = ktime_add_ns(start, first->interval); 585 - atomic_set(&first->budget, 586 - (first->interval * 1000) / 587 - atomic64_read(&q->picos_per_byte)); 578 + taprio_set_budget(q, first); 588 579 rcu_assign_pointer(q->current_entry, NULL); 589 580 590 581 spin_unlock_irqrestore(&q->current_entry_lock, flags);