summaryrefslogtreecommitdiff
path: root/tools/include/linux/align.h
blob: 14e34ace80ddae6980b6f55eea8482b5a1bf5b3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/* SPDX-License-Identifier: GPL-2.0-only */

#ifndef _TOOLS_LINUX_ALIGN_H
#define _TOOLS_LINUX_ALIGN_H

#include <uapi/linux/const.h>

#define ALIGN(x, a)		__ALIGN_KERNEL((x), (a))
#define ALIGN_DOWN(x, a)	__ALIGN_KERNEL((x) - ((a) - 1), (a))
#define IS_ALIGNED(x, a)	(((x) & ((typeof(x))(a) - 1)) == 0)

#endif /* _TOOLS_LINUX_ALIGN_H */