lkml.org 
[lkml]   [2015]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRE: [lustre-devel] [PATCH 01/12] staging: lustre: fid: Use !x to check for kzalloc failure
    Date
    >> Yes.  I know Al's thoughts and kernel style.
    >>
    >> But Alan Cox and Andreas have both said they think (x == NULL) can help
    >> you avoid some kind of boolean vs pointer bugs. I've had co-workers who
    >> did massive seds changing !foo to foo == NULL on our code base. But
    >> I've never seen a real life example of a bug this fixes.
    >>
    >> To be honest, I've never seen a real life proof that (!foo) code is less
    >> buggy. I should look through the kbuild mailbox... Hm... But my other
    >> idea of setting up code style readability testing website is also a good
    >> one.
    >>
    >> Linux kernel style is based on Joe Perches finding that 80% of the code
    >> prefers one way or the other. That's a valid method for determining
    >> code style. I bet it normally picks the more readable style but it
    >> would be interesting to measure it more formally.
    >
    >On today's linux-next, I find 3218 tests on the result of kmalloc etc
    >using NULL and 14429 without, making 82% without. The complete semantic
    >patch is shown below.

    Most people doing something a certain way is not a technical argument. Usually
    people do what they are taught. From most people's comments their seems to
    be no technical reason to us one over another. I do have one technical reason not
    to accept these patches. It is too easy to make a mistake and break things very badly.
    I don't think it is worth the risk for a non-hard requirement.



    \
     
     \ /
      Last update: 2015-06-24 22:41    [W:3.827 / U:0.052 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site