linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mbxfb: unbreak compilation with CONFIG_FB_MBX_DEBUG
@ 2012-05-14 16:31 tartler
  2012-05-16  0:20 ` Eric Miao
  2012-06-05 19:15 ` Florian Tobias Schandinat
  0 siblings, 2 replies; 4+ messages in thread
From: tartler @ 2012-05-14 16:31 UTC (permalink / raw)
  To: Florian Tobias Schandinat, Eric Miao, Arnd Bergmann, linux-fbdev,
	linux-kernel
  Cc: vamos-dev, Reinhard Tartler, Reinhard Tartler

From: Reinhard Tartler <siretart@tauware.de>

This patch adds missing function prototypes.

Signed-off-by: Reinhard Tartler <tartler@cs.fau.de>
---
 drivers/video/mbx/mbxfb.c |    3 +++
 1 file changed, 3 insertions(+)

This patch was found with tools developed in the VAMOS project:
http://www4.cs.fau.de/Research/VAMOS/

TBH, I'm not sure if this is the correct solution. However, I'd
appreciate if someone could confirm that this is a real bug.


diff --git a/drivers/video/mbx/mbxfb.c b/drivers/video/mbx/mbxfb.c
index 6ce3416..c2200ec 100644
--- a/drivers/video/mbx/mbxfb.c
+++ b/drivers/video/mbx/mbxfb.c
@@ -878,6 +878,9 @@ static int mbxfb_resume(struct platform_device *dev)
 #ifndef CONFIG_FB_MBX_DEBUG
 #define mbxfb_debugfs_init(x)	do {} while(0)
 #define mbxfb_debugfs_remove(x)	do {} while(0)
+#else
+void mbxfb_debugfs_init(struct fb_info *fbi);
+void mbxfb_debugfs_remove(struct fb_info *fbi);
 #endif
 
 #define res_size(_r) (((_r)->end - (_r)->start) + 1)
-- 
1.7.9.5


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

* Re: [PATCH] mbxfb: unbreak compilation with CONFIG_FB_MBX_DEBUG
  2012-05-14 16:31 [PATCH] mbxfb: unbreak compilation with CONFIG_FB_MBX_DEBUG tartler
@ 2012-05-16  0:20 ` Eric Miao
  2012-06-05 19:15 ` Florian Tobias Schandinat
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Miao @ 2012-05-16  0:20 UTC (permalink / raw)
  To: tartler
  Cc: Florian Tobias Schandinat, Arnd Bergmann, linux-fbdev,
	linux-kernel, vamos-dev, Reinhard Tartler

On Tue, May 15, 2012 at 12:31 AM,  <tartler@cs.fau.de> wrote:
> From: Reinhard Tartler <siretart@tauware.de>
>
> This patch adds missing function prototypes.
>
> Signed-off-by: Reinhard Tartler <tartler@cs.fau.de>
> ---
>  drivers/video/mbx/mbxfb.c |    3 +++
>  1 file changed, 3 insertions(+)
>
> This patch was found with tools developed in the VAMOS project:
> http://www4.cs.fau.de/Research/VAMOS/
>
> TBH, I'm not sure if this is the correct solution. However, I'd
> appreciate if someone could confirm that this is a real bug.

This looks to be a correct solution to me.

Acked-by: Eric Miao <eric.y.miao@gmail.com>

>
>
> diff --git a/drivers/video/mbx/mbxfb.c b/drivers/video/mbx/mbxfb.c
> index 6ce3416..c2200ec 100644
> --- a/drivers/video/mbx/mbxfb.c
> +++ b/drivers/video/mbx/mbxfb.c
> @@ -878,6 +878,9 @@ static int mbxfb_resume(struct platform_device *dev)
>  #ifndef CONFIG_FB_MBX_DEBUG
>  #define mbxfb_debugfs_init(x)  do {} while(0)
>  #define mbxfb_debugfs_remove(x)        do {} while(0)
> +#else
> +void mbxfb_debugfs_init(struct fb_info *fbi);
> +void mbxfb_debugfs_remove(struct fb_info *fbi);
>  #endif
>
>  #define res_size(_r) (((_r)->end - (_r)->start) + 1)
> --
> 1.7.9.5
>

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

