On Mon, Feb 11, 2013 at 04:05:57PM +0000, Matt Fleming wrote: > > Egads, man... > > [snip the horror with copying the name] > > > > unsigned long hash = init_name_hash(); > > const unsigned char *s = qstr->name; > > int len = qstr->len; > > > > if (!efivarfs_valid_name(s, len)) > > return -EINVAL; > > while (len-- > GUID_LEN) > > hash = partial_name_hash(*s++, hash); > > /* GUID is case-insensitive. */ > > while (len--) > > hash = partial_name_hash(tolower(*s++), hash); > > return end_name_hash(hash); > > Oh, wow, yes that is much nicer. I didn't realise we could build the > hash incrementally like that. Very cool. ... except that it should end with qstr->hash = end_name_hash(hash); return 0; instead. My apologies. -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html