linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/2] Input: matrix_keypad - add missed header inclusion
@ 2022-09-23 18:46 Andy Shevchenko
  2022-09-23 18:46 ` [PATCH v1 2/2] Input: matrix_keypad - replace header inclusions by forward declarations Andy Shevchenko
  2022-09-23 19:01 ` [PATCH v1 1/2] Input: matrix_keypad - add missed header inclusion Dmitry Torokhov
  0 siblings, 2 replies; 11+ messages in thread
From: Andy Shevchenko @ 2022-09-23 18:46 UTC (permalink / raw)
  To: Andy Shevchenko, linux-input, linux-kernel; +Cc: Dmitry Torokhov

The gpiod_count() API is defined in gpio/consumer.h. Include it.

Fixes: f8f7f47d576f ("Input: matrix_keypad - replace of_gpio_named_count() by gpiod_count()")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/input/keyboard/matrix_keypad.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c
index 63f078f2bc4a..7dd3f3eda834 100644
--- a/drivers/input/keyboard/matrix_keypad.c
+++ b/drivers/input/keyboard/matrix_keypad.c
@@ -9,6 +9,7 @@
 
 #include <linux/types.h>
 #include <linux/delay.h>
+#include <linux/gpio/consumer.h>
 #include <linux/platform_device.h>
 #include <linux/input.h>
 #include <linux/irq.h>
-- 
2.35.1


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

* [PATCH v1 2/2] Input: matrix_keypad - replace header inclusions by forward declarations
  2022-09-23 18:46 [PATCH v1 1/2] Input: matrix_keypad - add missed header inclusion Andy Shevchenko
@ 2022-09-23 18:46 ` Andy Shevchenko
  2022-09-23 19:03   ` Dmitry Torokhov
  2022-10-29 14:25   ` Guenter Roeck
  2022-09-23 19:01 ` [PATCH v1 1/2] Input: matrix_keypad - add missed header inclusion Dmitry Torokhov
  1 sibling, 2 replies; 11+ messages in thread
From: Andy Shevchenko @ 2022-09-23 18:46 UTC (permalink / raw)
  To: Andy Shevchenko, linux-input, linux-kernel; +Cc: Dmitry Torokhov

When the data structure is only referred by pointer, compiler may not need
to see the contents of the data type. Thus, we may replace header inclusions
by respective forward declarations.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/input/matrix_keypad.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h
index 9476768c3b90..b8d8d69eba29 100644
--- a/include/linux/input/matrix_keypad.h
+++ b/include/linux/input/matrix_keypad.h
@@ -3,8 +3,9 @@
 #define _MATRIX_KEYPAD_H
 
 #include <linux/types.h>
-#include <linux/input.h>
-#include <linux/of.h>
+
+struct device;
+struct input_dev;
 
 #define MATRIX_MAX_ROWS		32
 #define MATRIX_MAX_COLS		32
-- 
2.35.1


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

* Re: [PATCH v1 1/2] Input: matrix_keypad - add missed header inclusion
  2022-09-23 18:46 [PATCH v1 1/2] Input: matrix_keypad - add missed header inclusion Andy Shevchenko
  2022-09-23 18:46 ` [PATCH v1 2/2] Input: matrix_keypad - replace header inclusions by forward declarations Andy Shevchenko
@ 2022-09-23 19:01 ` Dmitry Torokhov
  1 sibling, 0 replies; 11+ messages in thread
From: Dmitry Torokhov @ 2022-09-23 19:01 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-input, linux-kernel

On Fri, Sep 23, 2022 at 09:46:31PM +0300, Andy Shevchenko wrote:
> The gpiod_count() API is defined in gpio/consumer.h. Include it.
> 
> Fixes: f8f7f47d576f ("Input: matrix_keypad - replace of_gpio_named_count() by gpiod_count()")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Applied, thank you.

-- 
Dmitry

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

