diff mbox

kexec-tools, ppc64: fix build error on ppc64

Message ID 15110.1273024133@neuling.org (mailing list archive)
State Not Applicable
Headers show

Commit Message

Michael Neuling May 5, 2010, 1:48 a.m. UTC
6adc05c6e3fdbc8b9f5d915af78ca05d0a09cb17 "some kexec MIPS
improvements" broke pp64 as it turned on -Werror for all archs.

This fixes the warning and hence ppc64 building.

Signed-off-by: Michael Neuling <mikey@neuling.org>
---
I've posted a second patch to fix the issue of changing one archs
Makefile, effecting all other archs.

 kexec/arch/ppc64/fs2dt.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Dale Farnsworth May 5, 2010, 1:56 a.m. UTC | #1
In article <15110.1273024133@neuling.org> Michael Neuling wrote:
> 6adc05c6e3fdbc8b9f5d915af78ca05d0a09cb17 "some kexec MIPS
> improvements" broke pp64 as it turned on -Werror for all archs.
> 
> This fixes the warning and hence ppc64 building.
> 
> Signed-off-by: Michael Neuling <mikey@neuling.org>
> ---
> I've posted a second patch to fix the issue of changing one archs
> Makefile, effecting all other archs.
> 
>  kexec/arch/ppc64/fs2dt.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> Index: kexec-tools/kexec/arch/ppc64/fs2dt.c
> ===================================================================
> --- kexec-tools.orig/kexec/arch/ppc64/fs2dt.c
> +++ kexec-tools/kexec/arch/ppc64/fs2dt.c
> @@ -357,7 +357,8 @@ static void putprops(char *fn, struct di
>   * Compare function used to sort the device-tree directories
>   * This function will be passed to scandir.
>   */
> -static int comparefunc(const void *dentry1, const void *dentry2)
> +static int comparefunc(const struct dirent **dentry1,
> +		       const struct dirent **dentry2)
>  {
>  	char *str1 = (*(struct dirent **)dentry1)->d_name;
>  	char *str2 = (*(struct dirent **)dentry2)->d_name;

It would be nice to also remove the no-longer-needed casts.

-Dale
Simon Horman May 5, 2010, 2:33 a.m. UTC | #2
On Wed, May 05, 2010 at 11:48:53AM +1000, Michael Neuling wrote:
> 6adc05c6e3fdbc8b9f5d915af78ca05d0a09cb17 "some kexec MIPS
> improvements" broke pp64 as it turned on -Werror for all archs.
> 
> This fixes the warning and hence ppc64 building.

Thanks.

While I'm very much in favour of using -Werror for testing
and these kind of patches are great, I think that -Werror
by default is rather silly. We can't control what will be
a warning in the future and sometimes fixing warnings isn't
appropriate - for instance there are warnings in fs2dt.c at
the moment, that is currently considered an upstream problem.

In short, this patch is great. But I plan to also remove -Werror
as the default now that its been brought to my attention.

> 
> Signed-off-by: Michael Neuling <mikey@neuling.org>
> ---
> I've posted a second patch to fix the issue of changing one archs
> Makefile, effecting all other archs.
> 
>  kexec/arch/ppc64/fs2dt.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> Index: kexec-tools/kexec/arch/ppc64/fs2dt.c
> ===================================================================
> --- kexec-tools.orig/kexec/arch/ppc64/fs2dt.c
> +++ kexec-tools/kexec/arch/ppc64/fs2dt.c
> @@ -357,7 +357,8 @@ static void putprops(char *fn, struct di
>   * Compare function used to sort the device-tree directories
>   * This function will be passed to scandir.
>   */
> -static int comparefunc(const void *dentry1, const void *dentry2)
> +static int comparefunc(const struct dirent **dentry1,
> +		       const struct dirent **dentry2)
>  {
>  	char *str1 = (*(struct dirent **)dentry1)->d_name;
>  	char *str2 = (*(struct dirent **)dentry2)->d_name;
> 
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
Michael Neuling May 5, 2010, 3:35 a.m. UTC | #3
In message <20100505023316.GF13035@verge.net.au> you wrote:
> On Wed, May 05, 2010 at 11:48:53AM +1000, Michael Neuling wrote:
> > 6adc05c6e3fdbc8b9f5d915af78ca05d0a09cb17 "some kexec MIPS
> > improvements" broke pp64 as it turned on -Werror for all archs.
> > 
> > This fixes the warning and hence ppc64 building.
> 
> Thanks.
> 
> While I'm very much in favour of using -Werror for testing
> and these kind of patches are great, I think that -Werror
> by default is rather silly. We can't control what will be
> a warning in the future and sometimes fixing warnings isn't
> appropriate - for instance there are warnings in fs2dt.c at
> the moment, that is currently considered an upstream problem.
> 
> In short, this patch is great. But I plan to also remove -Werror
> as the default now that its been brought to my attention.

Cool.  My second patch should do this for all but MIPS.

Mikey

> 
> > 
> > Signed-off-by: Michael Neuling <mikey@neuling.org>
> > ---
> > I've posted a second patch to fix the issue of changing one archs
> > Makefile, effecting all other archs.
> > 
> >  kexec/arch/ppc64/fs2dt.c |    3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > Index: kexec-tools/kexec/arch/ppc64/fs2dt.c
> > ===================================================================
> > --- kexec-tools.orig/kexec/arch/ppc64/fs2dt.c
> > +++ kexec-tools/kexec/arch/ppc64/fs2dt.c
> > @@ -357,7 +357,8 @@ static void putprops(char *fn, struct di
> >   * Compare function used to sort the device-tree directories
> >   * This function will be passed to scandir.
> >   */
> > -static int comparefunc(const void *dentry1, const void *dentry2)
> > +static int comparefunc(const struct dirent **dentry1,
> > +		       const struct dirent **dentry2)
> >  {
> >  	char *str1 = (*(struct dirent **)dentry1)->d_name;
> >  	char *str2 = (*(struct dirent **)dentry2)->d_name;
> > 
> > _______________________________________________
> > kexec mailing list
> > kexec@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/kexec
>
diff mbox

Patch

Index: kexec-tools/kexec/arch/ppc64/fs2dt.c
===================================================================
--- kexec-tools.orig/kexec/arch/ppc64/fs2dt.c
+++ kexec-tools/kexec/arch/ppc64/fs2dt.c
@@ -357,7 +357,8 @@  static void putprops(char *fn, struct di
  * Compare function used to sort the device-tree directories
  * This function will be passed to scandir.
  */
-static int comparefunc(const void *dentry1, const void *dentry2)
+static int comparefunc(const struct dirent **dentry1,
+		       const struct dirent **dentry2)
 {
 	char *str1 = (*(struct dirent **)dentry1)->d_name;
 	char *str2 = (*(struct dirent **)dentry2)->d_name;