Re: Coccinelle: api: add devm_platform_ioremap_resource script
From: Markus Elfring
Date: Sun Jun 09 2019 - 05:00:44 EST
>>> +- e1 = devm_ioremap_resource(arg4, id);
>>> ++ e1 = devm_platform_ioremap_resource(arg1, arg3);
>>
>> Can the following specification variant matter for the shown SmPL
>> change approach?
>>
>> + e1 =
>> +- devm_ioremap_resource(arg4, id
>> ++ devm_platform_ioremap_resource(arg1, arg3
>> + );
>
> In the latter case, the original formatting of e1 will be preserved.
I would like to point the possibility out to express only required changes
also by SmPL specifications.
> But there is not usually any interesting formatting on the left side of an
> assignment (ie typically no newlines or comments).
Is there any need to trigger additional source code reformatting?
> I can see no purpose to factorizing the right parenthesis.
These characters at the end of such a function call should be kept unchanged.
I got another software development concern according to the discussed
software update âdrivers: provide devm_platform_ioremap_resource()â
(from 2019-02-21).
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/base/platform.c?id=7945f929f1a77a1c8887a97ca07f87626858ff42
The flag âIORESOURCE_MEMâ is passed as the second parameter for the call
of the function âplatform_get_resourceâ in this refactoring.
Should this detail be specified also in the proposed script for the
semantic patch language instead of using the metavariable âarg2â
in SmPL disjunctions?
How do you think about to delete error detection and corresponding
exception handling code for the previous function call?
Is the SmPL code specification âwhen != idâ really sufficient for
the exclusion of variable reassignments here?
Regards,
Markus