* Re: [PATCH] mbxfb: unbreak compilation with CONFIG_FB_MBX_DEBUG
  2012-05-14 16:31 [PATCH] mbxfb: unbreak compilation with CONFIG_FB_MBX_DEBUG tartler
  2012-05-16  0:20 ` Eric Miao
@ 2012-06-05 19:15 ` Florian Tobias Schandinat
  2012-06-05 20:54   ` Eric Miao
  1 sibling, 1 reply; 4+ messages in thread
From: Florian Tobias Schandinat @ 2012-06-05 19:15 UTC (permalink / raw)
  To: tartler
  Cc: Eric Miao, Arnd Bergmann, linux-fbdev, linux-kernel, vamos-dev,
	Reinhard Tartler

Hi,

On 05/14/2012 04:31 PM, tartler@cs.fau.de wrote:
> From: Reinhard Tartler <siretart@tauware.de>
> 
> This patch adds missing function prototypes.
> 
> Signed-off-by: Reinhard Tartler <tartler@cs.fau.de>
> ---
>  drivers/video/mbx/mbxfb.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> This patch was found with tools developed in the VAMOS project:
> http://www4.cs.fau.de/Research/VAMOS/
> 
> TBH, I'm not sure if this is the correct solution. However, I'd
> appreciate if someone could confirm that this is a real bug.
> 
> 
> diff --git a/drivers/video/mbx/mbxfb.c b/drivers/video/mbx/mbxfb.c
> index 6ce3416..c2200ec 100644
> --- a/drivers/video/mbx/mbxfb.c
> +++ b/drivers/video/mbx/mbxfb.c
> @@ -878,6 +878,9 @@ static int mbxfb_resume(struct platform_device *dev)
>  #ifndef CONFIG_FB_MBX_DEBUG
>  #define mbxfb_debugfs_init(x)	do {} while(0)
>  #define mbxfb_debugfs_remove(x)	do {} while(0)
> +#else
> +void mbxfb_debugfs_init(struct fb_info *fbi);
> +void mbxfb_debugfs_remove(struct fb_info *fbi);

I don't agree. checkpatch complains
WARNING: externs should be avoided in .c files
#71: FILE: drivers/video/mbx/mbxfb.c:882:
+void mbxfb_debugfs_init(struct fb_info *fbi);

And in drivers/video/mbx/mbxdebugfs.c
static void __devinit mbxfb_debugfs_init(struct fb_info *fbi)
static void __devexit mbxfb_debugfs_remove(struct fb_info *fbi)

So even if you want to ignore the checkpatch warning (which I could
understand for just 2 includes even if headers are certainly better)
you'd have to remove the static at the implementation and for
consistency include the __devinit/exit in your prototypes.

>  #endif
>  
>  #define res_size(_r) (((_r)->end - (_r)->start) + 1)


Best regards,

Florian Tobias Schandinat

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

* Re: [PATCH] mbxfb: unbreak compilation with CONFIG_FB_MBX_DEBUG
  2012-06-05 19:15 ` Florian Tobias Schandinat
@ 2012-06-05 20:54   ` Eric Miao
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Miao @ 2012-06-05 20:54 UTC (permalink / raw)
  To: Florian Tobias Schandinat
  Cc: tartler, Arnd Bergmann, linux-fbdev, linux-kernel, vamos-dev,
	Reinhard Tartler

On Wed, Jun 6, 2012 at 3:15 AM, Florian Tobias Schandinat
<FlorianSchandinat@gmx.de> wrote:
> Hi,
>
> On 05/14/2012 04:31 PM, tartler@cs.fau.de wrote:
>> From: Reinhard Tartler <siretart@tauware.de>
>>
>> This patch adds missing function prototypes.
>>
>> Signed-off-by: Reinhard Tartler <tartler@cs.fau.de>
>> ---
>>  drivers/video/mbx/mbxfb.c |    3 +++
>>  1 file changed, 3 insertions(+)
>>
>> This patch was found with tools developed in the VAMOS project:
>> http://www4.cs.fau.de/Research/VAMOS/
>>
>> TBH, I'm not sure if this is the correct solution. However, I'd
>> appreciate if someone could confirm that this is a real bug.
>>
>>
>> diff --git a/drivers/video/mbx/mbxfb.c b/drivers/video/mbx/mbxfb.c
>> index 6ce3416..c2200ec 100644
>> --- a/drivers/video/mbx/mbxfb.c
>> +++ b/drivers/video/mbx/mbxfb.c
>> @@ -878,6 +878,9 @@ static int mbxfb_resume(struct platform_device *dev)
>>  #ifndef CONFIG_FB_MBX_DEBUG
>>  #define mbxfb_debugfs_init(x)        do {} while(0)
>>  #define mbxfb_debugfs_remove(x)      do {} while(0)
>> +#else
>> +void mbxfb_debugfs_init(struct fb_info *fbi);
>> +void mbxfb_debugfs_remove(struct fb_info *fbi);
>
> I don't agree. checkpatch complains
> WARNING: externs should be avoided in .c files
> #71: FILE: drivers/video/mbx/mbxfb.c:882:
> +void mbxfb_debugfs_init(struct fb_info *fbi);
>
> And in drivers/video/mbx/mbxdebugfs.c
> static void __devinit mbxfb_debugfs_init(struct fb_info *fbi)
> static void __devexit mbxfb_debugfs_remove(struct fb_info *fbi)
>
> So even if you want to ignore the checkpatch warning (which I could
> understand for just 2 includes even if headers are certainly better)
> you'd have to remove the static at the implementation and for
> consistency include the __devinit/exit in your prototypes.

That actually made a very good point, and I seriously doubt whether the
mbxfb_debugfs_* thing has ever been tested. Instead of making them
public, I see a chance maybe we could remove them completely instead.

>
>>  #endif
>>
>>  #define res_size(_r) (((_r)->end - (_r)->start) + 1)
>
>
> Best regards,
>
> Florian Tobias Schandinat

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

end of thread, other threads:[~2012-06-05 20:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-14 16:31 [PATCH] mbxfb: unbreak compilation with CONFIG_FB_MBX_DEBUG tartler
2012-05-16  0:20 ` Eric Miao
2012-06-05 19:15 ` Florian Tobias Schandinat
2012-06-05 20:54   ` Eric Miao

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