Ok, first of all you should probably run all this through checkpatch
and fix all the errors it reports and most of the warnings, then
provide a log of the output indicating any false warnings. That will
help you fix a lot of codingstyle quirks that tend to annoy ordinary
reviewers when they are going over your code, which helps make them
much more productive.
On Fri, Apr 10, 2009 at 8:12 AM, Philipp Reisner
<philipp.reisner@linbit.com> wrote:
I think there's a standard macro for this? On the other hand, it's
generally recommended that you avoid using C-level bitfields for
network-transport things... masking with explicit constants is
preferred.
CamelCase is discouraged for constants, codingstyle encourages ALL_CAPS.
The best documentation that the values of an enum should not be
rearranged is to explicitly assign all of the enum values.
Specifically it makes it a pain in the rear for somebody to try to
break binary compatibility, which is a good coding practice in
general.
CodingStyle: Drop the _t and just use "union drbd_state".
Yeah, this is kinda ugly... just use shift and mask like most other places do.
CodingStyle: Your #defines should be ALL_CAPS
CodingStyle: Your type names should be all_lower_case
Instead of cobbling together your own tracing code, why not use the
fancy tracing infrastructure that Ingo, et. al. have been getting
merged? Look at the blktrace patches that have been going by on LKML
today for some examples.
This looks like it should perhaps be implemented by sending uevents on
your drbd device, instead of running a separate userland helper.
Specifically that way you don't trigger an exec for every single
event; uevents support a persistent daemon handling various tasks.
CodingStyle: s/STATIC/static/g
Also remove that #define STATIC static macro and associated #ifdefs
Perhaps you should just export a raw 64-bit number of bytes to
userspace via sysfs/etc and let userspace decode it?
Spelling/clarity fix: change "enum determin_dev_size_enum" to "enum
determine_dev_size"
Please use the existing dev_warn()-style macros instead of writing
your own set. We're trying to get rid of those superfluous macros all
over the place, not add more!
Again, this looks like an excellent candidate for the standardized
tracing macros.
If this is a real bug, please submit a patch to fix it as a prereq for
the drbd patch. If not, please remove this comment.
Yet more custom macros... use standard stuff like BUG_ON() please?
Ewww.... Either those should be static inlines or you should just
declare some local variables and reference them instead.
Either fix this code or remove it.
Cheers,
Kyle Moffett
--