summaryrefslogtreecommitdiffstats
path: root/drivers/staging/csr/oska/util.h
blob: bf29e2d906ed69361e344b0f83d5e77d3eefd24a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
 * OSKA Linux implementation -- misc. utility functions
 *
 * Copyright (C) 2007 Cambridge Silicon Radio Ltd.
 *
 * Refer to LICENSE.txt included with this source code for details on
 * the license terms.
 */
#ifndef __OSKA_LINUX_UTILS_H
#define __OSKA_LINUX_UTILS_H

#include <linux/kernel.h>
#include <linux/bug.h>
#include <asm/byteorder.h>

#define OS_ASSERT(expr) BUG_ON(!(expr))

static inline uint16_t os_le16_to_cpu(uint16_t x)
{
    return le16_to_cpu(x);
}

static inline uint16_t os_cpu_to_le16(uint16_t x)
{
    return cpu_to_le16(x);
}

static inline uint32_t os_le32_to_cpu(uint32_t x)
{
    return le32_to_cpu(x);
}

static inline uint32_t os_cpu_to_le32(uint32_t x)
{
    return cpu_to_le32(x);
}

static inline uint64_t os_le64_to_cpu(uint64_t x)
{
    return le64_to_cpu(x);
}

static inline uint64_t os_cpu_to_le64(uint64_t x)
{
    return cpu_to_le64(x);
}

#endif /* __OSKA_LINUX_UTILS_H */