back at the naming bikeshed

jim.cromie at jim.cromie at
Fri Jul 14 16:04:20 EDT 2023

so I found myself writing this macro, and using it 4 times.

+#define for_each_boxed_veclen(_box, _vec, _len, _ct, _curs) \
+ for (_ct = 0, _curs = _box->_vec; _ct < _box->_len; _ct++, _curs++)

- for (i = 0, cm = di->classes; i < di->num_classes; i++, cm++) {
+ for_each_boxed_veclen(di, classes, num_classes, i, cm) {


does it exist by another name already ?

is it worth having generally ?

are there better ways to do it ?

fwiw, it does sound semantically connected to __counted_by()  attribute

struct Ntuple {
  int len;
  struct tuple **vector __counted_by(len);

More information about the Kernelnewbies mailing list