2 // note that need -sgrep options otherwise don't detect
3 // every situation as for instance:
5 // static int start_command_port(struct usb_serial *serial)
7 // spin_lock_irqsave(&command_info->lock, flags);
8 // if (!command_info->port_running) {
9 // retval = usb_submit_urb(command_port->read_urb, GFP_KERNEL);
11 // err("%s - failed submitting read urb, error %d", __FUNCTION__, retval);
15 // command_info->port_running++;
18 // spin_unlock_irqrestore(&command_info->lock, flags);
22 // note that better to send a .sgrep than a .cocci, that is
23 // to not do the fix because sometimes the correct fix is not to replace
24 // the use of GFP_KERNEL but instead to move the function call outside
25 // the spin_locked region.
33 spin_lock_irqsave(...)
37 ... when != \(spin_unlock_irqrestore(...)\|spin_unlock(...)\)
38 //- usb_submit_urb(E, GFP_KERNEL)