lkml.org 
[lkml]   [2018]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] cros_ec: Use devm_kzalloc for private data
On Wed, 30 May 2018, Gwendal Grignou wrote:

> Use dev_kzmalloc, remove .release entry point.
>
> Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
> ---
> Change sinc v1:
> - Readd __remove to avoid a warning when loaded as a module.
>
> drivers/mfd/cros_ec_dev.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c
> index 1d6dc5c7a19d..81466264f7fc 100644
> --- a/drivers/mfd/cros_ec_dev.c
> +++ b/drivers/mfd/cros_ec_dev.c
> @@ -262,12 +262,7 @@ static const struct file_operations fops = {
> #endif
> };
>
> -static void __remove(struct device *dev)
> -{
> - struct cros_ec_dev *ec = container_of(dev, struct cros_ec_dev,
> - class_dev);
> - kfree(ec);
> -}
> +static void __remove(struct device *dev) { }

I missed this line when reviewing.

Why are you keeping the function around?

As a result, we now suffer with a build warning:

drivers/mfd/cros_ec_dev.c:265:13: warning: '__remove' defined but not used [-Wunused-function]
static void __remove(struct device *dev) { }

Can I just remove the line? What are the ramifications of doing so?

Please reply swiftly, so resolve this issue in good time.

--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

\
 
 \ /
  Last update: 2018-06-05 08:59    [W:0.081 / U:20.232 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site