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. > > Haven't done a review of the rest of the code, but that just poped up to > my eyes. > Waiting for your feedback as well then. Thanks, Jan -- 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/e15ae1fe-bb19-c664-2821-4f63fc1c9f67%40siemens.com. For more options, visit https://groups.google.com/d/optout.
