[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120321162757.527f87e2@endymion.delvare>
Date: Wed, 21 Mar 2012 16:27:57 +0100
From: Jean Delvare <khali@...ux-fr.org>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Amit Daniel Kachhap <amit.kachhap@...aro.org>,
linux-pm@...ts.linux-foundation.org, linux-kernel@...r.kernel.org,
linux-acpi@...r.kernel.org, lenb@...nel.org,
linaro-dev@...ts.linaro.org, patches@...aro.org
Subject: Re: [PATCH] thermal: Fix for setting the thermal zone mode to
enable/disable
On Wed, 21 Mar 2012 16:14:46 +0100, Geert Uytterhoeven wrote:
> On Wed, Mar 21, 2012 at 15:13, Jean Delvare <khali@...ux-fr.org> wrote:
> > On Wed, 21 Mar 2012 16:40:01 +0530, Amit Daniel Kachhap wrote:
> >> Basically without this patch changing the mode of thermal zone
> >> is not possible as wrong string size is passed to strncmp.
> >
> > Actually it is possible,
> > $ echo -n disabled > mode
> > works fine. But it fails without the -n, your patch would fix that.
>
> Now it ignores any extra characters. Are they always newlines?
>
> Now "echo -n disabledx > mode" will also "succeed".
I guess this is considered good enough in practice, although I also
don't like this use of strncmp. I'd prefer \n to be properly converted
to \0 (by the sysfs layer itself) so that strict string comparisons can
be done. I don't have the time to push this though, sorry.
--
Jean Delvare
--
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