* Re: [PATCH v1 2/2] Input: matrix_keypad - replace header inclusions by forward declarations
  2022-09-23 18:46 ` [PATCH v1 2/2] Input: matrix_keypad - replace header inclusions by forward declarations Andy Shevchenko
@ 2022-09-23 19:03   ` Dmitry Torokhov
  2022-09-26 10:56     ` Andy Shevchenko
  2022-10-29 14:25   ` Guenter Roeck
  1 sibling, 1 reply; 11+ messages in thread
From: Dmitry Torokhov @ 2022-09-23 19:03 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-input, linux-kernel

On Fri, Sep 23, 2022 at 09:46:32PM +0300, Andy Shevchenko wrote:
> When the data structure is only referred by pointer, compiler may not need
> to see the contents of the data type. Thus, we may replace header inclusions
> by respective forward declarations.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  include/linux/input/matrix_keypad.h | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h
> index 9476768c3b90..b8d8d69eba29 100644
> --- a/include/linux/input/matrix_keypad.h
> +++ b/include/linux/input/matrix_keypad.h
> @@ -3,8 +3,9 @@
>  #define _MATRIX_KEYPAD_H
>  
>  #include <linux/types.h>
> -#include <linux/input.h>
> -#include <linux/of.h>
> +
> +struct device;
> +struct input_dev;

This results in a ton of compile errors. While I believe this change is
a good one, we need to fix users of this include first.

Thanks.

-- 
Dmitry

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

* Re: [PATCH v1 2/2] Input: matrix_keypad - replace header inclusions by forward declarations
  2022-09-23 19:03   ` Dmitry Torokhov
@ 2022-09-26 10:56     ` Andy Shevchenko
  2022-09-26 10:56       ` Andy Shevchenko
  0 siblings, 1 reply; 11+ messages in thread
From: Andy Shevchenko @ 2022-09-26 10:56 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel

On Fri, Sep 23, 2022 at 12:03:00PM -0700, Dmitry Torokhov wrote:
> On Fri, Sep 23, 2022 at 09:46:32PM +0300, Andy Shevchenko wrote:
> > When the data structure is only referred by pointer, compiler may not need
> > to see the contents of the data type. Thus, we may replace header inclusions
> > by respective forward declarations.

...

> > +struct device;
> > +struct input_dev;
> 
> This results in a ton of compile errors. While I believe this change is
> a good one, we need to fix users of this include first.

Indeed, sorry for breaking things (I compile-tested with limited drivers
enabled). I will look into LKP reports and will fix the users.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1 2/2] Input: matrix_keypad - replace header inclusions by forward declarations
  2022-09-26 10:56     ` Andy Shevchenko
@ 2022-09-26 10:56       ` Andy Shevchenko
  0 siblings, 0 replies; 11+ messages in thread
From: Andy Shevchenko @ 2022-09-26 10:56 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel

On Mon, Sep 26, 2022 at 01:56:27PM +0300, Andy Shevchenko wrote:
> On Fri, Sep 23, 2022 at 12:03:00PM -0700, Dmitry Torokhov wrote:
> > On Fri, Sep 23, 2022 at 09:46:32PM +0300, Andy Shevchenko wrote:
> > > When the data structure is only referred by pointer, compiler may not need
> > > to see the contents of the data type. Thus, we may replace header inclusions
> > > by respective forward declarations.

...

> > > +struct device;
> > > +struct input_dev;
> > 
> > This results in a ton of compile errors. While I believe this change is
> > a good one, we need to fix users of this include first.
> 
> Indeed, sorry for breaking things (I compile-tested with limited drivers
> enabled). I will look into LKP reports and will fix the users.

Ah, thanks, I see your series for that!

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1 2/2] Input: matrix_keypad - replace header inclusions by forward declarations
  2022-09-23 18:46 ` [PATCH v1 2/2] Input: matrix_keypad - replace header inclusions by forward declarations Andy Shevchenko
  2022-09-23 19:03   ` Dmitry Torokhov
@ 2022-10-29 14:25   ` Guenter Roeck
  2022-10-29 22:28     ` Dmitry Torokhov
  1 sibling, 1 reply; 11+ messages in thread
From: Guenter Roeck @ 2022-10-29 14:25 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-input, linux-kernel, Dmitry Torokhov

On Fri, Sep 23, 2022 at 09:46:32PM +0300, Andy Shevchenko wrote:
> When the data structure is only referred by pointer, compiler may not need
> to see the contents of the data type. Thus, we may replace header inclusions
> by respective forward declarations.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  include/linux/input/matrix_keypad.h | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h
> index 9476768c3b90..b8d8d69eba29 100644
> --- a/include/linux/input/matrix_keypad.h
> +++ b/include/linux/input/matrix_keypad.h
> @@ -3,8 +3,9 @@
>  #define _MATRIX_KEYPAD_H
>  
>  #include <linux/types.h>
> -#include <linux/input.h>

Possibly, but may other drivers rely on those includes.
This results in widespread build failures such as

Building arm:allmodconfig ... failed
--------------
Error log:
In file included from include/linux/input/samsung-keypad.h:12,
                 from arch/arm/mach-s3c/keypad.h:12,
                 from arch/arm/mach-s3c/mach-crag6410.c:57:
arch/arm/mach-s3c/mach-crag6410.c:183:19: error: 'KEY_VOLUMEUP' undeclared here

Guenter

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

* Re: [PATCH v1 2/2] Input: matrix_keypad - replace header inclusions by forward declarations
  2022-10-29 14:25   ` Guenter Roeck
