> How would you like to improve the pretty-printing for the Coccinelle software?

I can reproduce this glitch by the combination of test files like the following,
can't you?

@adjustment@
expression result;
@@
 if (...)
-{
-result = -ENODEV;
 goto
-     out_kfree_ioc
+     e_nodev
 ;
-}


static int megasas_mgmt_ioctl_fw(struct file *file, unsigned long arg)
{
        struct megasas_iocpacket __user *user_ioc =
            (struct megasas_iocpacket __user *)arg;
        struct megasas_iocpacket *ioc;
        struct megasas_instance *instance;
        int error;

        ioc = memdup_user(user_ioc, sizeof(*ioc));
        if (IS_ERR(ioc))
                return PTR_ERR(ioc);

        instance = megasas_lookup_instance(ioc->host_no);
        if (!instance) {
                error = -ENODEV;
                goto out_kfree_ioc;
        }

// Deleted part

out_kfree_ioc:
        kfree(ioc);
        return error;
}


I guess that the trailing space character is just a questionable leftover
from the desired deletion of curly brackets according to the affected
compound statement in such an use case.

Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to