* Re: [PATCH] clk: mediatek: remove unnecessary include header from reset.c
@ 2017-12-27 3:33 ` Sean Wang
0 siblings, 0 replies; 8+ messages in thread
From: Sean Wang @ 2017-12-27 3:33 UTC (permalink / raw)
To: Stephen Boyd
Cc: mturquette, matthias.bgg, jdelvare, jamesjj.liao, weiyi.lu, arnd,
linux-mediatek, linux-clk, linux-kernel
On Tue, 2017-12-26 at 17:10 -0800, Stephen Boyd wrote:
> On 12/25, sean.wang@mediatek.com wrote:
> > From: Sean Wang <sean.wang@mediatek.com>
> >
> > In fact, the clk-mtk.h header is indeed not needed for reset.c and thus
> > it's safe and good change to remove it from the file.
> >
> > Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> > Reviewed-by: Jean Delvare <jdelvare@suse.de>
> > Cc: Jean Delvare <jdelvare@suse.de>
> > ---
> > drivers/clk/mediatek/reset.c | 2 --
> > 1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/clk/mediatek/reset.c b/drivers/clk/mediatek/reset.c
> > index d3551d5..70ebb2e 100644
> > --- a/drivers/clk/mediatek/reset.c
> > +++ b/drivers/clk/mediatek/reset.c
> > @@ -19,8 +19,6 @@
> > #include <linux/reset-controller.h>
> > #include <linux/slab.h>
> >
> > -#include "clk-mtk.h"
> > -
>
> drivers/clk/mediatek/reset.c:64:6: warning: symbol 'mtk_register_reset_controller' was not declared. Should it be static?
>
It cannot be static since the function would be referenced in other
files under the same folder
One point I felt confused which is I didn't see the warning complains
when I did these build test, even I also added -Werror and -Wall to
build all files under driver/clk/mediatek. My toolchain is based on gcc
version 5.2.0 (GCC).
If the warning still is, the include "clk-mtk.h" should be good to stay
there because the declaration it needs is in the clk-mtk.h
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] clk: mediatek: remove unnecessary include header from reset.c
2017-12-27 3:33 ` Sean Wang
@ 2017-12-27 12:15 ` Jean Delvare
-1 siblings, 0 replies; 8+ messages in thread
From: Jean Delvare @ 2017-12-27 12:15 UTC (permalink / raw)
To: Sean Wang
Cc: Stephen Boyd, mturquette, matthias.bgg, jamesjj.liao, weiyi.lu,
arnd, linux-mediatek, linux-clk, linux-kernel
Hi Sean, Stephen,
On Wed, 27 Dec 2017 11:33:00 +0800, Sean Wang wrote:
> On Tue, 2017-12-26 at 17:10 -0800, Stephen Boyd wrote:
> > drivers/clk/mediatek/reset.c:64:6: warning: symbol 'mtk_register_reset_controller' was not declared. Should it be static?
>
> It cannot be static since the function would be referenced in other
> files under the same folder
>
>
> One point I felt confused which is I didn't see the warning complains
> when I did these build test, even I also added -Werror and -Wall to
> build all files under driver/clk/mediatek. My toolchain is based on gcc
> version 5.2.0 (GCC).
I tested and I get the warning here (gcc 4.8.5 on SUSE) but only after
setting CONFIG_RESET_CONTROLLER=y. Without it,
drivers/clk/mediatek/reset.o is never built, so no warning can be
generated.
> If the warning still is, the include "clk-mtk.h" should be good to stay
> there because the declaration it needs is in the clk-mtk.h
Agreed.
--
Jean Delvare
SUSE L3 Support
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] clk: mediatek: remove unnecessary include header from reset.c
@ 2017-12-27 12:15 ` Jean Delvare
0 siblings, 0 replies; 8+ messages in thread
From: Jean Delvare @ 2017-12-27 12:15 UTC (permalink / raw)
To: Sean Wang
Cc: Stephen Boyd, mturquette, matthias.bgg, jamesjj.liao, weiyi.lu,
arnd, linux-mediatek, linux-clk, linux-kernel
Hi Sean, Stephen,
On Wed, 27 Dec 2017 11:33:00 +0800, Sean Wang wrote:
> On Tue, 2017-12-26 at 17:10 -0800, Stephen Boyd wrote:
> > drivers/clk/mediatek/reset.c:64:6: warning: symbol 'mtk_register_reset_controller' was not declared. Should it be static?
>
> It cannot be static since the function would be referenced in other
> files under the same folder
>
>
> One point I felt confused which is I didn't see the warning complains
> when I did these build test, even I also added -Werror and -Wall to
> build all files under driver/clk/mediatek. My toolchain is based on gcc
> version 5.2.0 (GCC).
I tested and I get the warning here (gcc 4.8.5 on SUSE) but only after
setting CONFIG_RESET_CONTROLLER=y. Without it,
drivers/clk/mediatek/reset.o is never built, so no warning can be
generated.
> If the warning still is, the include "clk-mtk.h" should be good to stay
> there because the declaration it needs is in the clk-mtk.h
Agreed.
--
Jean Delvare
SUSE L3 Support
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] clk: mediatek: remove unnecessary include header from reset.c
2017-12-27 3:33 ` Sean Wang
(?)
(?)
@ 2017-12-27 17:38 ` Stephen Boyd
-1 siblings, 0 replies; 8+ messages in thread
From: Stephen Boyd @ 2017-12-27 17:38 UTC (permalink / raw)
To: Sean Wang
Cc: mturquette, matthias.bgg, jdelvare, jamesjj.liao, weiyi.lu, arnd,
linux-mediatek, linux-clk, linux-kernel
On 12/27, Sean Wang wrote:
> On Tue, 2017-12-26 at 17:10 -0800, Stephen Boyd wrote:
> > On 12/25, sean.wang@mediatek.com wrote:
> > > From: Sean Wang <sean.wang@mediatek.com>
> > >
> > > In fact, the clk-mtk.h header is indeed not needed for reset.c and thus
> > > it's safe and good change to remove it from the file.
> > >
> > > Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> > > Reviewed-by: Jean Delvare <jdelvare@suse.de>
> > > Cc: Jean Delvare <jdelvare@suse.de>
> > > ---
> > > drivers/clk/mediatek/reset.c | 2 --
> > > 1 file changed, 2 deletions(-)
> > >
> > > diff --git a/drivers/clk/mediatek/reset.c b/drivers/clk/mediatek/reset.c
> > > index d3551d5..70ebb2e 100644
> > > --- a/drivers/clk/mediatek/reset.c
> > > +++ b/drivers/clk/mediatek/reset.c
> > > @@ -19,8 +19,6 @@
> > > #include <linux/reset-controller.h>
> > > #include <linux/slab.h>
> > >
> > > -#include "clk-mtk.h"
> > > -
> >
> > drivers/clk/mediatek/reset.c:64:6: warning: symbol 'mtk_register_reset_controller' was not declared. Should it be static?
> >
>
> It cannot be static since the function would be referenced in other
> files under the same folder
>
>
> One point I felt confused which is I didn't see the warning complains
> when I did these build test, even I also added -Werror and -Wall to
> build all files under driver/clk/mediatek. My toolchain is based on gcc
> version 5.2.0 (GCC).
>
>
> If the warning still is, the include "clk-mtk.h" should be good to stay
> there because the declaration it needs is in the clk-mtk.h
>
The warning is from sparse. I built the file with C=2 on the
commandline.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 8+ messages in thread