@ 2022-10-29 22:28     ` Dmitry Torokhov
  2022-10-29 23:02       ` Guenter Roeck
  0 siblings, 1 reply; 11+ messages in thread
From: Dmitry Torokhov @ 2022-10-29 22:28 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Andy Shevchenko, linux-input, linux-kernel

On Sat, Oct 29, 2022 at 07:25:51AM -0700, Guenter Roeck wrote:
> On Fri, Sep 23, 2022 at 09:46:32PM +0300, Andy Shevchenko wrote:
> > When the data structure is only referred by pointer, compiler may not need
> > to see the contents of the data type. Thus, we may replace header inclusions
> > by respective forward declarations.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> >  include/linux/input/matrix_keypad.h | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h
> > index 9476768c3b90..b8d8d69eba29 100644
> > --- a/include/linux/input/matrix_keypad.h
> > +++ b/include/linux/input/matrix_keypad.h
> > @@ -3,8 +3,9 @@
> >  #define _MATRIX_KEYPAD_H
> >  
> >  #include <linux/types.h>
> > -#include <linux/input.h>
> 
> Possibly, but may other drivers rely on those includes.
> This results in widespread build failures such as
> 
> Building arm:allmodconfig ... failed
> --------------
> Error log:
> In file included from include/linux/input/samsung-keypad.h:12,
>                  from arch/arm/mach-s3c/keypad.h:12,
>                  from arch/arm/mach-s3c/mach-crag6410.c:57:
> arch/arm/mach-s3c/mach-crag6410.c:183:19: error: 'KEY_VOLUMEUP' undeclared here

I fixed this particular instance, hopefully it is one of the very
last of them...

-- 
Dmitry

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

