Re: [PATCH 4/6] firewire: OHCI-1394 lowlevel driver

Kristian Høgsberg
2007-05-09T23:44:44Z

Christoph Hellwig wrote:
>> + if (pci_enable_device(dev)) {
>> + fw_error("Failed to enable OHCI hardware.\n");
>> + return cleanup(ohci, CLEANUP_PUT_CARD, -ENODEV);
>
> Please use normal goto unwinding so the driver follows the same model
> as almost all other pci drivers and allows people to follow your driver
> more easily. Also it's not a alot of cleanup code, so removing this
> might actually be a net decrease in lines of code.

Sure. The patch I have here says 42 insertions, 44 deletions :)

>> + if (software_reset(ohci)) {
>
> Please give all your function a nice prefix so that oops messages are
> more readable.

I don't see a strong precedence for this for static functions. For example,
if you grep for 'static' in drivers/usb/core, there's a mix of usb_* prefixed
functions and functions without a consistent prefix. Plus, when the drivers
are loaded as modules, the module name will be in the stack trace. I can
track down the most generic sounding functions and give them a fw_ prefix, but
doing a whole-sale prefixing of static functions will make the source more
noisy and reduce readabilty - I'm not sure it's worth it.

cheers,
Kristian