Re: [Cocci] [PATCH net-next v1] can: ti_hecc: convert to devm_platform_ioremap_resource_byname()

2020-04-20 Thread Dejin Zheng
On Sun, Apr 19, 2020 at 06:19:12PM +0200, Markus Elfring wrote: > > use devm_platform_ioremap_resource_byname() to simplify code, > > it contains platform_get_resource_byname() and > > devm_ioremap_resource(), and also remove some duplicate error > > message. > > How do you think about a wording

Re: [Cocci] Function-like macro with the same name as a typedef

2020-04-20 Thread Markus Armbruster
Markus Elfring writes: * spatch seems to have trouble parsing ARMSSE *s = ARMSSE(opaque); where ARMSSE is a typedef, and ARMSSE() is a function-like macro. Yes, I know that's in rather poor taste. >>> >>> I am curious for the safe handling of related

Re: [Cocci] Function-like macro with the same name as a typedef

2020-04-20 Thread Markus Armbruster
Markus Elfring writes: >> * spatch seems to have trouble parsing >> >> ARMSSE *s = ARMSSE(opaque); >> >> where ARMSSE is a typedef, and ARMSSE() is a function-like macro. >> Yes, I know that's in rather poor taste. > > I am curious for the safe handling of related software development

Re: [Cocci] Function-like macro with the same name as a typedef

2020-04-20 Thread Markus Armbruster
Markus Elfring writes: >>> * How many software implementations use identical type definitions >>> and function-like macros? >> >> I don't know. > > Can it become interesting to find more about such usage patterns out? Rule of thumb: for every user reporting an issue, there are several more

Re: [Cocci] Checking the replacement of two specific function calls

2020-04-20 Thread Markus Elfring
> Another possibility should be taken into account for source code variations. > > SmPL script example: > @replacement@ > expression base, device1, device2, index, private; > @@ > -private->res = platform_get_resource(device1, IORESOURCE_MEM, index); > base = > - devm_ioremap_resource > +

Re: [Cocci] Function-like macro with the same name as a typedef

2020-04-20 Thread Markus Elfring
>> * How many software implementations use identical type definitions >> and function-like macros? > > I don't know. Can it become interesting to find more about such usage patterns out? > For what it's worth, it's valid C. Unless I'm mistaken, > Coccinelle tries to support as much of C as

Re: [Cocci] Function-like macro with the same name as a typedef

2020-04-20 Thread Markus Elfring
>>> * spatch seems to have trouble parsing >>> >>> ARMSSE *s = ARMSSE(opaque); >>> >>> where ARMSSE is a typedef, and ARMSSE() is a function-like macro. >>> Yes, I know that's in rather poor taste. >> >> I am curious for the safe handling of related software development >> challenges. >>