Re: [PATCH V2 6/6] mpcore_wdt: Move declarations in a separate header

From: Arnd Bergmann
Date: Wed Jul 06 2011 - 08:49:02 EST


On Wednesday 06 July 2011, Vitaly Kuzmichev wrote:
> The patch is aimed to resolve checkpatch warning on "extern" function
> prototype:
>
> WARNING: externs should be avoided in .c files
> #44: FILE: drivers/watchdog/mpcore_wdt.c:37:
> +unsigned long twd_timer_get_rate(void);
>
> If it's ok to leave this warning I would also like to throw out this patch.

Ah, I see. That part is indeed an interface, so the declaration should be
in a header file that gets included by both the clocksource and the watchdog
driver.

However, you should not put all the local declarations in the header,
and the header needs to be in a location that gets included by
drivers/clocksource/arm_smp_twd.c as well. In this case, I think
it makes more sense to name that header based on the driver that
exports the function, not based on the driver that uses it,
or you can add it to an *appropriate* existing header file, if you
can find one.

An obvious choice would be arch/arm/include/asm/smp_twd.h.

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