linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: cros_ec: remove unused __remove function
@ 2018-06-08 14:48 Arnd Bergmann
  2018-06-08 18:19 ` Benson Leung
  0 siblings, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2018-06-08 14:48 UTC (permalink / raw)
  To: Lee Jones
  Cc: Arnd Bergmann, Enric Balletbo i Serra, Benson Leung,
	Gwendal Grignou, Andy Shevchenko, linux-kernel

This function is no longer called, so we get a harmless
warning until it is removed as well:

drivers/mfd/cros_ec_dev.c:265:13: error: '__remove' defined but not used [-Werror=unused-function]

Fixes: 3aa2177e4787 ("mfd: cros_ec: Use devm_kzalloc for private data")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/mfd/cros_ec_dev.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c
index dfc9f131aabe..4199cdd4ff89 100644
--- a/drivers/mfd/cros_ec_dev.c
+++ b/drivers/mfd/cros_ec_dev.c
@@ -262,8 +262,6 @@ static const struct file_operations fops = {
 #endif
 };
 
-static void __remove(struct device *dev) { }
-
 static void cros_ec_sensors_register(struct cros_ec_dev *ec)
 {
 	/*
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] mfd: cros_ec: remove unused __remove function
  2018-06-08 14:48 [PATCH] mfd: cros_ec: remove unused __remove function Arnd Bergmann
@ 2018-06-08 18:19 ` Benson Leung
  2018-06-11  6:08   ` Lee Jones
  0 siblings, 1 reply; 6+ messages in thread
From: Benson Leung @ 2018-06-08 18:19 UTC (permalink / raw)
  To: Arnd Bergmann, Gwendal Grignou
  Cc: Lee Jones, Enric Balletbo i Serra, Benson Leung, Gwendal Grignou,
	Andy Shevchenko, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 692 bytes --]


On Fri, Jun 08, 2018 at 04:48:06PM +0200, Arnd Bergmann wrote:
> This function is no longer called, so we get a harmless
> warning until it is removed as well:
> 
> drivers/mfd/cros_ec_dev.c:265:13: error: '__remove' defined but not used [-Werror=unused-function]
> 
> Fixes: 3aa2177e4787 ("mfd: cros_ec: Use devm_kzalloc for private data")

Gwendal, in PATCH v2 of https://patchwork.kernel.org/patch/10439449/
you mentioned that you readded the __remove to avoid a warning when built
as a module. Can you explain what's going on?

Benson

-- 
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
bleung@google.com
Chromium OS Project
bleung@chromium.org

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mfd: cros_ec: remove unused __remove function
  2018-06-08 18:19 ` Benson Leung
@ 2018-06-11  6:08   ` Lee Jones
  2018-06-12 19:53     ` Gwendal Grignou
  0 siblings, 1 reply; 6+ messages in thread
From: Lee Jones @ 2018-06-11  6:08 UTC (permalink / raw)
  To: Benson Leung
  Cc: Arnd Bergmann, Gwendal Grignou, Enric Balletbo i Serra,
	Benson Leung, Andy Shevchenko, linux-kernel

On Fri, 08 Jun 2018, Benson Leung wrote:

> 
> On Fri, Jun 08, 2018 at 04:48:06PM +0200, Arnd Bergmann wrote:
> > This function is no longer called, so we get a harmless
> > warning until it is removed as well:
> > 
> > drivers/mfd/cros_ec_dev.c:265:13: error: '__remove' defined but not used [-Werror=unused-function]
> > 
> > Fixes: 3aa2177e4787 ("mfd: cros_ec: Use devm_kzalloc for private data")
> 
> Gwendal, in PATCH v2 of https://patchwork.kernel.org/patch/10439449/
> you mentioned that you readded the __remove to avoid a warning when built
> as a module. Can you explain what's going on?

Yes please, and quickly.  I'm going to sent the patch-set today.  If I
don't hear from you promptly, I'll probably pull the patch!

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mfd: cros_ec: remove unused __remove function
  2018-06-11  6:08   ` Lee Jones
@ 2018-06-12 19:53     ` Gwendal Grignou
  2018-06-13  5:45       ` Lee Jones
  2018-06-14 10:35       ` Arnd Bergmann
  0 siblings, 2 replies; 6+ messages in thread
From: Gwendal Grignou @ 2018-06-12 19:53 UTC (permalink / raw)
  To: Lee Jones
  Cc: Benson Leung, Arnd Bergmann, Gwendal Grignou,
	Enric Balletbo i Serra, Benson Leung, Andy Shevchenko,
	Linux Kernel

On Sun, Jun 10, 2018 at 11:08 PM Lee Jones <lee.jones@linaro.org> wrote:
>
> On Fri, 08 Jun 2018, Benson Leung wrote:
>
> >
> > On Fri, Jun 08, 2018 at 04:48:06PM +0200, Arnd Bergmann wrote:
> > > This function is no longer called, so we get a harmless
> > > warning until it is removed as well:
> > >
> > > drivers/mfd/cros_ec_dev.c:265:13: error: '__remove' defined but not used [-Werror=unused-function]
> > >
> > > Fixes: 3aa2177e4787 ("mfd: cros_ec: Use devm_kzalloc for private data")
> >
> > Gwendal, in PATCH v2 of https://patchwork.kernel.org/patch/10439449/
> > you mentioned that you readded the __remove to avoid a warning when built
> > as a module. Can you explain what's going on?
>
> Yes please, and quickly.  I'm going to sent the patch-set today.  If I
> don't hear from you promptly, I'll probably pull the patch!
I readded it because when cros_ec_dev is loaded as module, I get a
warning on dmesg when unloading:

