[lkml]   [2010]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] base firmware: Fix BUG from sysfs attributes change in commit a2db6842873c8e5a70652f278d469128cb52db70

Eric W. Biederman <ebiederm <at>> writes:

> Wolfram Sang was figuring out if he could get coccinelle (whatever
> that is) to find more of them.

Huh, found this accidently, CC helps :)

coccinelle can apply semantic patches, rough description here [1]. So I wrote
one which checks for every c-file in the kernel-tree:

- Is there a structure containing (bin_)attribute?
- Does a function declare a pointer to such a structure?
- Is this pointer then used for a sysfs_create(_bin)_file?
- If so, has there been a call to sysfs(_bin)_attr_init before?

If not -> report. As coccinelle works on an abstract level of the code (not on
source-code level), it can follow code-paths and such. Really nice tool, once
you gathered the information to learn it.

The outcome are those patches:
(which is pretty much the same like the patch originating this thread. I vote
very much for dropping those patches and use instead!)

Eric, if you have a bit of time, acking these patches would help them getting
accepted for the mips/rtc-trees, IMHO.




 \ /
  Last update: 2010-03-14 11:53    [W:0.051 / U:7.672 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site