Andrey Petrov has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38548 )
Change subject: soc/intel: Add Intel Xeon Scalable Processor support
......................................................................
Patch Set 47:
(2 comments)
https://review.coreboot.org/c/coreboot/+/38548/46/src/soc/intel/xeon_sp/chip...
File src/soc/intel/xeon_sp/chip.c:
https://review.coreboot.org/c/coreboot/+/38548/46/src/soc/intel/xeon_sp/chip...
PS46, Line 432: struct iiostack_resource stack_info;
let's zero-initialize this without calling memset:
struct iiostack_resource stack_info = { 0 };
https://review.coreboot.org/c/coreboot/+/38548/46/src/soc/intel/xeon_sp/chip...
PS46, Line 446: stack_info.sres
it looks like we are malloc()'ing stack_info.sres in get_iiostack_info() called above, and then freeing it here. It sounds like we can drop dynamic memory management here.
I think this can be simplified like this:
struct iiostack_resource {
size_t no_of_stacks;
STACK_RES res[MAX_IIO_STACK];
};
struct iiostack_resource stack_info = {0};
get_iiostack_info(&stack_info);
// do whatever work is needed
This way you can get rid of malloc(), free() and memset()
--
To view, visit
https://review.coreboot.org/c/coreboot/+/38548
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Idc9c3bee17caf8b4841f0bc190cb1aa9d38fc23e
Gerrit-Change-Number: 38548
Gerrit-PatchSet: 47
Gerrit-Owner: Jonathan Zhang
jonzhang@fb.com
Gerrit-Reviewer: Angel Pons
th3fanbus@gmail.com
Gerrit-Reviewer: Anjaneya "Reddy" Chagam
anjaneya.chagam@intel.com
Gerrit-Reviewer: David Hendricks
david.hendricks@gmail.com
Gerrit-Reviewer: HAOUAS Elyes
ehaouas@noos.fr
Gerrit-Reviewer: Johnny Lin
Gerrit-Reviewer: Jonathan Zhang
jonzhang@fb.com
Gerrit-Reviewer: Martin Roth
martinroth@google.com
Gerrit-Reviewer: Patrick Georgi
pgeorgi@google.com
Gerrit-Reviewer: Patrick Rudolph
siro@das-labor.org
Gerrit-Reviewer: build bot (Jenkins)
no-reply@coreboot.org
Gerrit-CC: Aaron Durbin
adurbin@chromium.org
Gerrit-CC: Andrey Petrov
anpetrov@fb.com
Gerrit-CC: Jingle Hsu
Gerrit-CC: Maxim Polyakov
max.senia.poliak@gmail.com
Gerrit-CC: Michał Żygowski
michal.zygowski@3mdeb.com
Gerrit-CC: Morgan Jang
Gerrit-CC: Nico Huber
nico.h@gmx.de
Gerrit-CC: Patrick Rudolph
Gerrit-CC: Paul Menzel
paulepanter@users.sourceforge.net
Gerrit-Comment-Date: Thu, 27 Feb 2020 06:08:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment