Attention is currently required from: Edward O'Callaghan, Angel Pons, Arthur Heymans, Anastasia Klimchuk.
5 comments:
Patchset:
I'm not convinced about unnecessary initialization. Want to have it
discussed at least once...
File jlink_spi.c:
Patch Set #1, Line 128: memset(buffer + writecnt, 0x00, readcnt);
I wonder why this is done at all.
File libflashrom.c:
Patch Set #1, Line 123: const char **supported_programmers = calloc(PROGRAMMER_INVALID + 1, sizeof(char *));
This is probably what the original author intended. IIRC, I left a comment
in Gerrit about this API (which is completely broken).
Patch Set #1, Line 144: calloc(flashchips_size, sizeof(*supported_flashchips));
Hmmm, I'm not convinced to initialize things that are supposed to be completely
overwritten later. I doubt that it's the case for calloc() but I know that some
static analysis tools complain about explicit but unnecessary initialization.
Failure to override all fields could be avoided, for instance, by using a
struct initializer below, e.g.
const struct flashrom_flashchip_info supported_flashchip = {
.vendor = flashchips[i].vendor,
/* ... */
};
supported_flashchips[i] = supported_flashchip;
File mstarddc_spi.c:
Patch Set #1, Line 83: uint8_t *cmd = malloc((writecnt + 1) * sizeof(uint8_t));
This is just `malloc(writecnt + 1);` AIUI.
To view, visit change 55269. To unsubscribe, or for help writing mail filters, visit settings.