* Re: [PATCH v1 2/2] Input: matrix_keypad - replace header inclusions by forward declarations
  2022-10-29 22:28     ` Dmitry Torokhov
@ 2022-10-29 23:02       ` Guenter Roeck
  2022-10-30  4:33         ` Dmitry Torokhov
  0 siblings, 1 reply; 11+ messages in thread
From: Guenter Roeck @ 2022-10-29 23:02 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Andy Shevchenko, linux-input, linux-kernel

On 10/29/22 15:28, Dmitry Torokhov wrote:
> On Sat, Oct 29, 2022 at 07:25:51AM -0700, Guenter Roeck wrote:
>> On Fri, Sep 23, 2022 at 09:46:32PM +0300, Andy Shevchenko wrote:
>>> When the data structure is only referred by pointer, compiler may not need
>>> to see the contents of the data type. Thus, we may replace header inclusions
>>> by respective forward declarations.
>>>
>>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>>> ---
>>>   include/linux/input/matrix_keypad.h | 5 +++--
>>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h
>>> index 9476768c3b90..b8d8d69eba29 100644
>>> --- a/include/linux/input/matrix_keypad.h
>>> +++ b/include/linux/input/matrix_keypad.h
>>> @@ -3,8 +3,9 @@
>>>   #define _MATRIX_KEYPAD_H
>>>   
>>>   #include <linux/types.h>
>>> -#include <linux/input.h>
>>
>> Possibly, but may other drivers rely on those includes.
>> This results in widespread build failures such as
>>
>> Building arm:allmodconfig ... failed
>> --------------
>> Error log:
>> In file included from include/linux/input/samsung-keypad.h:12,
>>                   from arch/arm/mach-s3c/keypad.h:12,
>>                   from arch/arm/mach-s3c/mach-crag6410.c:57:
>> arch/arm/mach-s3c/mach-crag6410.c:183:19: error: 'KEY_VOLUMEUP' undeclared here
> 
> I fixed this particular instance, hopefully it is one of the very
> last of them...
> 

Sorry, I didn't bother listing all of them. There is at least one more.

Error log:
arch/arm/mach-pxa/spitz.c:410:11: error: 'EV_PWR' undeclared here (not in a function)
   410 |   .type = EV_PWR,
       |           ^~~~~~

with arm:pxa_defconfig.

Guenter


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

* Re: [PATCH v1 2/2] Input: matrix_keypad - replace header inclusions by forward declarations
  2022-10-29 23:02       ` Guenter Roeck
@ 2022-10-30  4:33         ` Dmitry Torokhov
  2022-10-30  4:55           ` Guenter Roeck
  0 siblings, 1 reply; 11+ messages in thread
From: Dmitry Torokhov @ 2022-10-30  4:33 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Andy Shevchenko, linux-input, linux-kernel

On Sat, Oct 29, 2022 at 04:02:56PM -0700, Guenter Roeck wrote:
> On 10/29/22 15:28, Dmitry Torokhov wrote:
> > On Sat, Oct 29, 2022 at 07:25:51AM -0700, Guenter Roeck wrote:
> > > On Fri, Sep 23, 2022 at 09:46:32PM +0300, Andy Shevchenko wrote:
> > > > When the data structure is only referred by pointer, compiler may not need
> > > > to see the contents of the data type. Thus, we may replace header inclusions
> > > > by respective forward declarations.
> > > > 
> > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > > ---
> > > >   include/linux/input/matrix_keypad.h | 5 +++--
> > > >   1 file changed, 3 insertions(+), 2 deletions(-)
> > > > 
> > > > diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h
> > > > index 9476768c3b90..b8d8d69eba29 100644
> > > > --- a/include/linux/input/matrix_keypad.h
> > > > +++ b/include/linux/input/matrix_keypad.h
> > > > @@ -3,8 +3,9 @@
> > > >   #define _MATRIX_KEYPAD_H
> > > >   #include <linux/types.h>
> > > > -#include <linux/input.h>
> > > 
> > > Possibly, but may other drivers rely on those includes.
> > > This results in widespread build failures such as
> > > 
> > > Building arm:allmodconfig ... failed
> > > --------------
> > > Error log:
> > > In file included from include/linux/input/samsung-keypad.h:12,
> > >                   from arch/arm/mach-s3c/keypad.h:12,
> > >                   from arch/arm/mach-s3c/mach-crag6410.c:57:
> > > arch/arm/mach-s3c/mach-crag6410.c:183:19: error: 'KEY_VOLUMEUP' undeclared here
> > 
> > I fixed this particular instance, hopefully it is one of the very
> > last of them...
> > 
> 
> Sorry, I didn't bother listing all of them. There is at least one more.
> 
> Error log:
> arch/arm/mach-pxa/spitz.c:410:11: error: 'EV_PWR' undeclared here (not in a function)
>   410 |   .type = EV_PWR,
>       |           ^~~~~~
> 
> with arm:pxa_defconfig.

