On Tue, 31 Jul 2018, Timur Tabi wrote:
> Coccinelle does a pretty good job at compating parameters into fewer
> lines, but it's not always aggressive enough. Is there a tuning
> parameter I can try?
"--max-width", Arg.Set_int Flag_parsing_c.max_width,
" column limit for generated code";
> For example, this is good:
>
> - DBG_PRINTF((
> - DBG_MODULE_GLOBAL, DBG_LEVEL_ERRORS,
> - "NVRM: Failed to allocate object handle in %s\n",
> - __FUNCTION__));
> + NV_PRINTF(LEVEL_ERROR,
> + "Failed to allocate object handle in %s\n",
> + __FUNCTION__);
>
> But here, the call to NV_PRINTF only needs two lines, not three.
> Parameters 1 and 2 can fit on the same line, or parameters 2 and 3 can
> be put on the same line. In this case, it didn't even try:
>
> - DBG_PRINTF((
> - DBG_MODULE_GLOBAL, DBG_LEVEL_ERRORS,
> - "NVRM: Unable to alloc device in %s\n", __FUNCTION__));
> + NV_PRINTF(LEVEL_ERROR,
> + "Unable to alloc device in %s\n",
> + __FUNCTION__);
>
> Here, it compacted a little bit, but it could have done more. This
> could have fit in one line:
>
> - DBG_PRINTF((DBG_MODULE_OS, DEBUGLEVEL_TRACEINFO,
> - "NVGVI: %s(), Null state\n",
> - __FUNCTION__));
> + NV_PRINTF(LEVEL_INFO, "%s(), Null state\n",
> + __FUNCTION__);
In this case, I think it is just leaving __FUNCTION__ where it is.
Please always send a semantic patch and a .c file if you have a concern
about something, even if you have sent them before. Then I can treat the
problems one by one, and don't have to search around in my mailbox for the
relevant information.
thanks,
julia
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci