Re: [PATCH 0/2] create FLEX_ALLOC_MEM to FLEX_ALLOC_STR cocci rule

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 03, 2019 at 03:00:03PM -0700, Denton Liu wrote:

> I was playing around with coccinelle and I noticed that we have a use of
> FLEX_ALLOC_MEM that could be converted into FLEX_ALLOC_STR. Convert it
> and write a cocci rule to prevent this from happening.
> 
> Note that this was more of an exercise to teach myself how to use
> coccinelle. I'm just submitting a useful patch that came as a result of
> this. Please let me know if this is unwelcome.

Both look pretty reasonable to me. Obviously it's a pretty trivial
change, but that's sort of the point: automate these things away so we
don't have to think about them during review.

Now if you could figure out a way to point people to FLEX_ALLOC in the
first place when they are not currently using it, _that_ would be pretty
amazing. But I suspect it's a bit too complicated. :)

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux