printf: Remove unused 'bprintf'
[drm/drm-misc.git] / include / linux / packing.h
blob5d36dcd06f60420325473dae3a0e9ac37d03da4b
1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2016-2018 NXP
3 * Copyright (c) 2018-2019, Vladimir Oltean <olteanv@gmail.com>
4 */
5 #ifndef _LINUX_PACKING_H
6 #define _LINUX_PACKING_H
8 #include <linux/types.h>
9 #include <linux/bitops.h>
11 #define QUIRK_MSB_ON_THE_RIGHT BIT(0)
12 #define QUIRK_LITTLE_ENDIAN BIT(1)
13 #define QUIRK_LSW32_IS_FIRST BIT(2)
15 enum packing_op {
16 PACK,
17 UNPACK,
20 int packing(void *pbuf, u64 *uval, int startbit, int endbit, size_t pbuflen,
21 enum packing_op op, u8 quirks);
23 int pack(void *pbuf, u64 uval, size_t startbit, size_t endbit, size_t pbuflen,
24 u8 quirks);
26 int unpack(const void *pbuf, u64 *uval, size_t startbit, size_t endbit,
27 size_t pbuflen, u8 quirks);
29 #endif