diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-17 10:19:23 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-01 19:47:42 +0300 |
commit | cea07a7b6ac2cd9f40e20a5010203014c4996eb2 (patch) | |
tree | 6b7d76ce014dcc8db154c69784c492746b11791e /fs/bcachefs/vstructs.h | |
parent | 41b84fb489f7707af4490d1e5e22d88f3207da71 (diff) | |
download | linux-cea07a7b6ac2cd9f40e20a5010203014c4996eb2.tar.xz |
bcachefs: vstruct_for_each() now declares loop iter
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/vstructs.h')
-rw-r--r-- | fs/bcachefs/vstructs.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/bcachefs/vstructs.h b/fs/bcachefs/vstructs.h index a6561b4b36a6..2ad338e282da 100644 --- a/fs/bcachefs/vstructs.h +++ b/fs/bcachefs/vstructs.h @@ -48,14 +48,14 @@ ((void *) ((u64 *) (_s)->_data + __vstruct_u64s(_s))) #define vstruct_for_each(_s, _i) \ - for (_i = (_s)->start; \ + for (typeof(&(_s)->start[0]) _i = (_s)->start; \ _i < vstruct_last(_s); \ _i = vstruct_next(_i)) -#define vstruct_for_each_safe(_s, _i, _t) \ - for (_i = (_s)->start; \ - _i < vstruct_last(_s) && (_t = vstruct_next(_i), true); \ - _i = _t) +#define vstruct_for_each_safe(_s, _i) \ + for (typeof(&(_s)->start[0]) _next, _i = (_s)->start; \ + _i < vstruct_last(_s) && (_next = vstruct_next(_i), true); \ + _i = _next) #define vstruct_idx(_s, _idx) \ ((typeof(&(_s)->start[0])) ((_s)->_data + (_idx))) |