Skip to contentSkip to conversation

Applied "ASoC: rsnd: remove unnecessary static in rsnd_ssiu_probe()" to the asoc tree

PATCH Mark Brown 1 participant 1 message Jul 17, 2017

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

The patch

ASoC: rsnd: remove unnecessary static in rsnd_ssiu_probe()

has been applied to the asoc tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.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

Quoted 1 line

From 32e1b60d8f91be932c4a624d4153224895b65ec7 Mon Sep 17 00:00:00 2001

From: "Gustavo A. R. Silva" <[email protected]>
Date: Mon, 17 Jul 2017 10:30:20 -0500
Subject: [PATCH] ASoC: rsnd: remove unnecessary static in rsnd_ssiu_probe()

Remove unnecessary static on local variable ops. Such variable is initialized before being used, on every execution path throughout the function. The static has no benefit and, removing it reduces the code size.

This issue was detected using Coccinelle and the following semantic patch:

@bad exists@
position p;
identifier x;
type T;
@@

static T x@p;
...
x = <+...x...+>

@@
identifier x;
expression e;
type T;
position p != bad.p;
@@

-static
T x@p;
... when != x
when strict
?x = e;

In the following log you can see the difference in the code size. Also, there is a significant difference in the bss segment. This log is the output of the size command, before and after the code change:

before:
text data bss dec hex filename
3211 680 64 3955 f73 sound/soc/sh/rcar/ssiu.o

after:
text data bss dec hex filename
3207 592 0 3799 ed7 sound/soc/sh/rcar/ssiu.o

---
 sound/soc/sh/rcar/ssiu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/sh/rcar/ssiu.c +1 -1
index bed2c9c0004b..4d948757d300 100644
@@ -250,7 +250,7 @@ int rsnd_ssiu_probe(struct rsnd_priv *priv)
 {
 	struct device *dev = rsnd_priv_to_dev(priv);
 	struct rsnd_ssiu *ssiu;
-	static struct rsnd_mod_ops *ops;
+	struct rsnd_mod_ops *ops;
 	int i, nr, ret;
 
 	/* same number to SSI */
Signature · 1 line
2.13.2