Ah, I see. Arnd is trying to delete bunch of PXA code, so I'll pull the
header change until after he merges his, and hopefully spitz will be
gone.

Do you have more examples by chance?

Thanks.

-- 
Dmitry

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

* Re: [PATCH v1 2/2] Input: matrix_keypad - replace header inclusions by forward declarations
  2022-10-30  4:33         ` Dmitry Torokhov
@ 2022-10-30  4:55           ` Guenter Roeck
  0 siblings, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2022-10-30  4:55 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Andy Shevchenko, linux-input, linux-kernel

On 10/29/22 21:33, Dmitry Torokhov wrote:
> On Sat, Oct 29, 2022 at 04:02:56PM -0700, Guenter Roeck wrote:
>> On 10/29/22 15:28, Dmitry Torokhov wrote:
>>> On Sat, Oct 29, 2022 at 07:25:51AM -0700, Guenter Roeck wrote:
>>>> On Fri, Sep 23, 2022 at 09:46:32PM +0300, Andy Shevchenko wrote:
>>>>> When the data structure is only referred by pointer, compiler may not need
>>>>> to see the contents of the data type. Thus, we may replace header inclusions
>>>>> by respective forward declarations.
>>>>>
>>>>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>>>>> ---
>>>>>    include/linux/input/matrix_keypad.h | 5 +++--
>>>>>    1 file changed, 3 insertions(+), 2 deletions(-)
>>>>>
>>>>> diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h
>>>>> index 9476768c3b90..b8d8d69eba29 100644
>>>>> --- a/include/linux/input/matrix_keypad.h
>>>>> +++ b/include/linux/input/matrix_keypad.h
>>>>> @@ -3,8 +3,9 @@
>>>>>    #define _MATRIX_KEYPAD_H
>>>>>    #include <linux/types.h>
>>>>> -#include <linux/input.h>
>>>>
>>>> Possibly, but may other drivers rely on those includes.
>>>> This results in widespread build failures such as
>>>>
>>>> Building arm:allmodconfig ... failed
>>>> --------------
>>>> Error log:
>>>> In file included from include/linux/input/samsung-keypad.h:12,
>>>>                    from arch/arm/mach-s3c/keypad.h:12,
>>>>                    from arch/arm/mach-s3c/mach-crag6410.c:57:
>>>> arch/arm/mach-s3c/mach-crag6410.c:183:19: error: 'KEY_VOLUMEUP' undeclared here
>>>
>>> I fixed this particular instance, hopefully it is one of the very
>>> last of them...
>>>
>>
>> Sorry, I didn't bother listing all of them. There is at least one more.
>>
>> Error log:
>> arch/arm/mach-pxa/spitz.c:410:11: error: 'EV_PWR' undeclared here (not in a function)
>>    410 |   .type = EV_PWR,
>>        |           ^~~~~~
>>
>> with arm:pxa_defconfig.
> 
> Ah, I see. Arnd is trying to delete bunch of PXA code, so I'll pull the
> header change until after he merges his, and hopefully spitz will be
> gone.
> 
> Do you have more examples by chance?
> 

No, but no guarantees - there are various other build failures in -next,
and I may have missed some.

Guenter


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

end of thread, other threads:[~2022-10-30  4:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-23 18:46 [PATCH v1 1/2] Input: matrix_keypad - add missed header inclusion Andy Shevchenko
2022-09-23 18:46 ` [PATCH v1 2/2] Input: matrix_keypad - replace header inclusions by forward declarations Andy Shevchenko
2022-09-23 19:03   ` Dmitry Torokhov
2022-09-26 10:56     ` Andy Shevchenko
2022-09-26 10:56       ` Andy Shevchenko
2022-10-29 14:25   ` Guenter Roeck
2022-10-29 22:28     ` Dmitry Torokhov
2022-10-29 23:02       ` Guenter Roeck
2022-10-30  4:33         ` Dmitry Torokhov
2022-10-30  4:55           ` Guenter Roeck
2022-09-23 19:01 ` [PATCH v1 1/2] Input: matrix_keypad - add missed header inclusion Dmitry Torokhov

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).