[CCing the ML this time]

Hi,

just FYI, spatch does not seem to cope with a ? b : c when wrapping
lines. I've just made the following semantic patch to clean-up some MTD
stuff in the linux kernel:

@@
expression mtd, types, parser_data, parts, nr_parts;
@@
(
-mtd_device_parse_register(mtd, 0, parser_data, parts, nr_parts)
+mtd_device_parse_register(mtd, NULL, parser_data, parts, nr_parts)
|
-mtd_device_parse_register(mtd, types, 0, parts, nr_parts)
+mtd_device_parse_register(mtd, types, NULL, parts, nr_parts)
|
-mtd_device_parse_register(mtd, types, parser_data, 0, nr_parts)
+mtd_device_parse_register(mtd, types, parser_data, NULL, nr_parts)
)

to fix gcc complaints about passing plain 0 instead of NULL.

And I got the following result for one of the drivers:

diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index 4a018d0..daf08bd 100644
--- a/drivers/mtd/nand/fsmc_nand.c
+++ b/drivers/mtd/nand/fsmc_nand.c
@@ -940,13 +940,9 @@ static int __init fsmc_nand_probe(struct platform_device 
*pdev)
         * Check for partition info passed
         */
        host->mtd.name = "nand";
-       ret = mtd_device_parse_register(&host->mtd, NULL, 0,
-                       host->mtd.size <= 0x04000000 ?
-                               partition_info_16KB_blk :
-                               partition_info_128KB_blk,
-                       host->mtd.size <= 0x04000000 ?
-                               ARRAY_SIZE(partition_info_16KB_blk) :
-                               ARRAY_SIZE(partition_info_128KB_blk));
+       ret = mtd_device_parse_register(&host->mtd, NULL, NULL,
+                                       host->mtd.size <= 0x04000000 ? 
partition_info_16KB_blk : partition_info_128KB_blk,
+                                       host->mtd.size <= 0x04000000 ? 
ARRAY_SIZE(partition_info_16KB_blk) : ARRAY_SIZE(partition_info_128KB_blk));
        if (ret)
                goto err_probe;


and checkpatch.pl now complains:

WARNING:LONG_LINE: line over 80 characters
#422: FILE: drivers/mtd/nand/fsmc_nand.c:717:
+                                       host->mtd.size <= 0x04000000 ? 
partition_info_16KB_blk : partition_info_128KB_blk,

Not big deal, but I just wonted it is a good idea to report.

-- 
Best Regards,
Artem Bityutskiy


_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to