On Tue, 22 Aug 2017, Derek M Jones wrote:
> Julia,
>
> > 1. More aggressive inclusion of header files, combined with caching of
> > header files. Now if there is only one occurrence of a header file with a
>
> Caching can be dangerous because macros may be defined differently
> for different i
On Tue, 22 Aug 2017, Kees Cook wrote:
> Hi,
>
> I'm working on a large type conversion for struct timer_list, and
> it'll require changing all of the callback prototypes and changing
> logic at their start. For example, if I start with this:
>
>
> void primary_callback(unsigned long arg);
> void
On Tue, 22 Aug 2017, Kees Cook wrote:
> This improves the patch mode of setup_timer.cocci. Several patterns were
> missing:
> - assignments-before-init_timer() cases
> - limiting the .data case removal to the struct timer_list instance
> - handling calls by dereference (timer->field vs timer.
Allow messages about multiple timers.
Signed-off-by: Julia Lawall
---
scripts/coccinelle/api/setup_timer.cocci | 15 ++-
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/scripts/coccinelle/api/setup_timer.cocci
b/scripts/coccinelle/api/setup_timer.cocci
index eb6bd9e
> I have tried another variant out for a source code analysis.
Does the following SmPL script variant make sense?
@duplicated_code@
identifier work;
statement s1, s2;
type T;
@@
T work(...)
{
... when any
*if ((...) < 0)
*{
...
* s1
* s2
*}
<+...
*if ((...) < 0)
*{
...
* s1
*
> You would need when any on the ... Otherwise, it will not match anything
> (perhaps declarations). The s1 after is precludes matching any statement.
> Likewise in the next if.
The suggested variant does still not work in the way I would expect it.
@duplicated_code@
identifier work;
statement s
Julia,
The Linux kernel has some declarations like
type fn(a1, a2) >
with no trailing ; followed by a function definition. This gives a parse
error on a1. In the previous version, Coccinelle was able to recover an
The K&R style. Perfectly legal C.
Basically the recovery process is focuse
>> How should the source code search be improved further here?
>
> If you like the results from the second case, what more do you want?
* There are also several questionable transformation suggestions generated
besides the usable ones.
* Will answers belong also to the topic “Get the non-optio
On Wed, 23 Aug 2017, Derek M Jones wrote:
> Julia,
>
> > The Linux kernel has some declarations like
> >
> > type fn(a1, a2) >
> > with no trailing ; followed by a function definition. This gives a parse
> > error on a1. In the previous version, Coccinelle was able to recover an
>
> The K&R st
Julia,
I don't think that is what it is. The declarations are eg:
static inline __printf(2, 3)
void _dev_info(const struct device *dev, const char *fmt, ...)
{}
I guess that the whole first line is part of the declaration of _dev_info,
but Coccinelle can't cope with the __printf(2, 3).
http
On Wed, 23 Aug 2017, Derek M Jones wrote:
> Julia,
>
> > I don't think that is what it is. The declarations are eg:
> >
> > static inline __printf(2, 3)
> > void _dev_info(const struct device *dev, const char *fmt, ...)
> > {}
> >
> > I guess that the whole first line is part of the declaration
On Wed, Aug 23, 2017 at 6:13 AM, Julia Lawall wrote:
>
>
> On Tue, 22 Aug 2017, Kees Cook wrote:
>
>> This improves the patch mode of setup_timer.cocci. Several patterns were
>> missing:
>> - assignments-before-init_timer() cases
>> - limiting the .data case removal to the struct timer_list inst
I think I'm getting closer. Here are some specific examples that don't
seem to work:
---match_callback.cocci---
virtual patch
@match_timer_function_usage
depends on patch@
expression _E;
struct timer_list _e;
identifier _timer;
identifier _callback;
type _cast_func, _cast_data;
@@
(
-setup_time
On Wed, 23 Aug 2017, Kees Cook wrote:
> I think I'm getting closer. Here are some specific examples that don't
> seem to work:
>
> ---match_callback.cocci---
> virtual patch
>
> @match_timer_function_usage
> depends on patch@
> expression _E;
> struct timer_list _e;
> identifier _timer;
> ident
On Wed, Aug 23, 2017 at 2:19 PM, Julia Lawall wrote:
>
>
> On Wed, 23 Aug 2017, Kees Cook wrote:
>
>> I think I'm getting closer. Here are some specific examples that don't
>> seem to work:
>>
>> ---match_callback.cocci---
>> virtual patch
>>
>> @match_timer_function_usage
>> depends on patch@
>>
> > For me it works. Do you have the latest version of Coccinelle from
> > github? I used the option --all-includes.
>
> Ah-ha! Thank you. :) I had --no-includes in my .cocci. :)
>From a performance point of view, you might want to do what you can with
--no-includes first. It will then only be
16 matches
Mail list logo