On 2017-11-06 13:23, Claudius Heine wrote: > Hi, > > On 11/06/2017 12:51 PM, Jan Kiszka wrote: >> On 2017-11-06 12:49, Claudius Heine wrote: >>> Hi, >>> >>> On 11/06/2017 12:29 PM, [ext] Jan Kiszka wrote: >>>> On 2017-11-03 16:55, [ext] Andreas J. Reichel wrote: >>>>> From: Andreas Reichel <[email protected]> >>>>> >>>>> Store user variable types as uint64_t instead of a string. This >>>>> enables >>>>> the possibility of definint flags. Flags are used to delete a user >>>>> variable (to destinguish between setting it empty or removing it) >>>>> and to >>>>> mark variables with special properties. This will be used in a >>>>> following >>>>> commit to define global user variables. >>>>> >>>>> Bits 0..31 are reserved for standard datatype definitions, >>>>> bits 32..48 are reserved for user defined datatypes or flags, >>>>> bits 49..63 are reserved for internal flags. >>>>> >>>>> Signed-off-by: Andreas Reichel <[email protected]> >>>> >>>> ... >>>> >>>>> @@ -367,17 +361,18 @@ static error_t parse_opt(int key, char *arg, >>>>> struct argp_state *state) >>>>> static void dump_uservars(uint8_t *udata) >>>>> { >>>>> - char *key, *value, *type; >>>>> + char *key, *value; >>>>> + uint64_t type; >>>>> uint32_t rsize, dsize; >>>>> while (*udata) { >>>>> bgenv_map_uservar(udata, &key, &type, (uint8_t **)&value, >>>>> &rsize, &dsize); >>>>> printf("%s ", key); >>>>> - if (strcmp(type, USERVAR_TYPE_DEFAULT) == 0) { >>>>> + if ((type & 0x00000000FFFFFFFF) == >>>>> USERVAR_TYPE_STRING_ASCII) { >>> >>> Now when I see this I think that might be better and shorter written >>> like this: >>> >>> 1 << 32 - 1 >> >> (1 << 32) - 1 then, to make it clearer. > > Yes, you are right. Some type information/casts could be necessary as well.
Maybe #define USERVAR_STANDARD_TYPE_MASK ((1UL << 32) - 1) ? Jan > > Rest of this patch looks good to me. > > Cheers, > Claudius > -- Siemens AG, Corporate Technology, CT RDA ITP SES-DE Corporate Competence Center Embedded Linux -- You received this message because you are subscribed to the Google Groups "EFI Boot Guard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/efibootguard-dev/15b4d166-a0ee-6eea-8b62-5edd9103aacb%40siemens.com. For more options, visit https://groups.google.com/d/optout.
