2006-05-29 05:31:45

by Dmitry Torokhov

[permalink] [raw]
Subject: Should we make dmi_check_system case insensitive?

Hi,

I have a request to add entry for "LifeBook B Series" to lifebook driver to
accomodate lifebook B2545, however we already have entry for "LIFEBOOK B
Series" (used by some other model) which is not working. Would anyone
be opposed making dmi_check_system() ignore string case? We would have to
malloc/copy both strings and lowercase them before doing stsstr...

--
Dmitry


2006-05-29 06:15:30

by Jeff Garzik

[permalink] [raw]
Subject: Re: Should we make dmi_check_system case insensitive?

Dmitry Torokhov wrote:
> I have a request to add entry for "LifeBook B Series" to lifebook driver to
> accomodate lifebook B2545, however we already have entry for "LIFEBOOK B
> Series" (used by some other model) which is not working. Would anyone
> be opposed making dmi_check_system() ignore string case? We would have to
> malloc/copy both strings and lowercase them before doing stsstr...

I was thinking that something like this would eventually be necessary.
My mind even wandered into the land of wildcards and regexes...

But be wary... DMI stuff is often used early enough that memory
allocation may be a bad idea (it seems to use a special dmi_alloc
function, at the very least).

Jeff


2006-05-29 06:19:48

by Arjan van de Ven

[permalink] [raw]
Subject: Re: Should we make dmi_check_system case insensitive?

On Mon, 2006-05-29 at 01:31 -0400, Dmitry Torokhov wrote:
> Hi,
>
> I have a request to add entry for "LifeBook B Series" to lifebook driver to
> accomodate lifebook B2545, however we already have entry for "LIFEBOOK B
> Series" (used by some other model) which is not working. Would anyone
> be opposed making dmi_check_system() ignore string case?

yes I would.
There are very legit reasons to be able to separate both machines, for
other things they may well be not the same after all. Once you go case
insensitive you can't separate at all anymore; I rather have an
occasional "dupe" in the table than a really huge mess of things you
can't keep separate anymore....

2006-05-29 07:19:50

by Vojtech Pavlik

[permalink] [raw]
Subject: Re: Should we make dmi_check_system case insensitive?

On Mon, May 29, 2006 at 01:31:41AM -0400, Dmitry Torokhov wrote:
> Hi,
>
> I have a request to add entry for "LifeBook B Series" to lifebook driver to
> accomodate lifebook B2545, however we already have entry for "LIFEBOOK B
> Series" (used by some other model) which is not working. Would anyone
> be opposed making dmi_check_system() ignore string case? We would have to
> malloc/copy both strings and lowercase them before doing stsstr...

I think it's easier to just add the second entry. We're trying to
distinguish individual machines here, the fact that we have a single DMI
entry accomodating a whole series is an exception.

--
Vojtech Pavlik
Director SuSE Labs