mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[PKT_SCHED]: Cleanup qdisc creation and alignment macros
Adds qdisc_alloc() to share code between qdisc_create() and qdisc_create_dflt(). Hides the qdisc alignment behind macros and makes use of them. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e41a33e6ec
commit
3d54b82fdf
4 changed files with 37 additions and 47 deletions
|
@ -13,13 +13,12 @@ struct qdisc_walker
|
|||
|
||||
extern rwlock_t qdisc_tree_lock;
|
||||
|
||||
#define QDISC_ALIGN 32
|
||||
#define QDISC_ALIGN_CONST (QDISC_ALIGN - 1)
|
||||
#define QDISC_ALIGNTO 32
|
||||
#define QDISC_ALIGN(len) (((len) + QDISC_ALIGNTO-1) & ~(QDISC_ALIGNTO-1))
|
||||
|
||||
static inline void *qdisc_priv(struct Qdisc *q)
|
||||
{
|
||||
return (char *)q + ((sizeof(struct Qdisc) + QDISC_ALIGN_CONST)
|
||||
& ~QDISC_ALIGN_CONST);
|
||||
return (char *) q + QDISC_ALIGN(sizeof(struct Qdisc));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue