Re: [PATCH] efivarfs: fix abnormal GUID in variable name by usingstrcpy to replace null with dash

From: joeyli
Date: Thu Mar 07 2013 - 03:05:22 EST


æ äï2013-03-06 æ 17:20 +0800ïLingzhu Xiang æåï
> On 03/06/2013 03:34 PM, joeyli wrote:
> > +static unsigned long variable_name_length(efi_char16_t *variable_name)
> > +{
> > + unsigned long len;
> > + efi_char16_t c;
> > +
> > + len = 2;
> > + do {
> > + c = variable_name[len / sizeof(c) - 1];
> > + if (c)
> > + len += sizeof(c);
> > + } while (c);
> > +
> > + return len;
> > +}
> > +
>
> It looks like this function can be replaced with utf16_strsize.
>

Ah! thanks for you point out, I will use utf16_strsize.


Thanks a lot!
Joey Lee


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/