linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regmap: make LZO cache optional
@ 2017-06-02 13:15 Jonas Gorski
  2017-06-03  0:58 ` Greg Kroah-Hartman
  2017-06-06 19:06 ` Applied "regmap: make LZO cache optional" to the regmap tree Mark Brown
  0 siblings, 2 replies; 5+ messages in thread
From: Jonas Gorski @ 2017-06-02 13:15 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mark Brown, Greg Kroah-Hartman, Dimitris Papastamos

Commit 2cbbb579bcbe3 ("regmap: Add the LZO cache support") added support
for LZO compression in regcache, but there were never any users added
afterwards. Since LZO support itself has its own size, it currently is
rather a deoptimization.

So make it optional by introducing a symbol that can be selected by
drivers wanting to make use of it.

Saves e.g. ~46 kB on MIPS (size of LZO support + regcache LZO code).

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
I tried using google to find any users (even out-of-tree ones), but at
best I found a single driver submission that was switched to RBTREE in
subsequent resubmissions (MFD_SMSC).

One could maybe also just drop the code because of no users for 5 years,
but that would be up to the maintainer(s) to decide.

 drivers/base/regmap/Kconfig    | 5 ++++-
 drivers/base/regmap/Makefile   | 3 ++-
 drivers/base/regmap/regcache.c | 2 ++
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/base/regmap/Kconfig b/drivers/base/regmap/Kconfig
index db9d00c36a3e..48b3fc1ee514 100644
--- a/drivers/base/regmap/Kconfig
+++ b/drivers/base/regmap/Kconfig
@@ -4,9 +4,12 @@
 
 config REGMAP
 	default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ)
+	select IRQ_DOMAIN if REGMAP_IRQ
+	bool
+
+config REGCACHE_COMPRESSED
 	select LZO_COMPRESS
 	select LZO_DECOMPRESS
-	select IRQ_DOMAIN if REGMAP_IRQ
 	bool
 
 config REGMAP_AC97
diff --git a/drivers/base/regmap/Makefile b/drivers/base/regmap/Makefile
index 609e4c84f485..6271ea9b758a 100644
--- a/drivers/base/regmap/Makefile
+++ b/drivers/base/regmap/Makefile
@@ -2,7 +2,8 @@
 CFLAGS_regmap.o := -I$(src)
 
 obj-$(CONFIG_REGMAP) += regmap.o regcache.o
-obj-$(CONFIG_REGMAP) += regcache-rbtree.o regcache-lzo.o regcache-flat.o
+obj-$(CONFIG_REGMAP) += regcache-rbtree.o regcache-flat.o
+obj-$(CONFIG_REGCACHE_COMPRESSED) += regcache-lzo.o
 obj-$(CONFIG_DEBUG_FS) += regmap-debugfs.o
 obj-$(CONFIG_REGMAP_AC97) += regmap-ac97.o
 obj-$(CONFIG_REGMAP_I2C) += regmap-i2c.o
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index b0a0dcf32fb7..f3a435ee5fe8 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -21,7 +21,9 @@
 
 static const struct regcache_ops *cache_types[] = {
 	&regcache_rbtree_ops,
+#if IS_ENABLED(CONFIG_REGCHACHE_COMPRESSED)
 	&regcache_lzo_ops,
+#endif
 	&regcache_flat_ops,
 };
 
-- 
2.11.0

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

* Re: [PATCH] regmap: make LZO cache optional
  2017-06-02 13:15 [PATCH] regmap: make LZO cache optional Jonas Gorski
@ 2017-06-03  0:58 ` Greg Kroah-Hartman
  2017-06-06 19:06 ` Applied "regmap: make LZO cache optional" to the regmap tree Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2017-06-03  0:58 UTC (permalink / raw)
  To: Jonas Gorski; +Cc: linux-kernel, Mark Brown, Dimitris Papastamos

On Fri, Jun 02, 2017 at 03:15:37PM +0200, Jonas Gorski wrote:
> Commit 2cbbb579bcbe3 ("regmap: Add the LZO cache support") added support
> for LZO compression in regcache, but there were never any users added
> afterwards. Since LZO support itself has its own size, it currently is
> rather a deoptimization.
> 
> So make it optional by introducing a symbol that can be selected by
> drivers wanting to make use of it.
> 
> Saves e.g. ~46 kB on MIPS (size of LZO support + regcache LZO code).
> 
> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
> ---
> I tried using google to find any users (even out-of-tree ones), but at
> best I found a single driver submission that was switched to RBTREE in
> subsequent resubmissions (MFD_SMSC).
> 
> One could maybe also just drop the code because of no users for 5 years,
> but that would be up to the maintainer(s) to decide.

Let's just drop it, if there are no users, it shouldn't be there at all.

thanks,

greg k-h

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

