RE: [RFC PATCH 3/3] Convert mce_disabled

From: Luck, Tony
Date: Fri Oct 12 2012 - 13:46:39 EST


> Or, you can modify the mca_config I have there and use bools and pass a
> pointer to each actual bool member in each DEVICE_BIT_ATTR invocation
> (and rename it to DEVICE_BOOL_ATTR). Yeah, that could work, unless I'm
> missing something else, of course.

This looks like the best solution to me. Sure we use a little more memory for
a "bool" for each option instead of just a single bit. But there are only a
handful of them, not thousands. So I think we can cope with a few extra
bytes of memory consumption. I was still not completely convinced by the

if (val)
*bvec |= le64_to_cpu(BIT_64(bit));

solution - it assumes that big endian machines also assign their bit numbers
in a big->little way - but that isn't required by the C standard. bitfields are
assigned at the whim of the compiler writer (the only restrictions seem to
be on alignments of fields w.r.t. to the underlying data types).

-Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/