[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1373387012.4391.14.camel@chaos.site>
Date: Tue, 09 Jul 2013 18:23:32 +0200
From: Jean Delvare <jdelvare@...e.de>
To: Joe Perches <joe@...ches.com>
Cc: linux-kernel@...r.kernel.org, Ben Hutchings <ben@...adent.org.uk>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 3/3] firmware/dmi_scan: Constify strings
Hi Joe,
Le Tuesday 09 July 2013 à 08:58 -0700, Joe Perches a écrit :
> On Tue, 2013-07-09 at 17:43 +0200, Jean Delvare wrote:
> > Add const to all DMI string pointers where this is possible. This
> > fixes a checkpatch warning.
>
> That's a nice little improvement.
Thanks.
> > +++ linux-3.10-rc0/drivers/firmware/dmi_scan.c 2013-05-04 11:20:52.808187924 +0200
> []
> > @@ -252,7 +252,7 @@ static void __init dmi_save_oem_strings_
> > struct dmi_device *dev;
> >
> > for (i = 1; i <= count; i++) {
> > - char *devname = dmi_string(dm, i);
> > + const char *devname = dmi_string(dm, i);
> >
> > if (devname == dmi_empty_string)
>
> btw: that last test sure looks like it would be
> better written as
> if (strcmp(devname, dmi_empty_string) == 0)
>
No, it does not. If you look at the rest of the code, the comparison
makes sense as is.
--
Jean Delvare
Suse L3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists