Skip to contentSkip to conversation

Inlined functions should be static.

PATCH In review Hans Petter Selasky 3 participants 5 messages May 23, 2011 – May 26, 2011 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Inlined functions should be static.

--HPS

From 446037f0f999759b4b801b6512d18bae769465bb Mon Sep 17 00:00:00 2001
From: Hans Petter Selasky <[email protected]>
Date: Mon, 23 May 2011 16:06:22 +0200
Subject: [PATCH] Inlined functions should be static.

---
 drivers/media/dvb/frontends/stb0899_algo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/media/dvb/frontends/stb0899_algo.c +1 -1
index 2da55ec..d70eee0 100644
@@ -23,7 +23,7 @@
 #include "stb0899_priv.h"
 #include "stb0899_reg.h"
 
-inline u32 stb0899_do_div(u64 n, u32 d)
+static inline u32 stb0899_do_div(u64 n, u32 d)
 {
 	/* wrap do_div() for ease of use */
 
Signature · 1 line
1.7.1.1
#1 lore raw
Quoted 2 lines · Hans Petter Selasky

--HPS

(again, inlining would save me copy-pasting)

drivers/media/dvb/frontends/stb0899_algo.c line 26

Quoted 2 lines
drivers/media/dvb/frontends/stb0899_algo.c +1 -1
-inline u32 stb0899_do_div(u64 n, u32 d)
+static inline u32 stb0899_do_div(u64 n, u32 d)

while at it you could as well remove the unneeded in a C file "inline" attribute.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

#2 lore raw

Em 23-05-2011 15:23, Guennadi Liakhovetski escreveu:

Quoted 6 lines · Hans Petter Selasky
Quoted 3 lines

--HPS

(again, inlining would save me copy-pasting)

Yeah... hard to comment not-inlined patches...

Quoted 6 lines

drivers/media/dvb/frontends/stb0899_algo.c line 26

Quoted 3 lines
drivers/media/dvb/frontends/stb0899_algo.c +1 -1
-inline u32 stb0899_do_div(u64 n, u32 d)
+static inline u32 stb0899_do_div(u64 n, u32 d)

while at it you could as well remove the unneeded in a C file "inline" attribute.

hmm... foo_do_div()... it seems to be yet-another-implementation of asm/div64.h. If so, it is better to just remove this thing and use the existing function.

Quoted 7 lines

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

#3 lore raw
Quoted 14 lines · On Monday 23 May 2011 20:29:28 Mauro Carvalho Chehab wrote:

Em 23-05-2011 15:23, Guennadi Liakhovetski escreveu:

Quoted 4 lines · Hans Petter Selasky
Quoted 1 line

--HPS

(again, inlining would save me copy-pasting)

Yeah... hard to comment not-inlined patches...

Quoted 5 lines

drivers/media/dvb/frontends/stb0899_algo.c line 26

Quoted 2 lines
drivers/media/dvb/frontends/stb0899_algo.c +1 -1
-inline u32 stb0899_do_div(u64 n, u32 d)
+static inline u32 stb0899_do_div(u64 n, u32 d)

while at it you could as well remove the unneeded in a C file "inline" attribute.

Quoted 4 lines

hmm... foo_do_div()... it seems to be yet-another-implementation of asm/div64.h. If so, it is better to just remove this thing and use the existing function.

The reason for this patch is that some version of GCC generated some garbage code on this function under certain conditions. Removing inline completly on this static function in a C file is fine by me. Do I need to create another patch?

--HPS

#4 lore raw

Em 23-05-2011 15:50, Hans Petter Selasky escreveu:

Quoted 20 lines · On Monday 23 May 2011 20:29:28 Mauro Carvalho Chehab wrote:
Quoted 14 lines

Em 23-05-2011 15:23, Guennadi Liakhovetski escreveu:

Quoted 4 lines · Hans Petter Selasky
Quoted 1 line

--HPS

(again, inlining would save me copy-pasting)

Yeah... hard to comment not-inlined patches...

Quoted 5 lines

drivers/media/dvb/frontends/stb0899_algo.c line 26

Quoted 2 lines
drivers/media/dvb/frontends/stb0899_algo.c +1 -1
-inline u32 stb0899_do_div(u64 n, u32 d)
+static inline u32 stb0899_do_div(u64 n, u32 d)

while at it you could as well remove the unneeded in a C file "inline" attribute.

Quoted 4 lines

hmm... foo_do_div()... it seems to be yet-another-implementation of asm/div64.h. If so, it is better to just remove this thing and use the existing function.

Quoted 4 lines

The reason for this patch is that some version of GCC generated some garbage code on this function under certain conditions. Removing inline completly on this static function in a C file is fine by me. Do I need to create another patch?

Just looked inside the code: it is not re-implementing the wheel. I don't like such macros, but it should not hurt.

So, I just applied your patch.

Thanks,
Mauro.

Quoted 6 lines

--HPS
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html