summaryrefslogtreecommitdiffstats
path: root/include/linux/sizeof_field.h
blob: 7ff541cb21af4b4af5b9bd8ef8ed669088224d6b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_SIZEOF_FIELD_H
#define _LINUX_SIZEOF_FIELD_H

/**
 * sizeof_field() - Report the size of a struct field in bytes
 *
 * @TYPE: The structure containing the field of interest
 * @MEMBER: The field to return the size of
 */
#define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER))


#endif  /* _LINUX_SIZEOF_FIELD_H */