linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* gpio-keys-polled improvements
@ 2019-04-16 19:57 Enrico Weigelt, metux IT consult
  2019-04-16 19:57 ` [PATCH 1/4] mod_devicetable: helper macro for declaring oftree module device table Enrico Weigelt, metux IT consult
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-04-16 19:57 UTC (permalink / raw)
  To: linux-kernel; +Cc: dmitry.torokhov, linux-input

Hello folks,


here're some improvements for the gpio-keys-polled driver.

The first patch isn't in the driver itself, but adds a little module helper
for conditionally declaring oftree module table if oftree is enabled
(only needed for the last patch)


have fun.

--mtx


^ permalink raw reply	[flat|nested] 13+ messages in thread
* RFC: declaring DT match tables (2nd take)
@ 2019-06-01 13:52 Enrico Weigelt, metux IT consult
  2019-06-01 13:52 ` [PATCH 1/4] mod_devicetable: helper macro for declaring oftree module device table Enrico Weigelt, metux IT consult
  0 siblings, 1 reply; 13+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-01 13:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: vireshk, b.zolnierkie, axboe, herbert, davem, linux-ide,
	linux-block, linux-crypto

Hi folks,


few days ago I've posted a RFC for getting rid of many #ifdef CONFIG_OF
cases by using a macro that checks for it on its own.
(see: "RFC: get rid of #ifdef CONFIG_OF's around of match tables")

I've already mentioned I'm working on another approach that not just
cares about adding the table to the module, but the also the declaration
of the table itself. Here it is:

Introducing a macro MODULE_DECLARE_OF_TABLE(foo, entries), which declares
a static struct of_device_id array, fills in the entries (automatically
adds the sentinel) and calls MODULE_DEVICE_TABLE() - if CONFIG_OF is
enabled.

The current version isn't fully noop in absence of CONFIG_OF, but also
declares a static const *pointer* variable, initialized NULL, with the
same name. The idea behind: we don't need to use of_match_ptr() anymore.

I believe, the compiler should be clever enough to find out that this
field is always NULL and can't ever change, so it can be easily optimized
away. (correct me if I'm wrong).


Please have a look at the following example patches and let me know,
whether we can go that way. If you're okay w/ that, I'll continue
w/ converting the whole tree to using this approach. I've already did
most of it, yet needs to be sorted out into easily digestable patches :)
And I'd also do the same w/ the other table types (ACPI, PCI, I2C, ...)

By the way: an interesting question arises: shall that conversion be
done *everywhere*, or just those sites where explicit CONFIG_OF's are
involved ?


have fun,

--mtx






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

end of thread, other threads:[~2019-06-01 13:53 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-16 19:57 gpio-keys-polled improvements Enrico Weigelt, metux IT consult
2019-04-16 19:57 ` [PATCH 1/4] mod_devicetable: helper macro for declaring oftree module device table Enrico Weigelt, metux IT consult
2019-04-19  7:40   ` Dmitry Torokhov
2019-04-24 10:48     ` Enrico Weigelt, metux IT consult
2019-04-29 19:48       ` Frank Rowand
2019-04-16 19:57 ` [PATCH 2/4] input: keyboard: gpio-keys-polled: use input name from pdata if available Enrico Weigelt, metux IT consult
2019-04-16 19:57 ` [PATCH 3/4] input: keyboard: gpio_keys_polled: use gpio lookup table Enrico Weigelt, metux IT consult
2019-04-19  7:48   ` Dmitry Torokhov
2019-04-24 10:59     ` Enrico Weigelt, metux IT consult
2019-04-16 19:57 ` [PATCH 4/4] input: keyboard: gpio-keys-polled: skip oftree code when CONFIG_OF disabled Enrico Weigelt, metux IT consult
2019-04-29 19:44   ` Frank Rowand
2019-04-29 21:40     ` Enrico Weigelt, metux IT consult
2019-06-01 13:52 RFC: declaring DT match tables (2nd take) Enrico Weigelt, metux IT consult
2019-06-01 13:52 ` [PATCH 1/4] mod_devicetable: helper macro for declaring oftree module device table Enrico Weigelt, metux IT consult

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