blob: d8e6759369019db81e54af2f3b6739d5657222ec [file] [log] [blame]
Patrick Williams691668f2023-11-01 08:19:10 -05001/* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
Rashmica Guptac1b66f42022-12-09 16:24:45 +11002#ifndef CONTAINER_OF_H
3#define CONTAINER_OF_H
4
5#ifndef container_of
6#define container_of(ptr, type, member) \
Patrick Williams11e2e872024-08-16 15:22:26 -04007 (type *)((char *)(ptr) - offsetof(type, member))
Rashmica Guptac1b66f42022-12-09 16:24:45 +11008#endif
9
10#endif