Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79320
b: refs/heads/master
c: 5b0ac72
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Jan 28, 2008
1 parent 90984c8 commit 876f9fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 81da99ed71254a08d9a0bce46c258c1e15ac3948
refs/heads/master: 5b0ac72bc5fdda9634fb07db4cb0237fa9b6df68
15 changes: 3 additions & 12 deletions trunk/net/sched/sch_dsmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <linux/errno.h>
#include <linux/skbuff.h>
#include <linux/rtnetlink.h>
#include <linux/bitops.h>
#include <net/pkt_sched.h>
#include <net/dsfield.h>
#include <net/inet_ecn.h>
Expand Down Expand Up @@ -43,17 +44,6 @@ struct dsmark_qdisc_data {
int set_tc_index;
};

static inline int dsmark_valid_indices(u16 indices)
{
while (indices != 1) {
if (indices & 1)
return 0;
indices >>= 1;
}

return 1;
}

static inline int dsmark_valid_index(struct dsmark_qdisc_data *p, u16 index)
{
return (index <= p->indices && index > 0);
Expand Down Expand Up @@ -348,7 +338,8 @@ static int dsmark_init(struct Qdisc *sch, struct rtattr *opt)
goto errout;

indices = RTA_GET_U16(tb[TCA_DSMARK_INDICES-1]);
if (!indices || !dsmark_valid_indices(indices))

if (hweight32(indices) != 1)
goto errout;

if (tb[TCA_DSMARK_DEFAULT_INDEX-1])
Expand Down

0 comments on commit 876f9fa

Please sign in to comment.