All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Inlined functions should be static.
@ 2011-05-23 14:07 Hans Petter Selasky
  2011-05-23 18:23 ` Guennadi Liakhovetski
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Petter Selasky @ 2011-05-23 14:07 UTC (permalink / raw)
  To: linux-media; +Cc: Mauro Carvalho Chehab

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

--HPS

[-- Attachment #2: dvb-usb-0014.patch --]
[-- Type: text/x-patch, Size: 844 bytes --]

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

Signed-off-by: Hans Petter Selasky <hselasky@c2i.net>
---
 drivers/media/dvb/frontends/stb0899_algo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/frontends/stb0899_algo.c b/drivers/media/dvb/frontends/stb0899_algo.c
index 2da55ec..d70eee0 100644
--- a/drivers/media/dvb/frontends/stb0899_algo.c
+++ b/drivers/media/dvb/frontends/stb0899_algo.c
@@ -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 */
 
-- 
1.7.1.1


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

* Re: [PATCH] Inlined functions should be static.
  2011-05-23 14:07 [PATCH] Inlined functions should be static Hans Petter Selasky
@ 2011-05-23 18:23 ` Guennadi Liakhovetski
  2011-05-23 18:29   ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 5+ messages in thread
From: Guennadi Liakhovetski @ 2011-05-23 18:23 UTC (permalink / raw)
  To: Hans Petter Selasky; +Cc: linux-media, Mauro Carvalho Chehab

On Mon, 23 May 2011, Hans Petter Selasky wrote:

> --HPS
> 

(again, inlining would save me copy-pasting)

> -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/

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

* Re: [PATCH] Inlined functions should be static.
  2011-05-23 18:23 ` Guennadi Liakhovetski
@ 2011-05-23 18:29   ` Mauro Carvalho Chehab
  2011-05-23 18:50     ` Hans Petter Selasky
  0 siblings, 1 reply; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2011-05-23 18:29 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: Hans Petter Selasky, linux-media

Em 23-05-2011 15:23, Guennadi Liakhovetski escreveu:
> On Mon, 23 May 2011, Hans Petter Selasky wrote:
> 
>> --HPS
>>
> 
> (again, inlining would save me copy-pasting)

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

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

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


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

* Re: [PATCH] Inlined functions should be static.
  2011-05-23 18:29   ` Mauro Carvalho Chehab
@ 2011-05-23 18:50     ` Hans Petter Selasky
  2011-05-26  0:30       ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Petter Selasky @ 2011-05-23 18:50 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Guennadi Liakhovetski, linux-media

On Monday 23 May 2011 20:29:28 Mauro Carvalho Chehab wrote:
> Em 23-05-2011 15:23, Guennadi Liakhovetski escreveu:
> > On Mon, 23 May 2011, Hans Petter Selasky wrote:
> >> --HPS
> > 
> > (again, inlining would save me copy-pasting)
> 
> Yeah... hard to comment not-inlined patches...
> 
> >> -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.
> 

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

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

* Re: [PATCH] Inlined functions should be static.
  2011-05-23 18:50     ` Hans Petter Selasky
@ 2011-05-26  0:30       ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2011-05-26  0:30 UTC (permalink / raw)
  To: Hans Petter Selasky; +Cc: Guennadi Liakhovetski, linux-media

Em 23-05-2011 15:50, Hans Petter Selasky escreveu:
> On Monday 23 May 2011 20:29:28 Mauro Carvalho Chehab wrote:
>> Em 23-05-2011 15:23, Guennadi Liakhovetski escreveu:
>>> On Mon, 23 May 2011, Hans Petter Selasky wrote:
>>>> --HPS
>>>
>>> (again, inlining would save me copy-pasting)
>>
>> Yeah... hard to comment not-inlined patches...
>>
>>>> -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.
>>
> 
> 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.
> 
> --HPS
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

end of thread, other threads:[~2011-05-26  0:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-23 14:07 [PATCH] Inlined functions should be static Hans Petter Selasky
2011-05-23 18:23 ` Guennadi Liakhovetski
2011-05-23 18:29   ` Mauro Carvalho Chehab
2011-05-23 18:50     ` Hans Petter Selasky
2011-05-26  0:30       ` Mauro Carvalho Chehab

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.