On Thu, Oct 09, 2003 at 01:38:22AM -0500, Al Borchers wrote:
> Here is a small patch to bk://kernel.bkbits.net/db/linux/gadget-2.6
> to fix up the "debug defined but not used error message".
Thanks, I've applied it.
> > clean up error paths
>
> Do you mean factoring out common error cleanup and moving
> it to the bottom of the function with a goto? I tend to
> do this only when there is substantial common cleanup code,
> more than just unlocking. But I can do it more aggessively
> if that is what you want.
Yes, it's much better to have one common error patch at the end of the
function. See all of the work the kernel janitors have been doing along
this topic. goto is your friend :)
> > get rid of send_char
>
> As long as the serial layer calls flush_chars after each write
> we can combine write and put_char and remove the gs_send call in
> write. I will check.
Ah, good point.
> > formatting issues
>
> What are the remaining formatting issues? I did change to
> 8 space tabs.
Your odd placement of spaces in lines. For example:
if( dev->dev_config == GS_NO_CONFIG_ID ) {
printk( KERN_ERR
"gs_open: (%d,%p,%p) device is not connected\n",
port_num, tty, file );
spin_unlock_irqrestore( &dev->dev_lock, flags );
up( sem );
return( -ENODEV );
}
Should be:
if (dev->dev_config == GS_NO_CONFIG_ID) {
printk(KERN_ERR
"gs_open: (%d,%p,%p) device is not connected\n",
port_num, tty, file);
spin_unlock_irqrestore(&dev->dev_lock, flags);
up(sem);
return -ENODEV;
}
Also remember that return is not a function...
thanks,
greg k-h
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel