Re: [PATCH] mbxfb: unbreak compilation with CONFIG_FB_MBX_DEBUG

From: Eric Miao
Date: Tue Jun 05 2012 - 16:54:42 EST


On Wed, Jun 6, 2012 at 3:15 AM, Florian Tobias Schandinat
<FlorianSchandinat@xxxxxx> wrote:
> Hi,
>
> On 05/14/2012 04:31 PM, tartler@xxxxxxxxx wrote:
>> From: Reinhard Tartler <siretart@xxxxxxxxxx>
>>
>> This patch adds missing function prototypes.
>>
>> Signed-off-by: Reinhard Tartler <tartler@xxxxxxxxx>
>> ---
>> Â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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/