From: Gleb C. <lna...@ya...> - 2023-07-19 08:38:55
|
Commit: d74330a GitHub URL: https://github.com/SCST-project/scst/commit/d74330aed223228e2051050ae1875d3c5a78ebeb Author: Gleb Chesnokov Date: 2023-07-19T11:35:51+03:00 Log Message: ----------- qla2x00t-32gbit: Backport to older kernel versions Unbreak the build for the previous commit against kernel versions before v5.16. See also commit 3080ea5553cc ("stddef: Introduce DECLARE_FLEX_ARRAY() helper") # v5.16. Modified Paths: -------------- scst/include/backport.h | 8 ++++++++ 1 file changed, 8 insertions(+) =================================================================== diff --git a/scst/include/backport.h b/scst/include/backport.h index 4e693ae..f4fc281 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -1314,6 +1314,14 @@ static inline void __user *KERNEL_SOCKPTR(void *p) #define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER)) #endif +#ifndef DECLARE_FLEX_ARRAY +#define DECLARE_FLEX_ARRAY(TYPE, NAME) \ + struct { \ + struct { } __empty_ ## NAME; \ + TYPE NAME[]; \ + } +#endif + /* <linux/string.h> */ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0) && \ |