Re: [V2 PATCH 01/10] added media agnostic (MA) USB HCD driver

From: Greg KH
Date: Mon Nov 10 2014 - 23:10:22 EST


On Mon, Nov 10, 2014 at 06:09:32PM -0800, Stephanie Wallick wrote:
> +static int mausb_bus_probe(struct device *dev)
> +{
> + return mausb_probe(dev);
> +}
> +
> +static int mausb_bus_remove(struct device *dev)
> +{
> + return mausb_remove(dev);
> +}

Wrapper functions that just call another function? Why?

> +static void mausb_dev_release(struct device *dev)
> +{
> + /* TODO: if we dynamically allocate anything, free it here */
> +}

As per the documentation in the kernel source tree[1], I am now allowed
to mock you mercilessly for thinking that you know more than the kernel,
and are just providing an "empty" function just to shut it up from
complaining about no release function at all. Did you stop to think
about _why_ the kernel was warning you about this, and how would an
empty function solve anything?

Sorry, I can never accept code that does this in the kernel, even in
staging, which says a lot...

thanks,

greg k-h

[1] Documentation/kobject.txt, line 270
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/