"""Device 'cros_pd' [or 'cros_ec'] does not have a release() function,
it is broken and must be fixed."""

The warning comes from device_release(). Given I get a warning when I
remove the release function or when I leave it empty. Let's pull the
patch.

Sorry for the confusion,

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mfd: cros_ec: remove unused __remove function
  2018-06-12 19:53     ` Gwendal Grignou
@ 2018-06-13  5:45       ` Lee Jones
  2018-06-14 10:35       ` Arnd Bergmann
  1 sibling, 0 replies; 6+ messages in thread
From: Lee Jones @ 2018-06-13  5:45 UTC (permalink / raw)
  To: Gwendal Grignou
  Cc: Benson Leung, Arnd Bergmann, Enric Balletbo i Serra,
	Benson Leung, Andy Shevchenko, Linux Kernel

On Tue, 12 Jun 2018, Gwendal Grignou wrote:

> On Sun, Jun 10, 2018 at 11:08 PM Lee Jones <lee.jones@linaro.org> wrote:
> >
> > On Fri, 08 Jun 2018, Benson Leung wrote:
> >
> > >
> > > On Fri, Jun 08, 2018 at 04:48:06PM +0200, Arnd Bergmann wrote:
> > > > This function is no longer called, so we get a harmless
> > > > warning until it is removed as well:
> > > >
> > > > drivers/mfd/cros_ec_dev.c:265:13: error: '__remove' defined but not used [-Werror=unused-function]
> > > >
> > > > Fixes: 3aa2177e4787 ("mfd: cros_ec: Use devm_kzalloc for private data")
> > >
> > > Gwendal, in PATCH v2 of https://patchwork.kernel.org/patch/10439449/
> > > you mentioned that you readded the __remove to avoid a warning when built
> > > as a module. Can you explain what's going on?
> >
> > Yes please, and quickly.  I'm going to sent the patch-set today.  If I
> > don't hear from you promptly, I'll probably pull the patch!
> I readded it because when cros_ec_dev is loaded as module, I get a
> warning on dmesg when unloading:
> 
> """Device 'cros_pd' [or 'cros_ec'] does not have a release() function,
> it is broken and must be fixed."""
> 
> The warning comes from device_release(). Given I get a warning when I
> remove the release function or when I leave it empty. Let's pull the
> patch.

I already did.  It's in Mainline. :)

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mfd: cros_ec: remove unused __remove function
  2018-06-12 19:53     ` Gwendal Grignou
  2018-06-13  5:45       ` Lee Jones
@ 2018-06-14 10:35       ` Arnd Bergmann
  1 sibling, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2018-06-14 10:35 UTC (permalink / raw)
  To: Gwendal Grignou
  Cc: Lee Jones, Benson Leung, Enric Balletbo i Serra, Benson Leung,
	Andy Shevchenko, Linux Kernel

On Tue, Jun 12, 2018 at 9:53 PM, Gwendal Grignou <gwendal@chromium.org> wrote:
> On Sun, Jun 10, 2018 at 11:08 PM Lee Jones <lee.jones@linaro.org> wrote:
>>
>> On Fri, 08 Jun 2018, Benson Leung wrote:
>>
>> >
>> > On Fri, Jun 08, 2018 at 04:48:06PM +0200, Arnd Bergmann wrote:
>> > > This function is no longer called, so we get a harmless
>> > > warning until it is removed as well:
>> > >
>> > > drivers/mfd/cros_ec_dev.c:265:13: error: '__remove' defined but not used [-Werror=unused-function]
>> > >
>> > > Fixes: 3aa2177e4787 ("mfd: cros_ec: Use devm_kzalloc for private data")
>> >
>> > Gwendal, in PATCH v2 of https://patchwork.kernel.org/patch/10439449/
>> > you mentioned that you readded the __remove to avoid a warning when built
>> > as a module. Can you explain what's going on?
>>
>> Yes please, and quickly.  I'm going to sent the patch-set today.  If I
>> don't hear from you promptly, I'll probably pull the patch!
> I readded it because when cros_ec_dev is loaded as module, I get a
> warning on dmesg when unloading:
>
> """Device 'cros_pd' [or 'cros_ec'] does not have a release() function,
> it is broken and must be fixed."""
>
> The warning comes from device_release(). Given I get a warning when I
> remove the release function or when I leave it empty. Let's pull the
> patch.

I had not realized that this function was supposed to be the .release
callback for a device, only that it was not being called at all.

The runtime warning you get is obviously correct and you do need a
.release function in the device that will free the memory for the
cros_ec_dev structure when the last reference to the device goes away.

Please send a fix for this, replacing the incorrect devm_kzalloc with
a working allocation/deallocation.

     Arnd

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-06-14 10:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-08 14:48 [PATCH] mfd: cros_ec: remove unused __remove function Arnd Bergmann
2018-06-08 18:19 ` Benson Leung
2018-06-11  6:08   ` Lee Jones
2018-06-12 19:53     ` Gwendal Grignou
2018-06-13  5:45       ` Lee Jones
2018-06-14 10:35       ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).