Attention is currently required from: Edward O'Callaghan, Angel Pons.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/52256 )
Change subject: ft2232_spi.c: Refactor singleton states into reentrant pattern
......................................................................
Patch Set 3:
(4 comments)
Patchset:
PS3:
thank you for review!
File ft2232_spi.c:
https://review.coreboot.org/c/flashrom/+/52256/comment/813ce735_4a12d818
PS2, Line 614: spi_data = calloc(1, sizeof(struct ft2232_data));
> Can calloc() fail?
yes of course, this is my miss
https://review.coreboot.org/c/flashrom/+/52256/comment/a9517581_a9871abd
PS2, Line 614: sizeof(struct ft2232_data)
> Using type names in sizeof() is discouraged. […]
Thank you! This now looks even better.
I will remember this for future.
https://review.coreboot.org/c/flashrom/+/52256/comment/f9181a13_21d05198
PS2, Line 617: memcpy(&spi_data->ftdic_context, &ftdic, sizeof(struct ftdi_context));
> It should be possible to do a direct assignment: […]
Direct assignment seems to work.
--
To view, visit https://review.coreboot.org/c/flashrom/+/52256
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I67518a58b4f35e0edaf06ac09c9374bdf06db0df
Gerrit-Change-Number: 52256
Gerrit-PatchSet: 3
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Mon, 12 Apr 2021 21:23:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: comment
Attention is currently required from: Edward O'Callaghan, Anastasia Klimchuk.
Hello build bot (Jenkins), Edward O'Callaghan, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/52256
to look at the new patch set (#3).
Change subject: ft2232_spi.c: Refactor singleton states into reentrant pattern
......................................................................
ft2232_spi.c: Refactor singleton states into reentrant pattern
Move global singleton states into a struct and store within
the spi_master data field for the life-time of the driver.
This is one of the steps on the way to move spi_master data
memory management behind the initialisation API, for more
context see other patches under the same topic "register_master_api".
TEST=builds
BUG=b:140394053
Change-Id: I67518a58b4f35e0edaf06ac09c9374bdf06db0df
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M ft2232_spi.c
1 file changed, 57 insertions(+), 34 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/56/52256/3
--
To view, visit https://review.coreboot.org/c/flashrom/+/52256
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I67518a58b4f35e0edaf06ac09c9374bdf06db0df
Gerrit-Change-Number: 52256
Gerrit-PatchSet: 3
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: Jack Rosenthal.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/52215 )
Change subject: linux_mtd: prevent corruption of flash when stdout/stderr is closed
......................................................................
Patch Set 1:
(1 comment)
File linux_mtd.c:
https://review.coreboot.org/c/flashrom/+/52215/comment/bf7a01c5_8ac7cc44
PS1, Line 357: * least try.
Note: This message would probably get printed properly when using the `-o` command-line option (if available).
(No action required here)
--
To view, visit https://review.coreboot.org/c/flashrom/+/52215
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I751c9dd88ad1d30283b94bd2185b4f8f25569c8f
Gerrit-Change-Number: 52215
Gerrit-PatchSet: 1
Gerrit-Owner: Jack Rosenthal <jrosenth(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Jack Rosenthal <jrosenth(a)chromium.org>
Gerrit-Comment-Date: Mon, 12 Apr 2021 18:16:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Jack Rosenthal.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/52215 )
Change subject: linux_mtd: prevent corruption of flash when stdout/stderr is closed
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
Patchset:
PS1:
I don't know about POSIX, but if `stdout`/`stderr` from `stdio.h`
are not what they are supposed to be, it's not C :)
Can you add some more details what actually led to the situation?
Maybe other people can learn from it ;) Or maybe there's even
something to fix in your libc.
Generally, as this seems to be a problem of the CLI (flashrom_
print_cb() using stdout/stderr I guess), I'd prefer a patch for
the CLI, e.g. check if fstat() works on them or something like
that. Other programmers might suffer the same.
--
To view, visit https://review.coreboot.org/c/flashrom/+/52215
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I751c9dd88ad1d30283b94bd2185b4f8f25569c8f
Gerrit-Change-Number: 52215
Gerrit-PatchSet: 1
Gerrit-Owner: Jack Rosenthal <jrosenth(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Jack Rosenthal <jrosenth(a)chromium.org>
Gerrit-Comment-Date: Mon, 12 Apr 2021 18:11:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Edward O'Callaghan, Anastasia Klimchuk.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/52256 )
Change subject: ft2232_spi.c: Refactor singleton states into reentrant pattern
......................................................................
Patch Set 2: Code-Review+1
(3 comments)
File ft2232_spi.c:
https://review.coreboot.org/c/flashrom/+/52256/comment/b07653d7_87d2ccf3
PS2, Line 614: spi_data = calloc(1, sizeof(struct ft2232_data));
Can calloc() fail?
https://review.coreboot.org/c/flashrom/+/52256/comment/4d550236_40623ecf
PS2, Line 614: sizeof(struct ft2232_data)
Using type names in sizeof() is discouraged. If someone retypes `spi_data`, this sizeof() would also need to be updated to avoid problems, but it's easy to miss it because this sizeof() is almost 300 lines away from the `spi_data` definition.
Instead, one can apply sizeof() to variables. In this case, since `spi_data` is a pointer, `sizeof(spi_data)` would return the size of a pointer. It is possible to "dereference" it in order to obtain the size of the data it points to. This works even if the pointer is NULL, as sizeof() only cares about the type.
TL;DR: You can and should use this as the size argument for calloc():
sizeof(*spi_data)
https://review.coreboot.org/c/flashrom/+/52256/comment/5fe77ebf_de3696ee
PS2, Line 617: memcpy(&spi_data->ftdic_context, &ftdic, sizeof(struct ftdi_context));
It should be possible to do a direct assignment:
spi_data->ftdic_context = ftdic;
If it doesn't work, I'm fine with keeping the memcpy(). However, please use `sizeof(ftdic)` for the length argument (see comment above).
--
To view, visit https://review.coreboot.org/c/flashrom/+/52256
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I67518a58b4f35e0edaf06ac09c9374bdf06db0df
Gerrit-Change-Number: 52256
Gerrit-PatchSet: 2
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Mon, 12 Apr 2021 08:28:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Peter Marheine.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/51967 )
Change subject: lspcon_i2c_spi: support a devpath option
......................................................................
Patch Set 3: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/51967
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Id2adf8a307b9205ce5e5804a6c3e22f19d0c34c9
Gerrit-Change-Number: 51967
Gerrit-PatchSet: 3
Gerrit-Owner: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Daniel Campello <campello(a)chromium.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Comment-Date: Mon, 12 Apr 2021 08:08:52 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Anastasia Klimchuk.
Hello build bot (Jenkins), Edward O'Callaghan,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/52256
to look at the new patch set (#2).
Change subject: ft2232_spi.c: Refactor singleton states into reentrant pattern
......................................................................
ft2232_spi.c: Refactor singleton states into reentrant pattern
Move global singleton states into a struct and store within
the spi_master data field for the life-time of the driver.
This is one of the steps on the way to move spi_master data
memory management behind the initialisation API, for more
context see other patches under the same topic "register_master_api".
TEST=builds
BUG=b:140394053
Change-Id: I67518a58b4f35e0edaf06ac09c9374bdf06db0df
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M ft2232_spi.c
1 file changed, 53 insertions(+), 34 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/56/52256/2
--
To view, visit https://review.coreboot.org/c/flashrom/+/52256
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I67518a58b4f35e0edaf06ac09c9374bdf06db0df
Gerrit-Change-Number: 52256
Gerrit-PatchSet: 2
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: newpatchset