* Applied "regmap: make LZO cache optional" to the regmap tree
  2017-06-02 13:15 [PATCH] regmap: make LZO cache optional Jonas Gorski
  2017-06-03  0:58 ` Greg Kroah-Hartman
@ 2017-06-06 19:06 ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2017-06-06 19:06 UTC (permalink / raw)
  To: Jonas Gorski
  Cc: Mark Brown, linux-kernel, Mark Brown, Greg Kroah-Hartman,
	Dimitris Papastamos, linux-kernel

The patch

   regmap: make LZO cache optional

has been applied to the regmap tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 34a730aa74c7c743f4ca9635e0d0b2479d6ed53c Mon Sep 17 00:00:00 2001
From: Jonas Gorski <jonas.gorski@gmail.com>
Date: Fri, 2 Jun 2017 15:15:37 +0200
Subject: [PATCH] regmap: make LZO cache optional

Commit 2cbbb579bcbe3 ("regmap: Add the LZO cache support") added support
for LZO compression in regcache, but there were never any users added
afterwards. Since LZO support itself has its own size, it currently is
rather a deoptimization.

So make it optional by introducing a symbol that can be selected by
drivers wanting to make use of it.

Saves e.g. ~46 kB on MIPS (size of LZO support + regcache LZO code).

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/base/regmap/Kconfig    | 5 ++++-
 drivers/base/regmap/Makefile   | 3 ++-
 drivers/base/regmap/regcache.c | 2 ++
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/base/regmap/Kconfig b/drivers/base/regmap/Kconfig
index db9d00c36a3e..48b3fc1ee514 100644
--- a/drivers/base/regmap/Kconfig
+++ b/drivers/base/regmap/Kconfig
@@ -4,9 +4,12 @@
 
 config REGMAP
 	default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ)
+	select IRQ_DOMAIN if REGMAP_IRQ
+	bool
+
+config REGCACHE_COMPRESSED
 	select LZO_COMPRESS
 	select LZO_DECOMPRESS
-	select IRQ_DOMAIN if REGMAP_IRQ
 	bool
 
 config REGMAP_AC97
diff --git a/drivers/base/regmap/Makefile b/drivers/base/regmap/Makefile
index 609e4c84f485..6271ea9b758a 100644
--- a/drivers/base/regmap/Makefile
+++ b/drivers/base/regmap/Makefile
@@ -2,7 +2,8 @@
 CFLAGS_regmap.o := -I$(src)
 
 obj-$(CONFIG_REGMAP) += regmap.o regcache.o
-obj-$(CONFIG_REGMAP) += regcache-rbtree.o regcache-lzo.o regcache-flat.o
+obj-$(CONFIG_REGMAP) += regcache-rbtree.o regcache-flat.o
+obj-$(CONFIG_REGCACHE_COMPRESSED) += regcache-lzo.o
 obj-$(CONFIG_DEBUG_FS) += regmap-debugfs.o
 obj-$(CONFIG_REGMAP_AC97) += regmap-ac97.o
 obj-$(CONFIG_REGMAP_I2C) += regmap-i2c.o
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index b0a0dcf32fb7..f3a435ee5fe8 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -21,7 +21,9 @@
 
 static const struct regcache_ops *cache_types[] = {
 	&regcache_rbtree_ops,
+#if IS_ENABLED(CONFIG_REGCHACHE_COMPRESSED)
 	&regcache_lzo_ops,
+#endif
 	&regcache_flat_ops,
 };
 
-- 
2.11.0

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

* Re: [PATCH] regmap: make LZO cache optional
  2017-06-08 14:28 [PATCH] regmap: make LZO cache optional Andreas Ziegler
@ 2017-06-11 10:26 ` Jonas Gorski
  0 siblings, 0 replies; 5+ messages in thread
From: Jonas Gorski @ 2017-06-11 10:26 UTC (permalink / raw)
  To: Andreas Ziegler; +Cc: Mark Brown, Greg Kroah-Hartman, linux-kernel

Hi Andreas,

On 8 June 2017 at 16:28, Andreas Ziegler <andreas.ziegler@fau.de> wrote:
> Hi Jonas,
>
> I noticed your patch 'regmap: make LZO cache optional' as it recently showed up
> in linux-next. In your patch, you modify drivers/base/regmap/regcache.c by
> adding an #if IS_ENABLED() statement.
>
> However, this statement contains a spelling error, as it references
> REGCHACHE_COMPRESSED instead of REGCACHE_COMPRESSED (note the extra H).
>
> I noticed it by running the in-tree script at scripts/checkkconfigsymbols.py on
> the commit, like so: './scripts/checkkconfigsymbols.py -c 34a730aa74c7'
>
> As Greg suggested the whole code could be dropped, this might not be too
> relevant, but I wanted to let you know in any case.

Thanks for spotting that, and I wasn't aware of this script, that
seems quite useful!


Regards
Jonas

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

* Re: [PATCH] regmap: make LZO cache optional
@ 2017-06-08 14:28 Andreas Ziegler
  2017-06-11 10:26 ` Jonas Gorski
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Ziegler @ 2017-06-08 14:28 UTC (permalink / raw)
  To: Jonas Gorski; +Cc: Mark Brown, Greg Kroah-Hartman, linux-kernel

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

Hi Jonas,

I noticed your patch 'regmap: make LZO cache optional' as it recently showed up
in linux-next. In your patch, you modify drivers/base/regmap/regcache.c by
adding an #if IS_ENABLED() statement.

However, this statement contains a spelling error, as it references
REGCHACHE_COMPRESSED instead of REGCACHE_COMPRESSED (note the extra H).

I noticed it by running the in-tree script at scripts/checkkconfigsymbols.py on
the commit, like so: './scripts/checkkconfigsymbols.py -c 34a730aa74c7'

As Greg suggested the whole code could be dropped, this might not be too
relevant, but I wanted to let you know in any case.

Best regards,

Andreas


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5450 bytes --]

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

end of thread, other threads:[~2017-06-11 10:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-02 13:15 [PATCH] regmap: make LZO cache optional Jonas Gorski
2017-06-03  0:58 ` Greg Kroah-Hartman
2017-06-06 19:06 ` Applied "regmap: make LZO cache optional" to the regmap tree Mark Brown
2017-06-08 14:28 [PATCH] regmap: make LZO cache optional Andreas Ziegler
2017-06-11 10:26 ` Jonas Gorski

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