Attention is currently required from: Anastasia Klimchuk, Peter Marheine, Richard Hughes.
Sergii Dmytruk has posted comments on this change by Anastasia Klimchuk. ( https://review.coreboot.org/c/flashrom/+/86031?usp=email )
Change subject: libflashrom: Update the API for progress callback
......................................................................
Patch Set 3:
(1 comment)
File include/libflashrom.h:
https://review.coreboot.org/c/flashrom/+/86031/comment/1ad6f14b_fa159f40?us… :
PS2, Line 90: * @deprecated Use flashrom_set_progress_callback_v1 instead
> Half of this was forgetting, but other half that I haven't done changes on the live API before. […]
Well, it's not backwards compatible for sure. Applications using the library will build, but won't work and there is no guarantee that the message will be noticed.
It depends whether API is supposed to remain compatible. If so, I think it can be done by storing 2 callbacks, but at most one of them could be active at a time.
--
To view, visit https://review.coreboot.org/c/flashrom/+/86031?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Ia8cc0461c449b7e65888a64cdc594c55b81eae7a
Gerrit-Change-Number: 86031
Gerrit-PatchSet: 3
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Richard Hughes <richard(a)hughsie.com>
Gerrit-Reviewer: Sergii Dmytruk <sergii.dmytruk(a)3mdeb.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Richard Hughes <richard(a)hughsie.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Comment-Date: Fri, 31 Jan 2025 19:39:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Comment-In-Reply-To: Sergii Dmytruk <sergii.dmytruk(a)3mdeb.com>
Attention is currently required from: Peter Marheine, Richard Hughes, Sergii Dmytruk.
Anastasia Klimchuk has posted comments on this change by Anastasia Klimchuk. ( https://review.coreboot.org/c/flashrom/+/86031?usp=email )
Change subject: libflashrom: Update the API for progress callback
......................................................................
Patch Set 3:
(4 comments)
File include/libflashrom.h:
https://review.coreboot.org/c/flashrom/+/86031/comment/d96b9adf_ed0ce2fe?us… :
PS2, Line 90: * @deprecated Use flashrom_set_progress_callback_v1 instead
> Deprecation is when the thing remains accessible, but I don't see implementation of `flashrom_set_pr […]
Half of this was forgetting, but other half that I haven't done changes on the live API before. I can see now that was a missing piece, I added the implementation.
The third half is however, that it is not possible to implement the old method now because callback fn has changed. So my implementation is now just prints an error (but at least, there is an implementation). Would you say it is acceptable?
https://review.coreboot.org/c/flashrom/+/86031/comment/05beae07_93394a8d?us… :
PS2, Line 101: void* user_data);
> nit: the changes have inconsistent formatting of pointers (space is either before or after an asteri […]
Done
https://review.coreboot.org/c/flashrom/+/86031/comment/73746bd4_1539e763?us… :
PS2, Line 113: void flashrom_set_progress_callback_v1(struct flashrom_flashctx *const flashctx,
> Isn't this `v2`? E.g., Linux has `openat()` and `openat2()` syscalls.
Yes I agree with v2, this makes sense thank you!
updated everywhere from v1 -> v2
File include/libflashrom.h:
https://review.coreboot.org/c/flashrom/+/86031/comment/507d1b18_2aec95ff?us… :
PS1, Line 93: __attribute__((deprecated("Use flashrom_set_progress_callback_v1 instead")));
> It might make the most sense just to go ahead with deprecated, and adjust if anybody discovers a compiler they want to use that doesn't understand it.
Yes this makes sense. I followed your advice and left deprecated as it was.
--
To view, visit https://review.coreboot.org/c/flashrom/+/86031?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Ia8cc0461c449b7e65888a64cdc594c55b81eae7a
Gerrit-Change-Number: 86031
Gerrit-PatchSet: 3
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Richard Hughes <richard(a)hughsie.com>
Gerrit-Reviewer: Sergii Dmytruk <sergii.dmytruk(a)3mdeb.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Richard Hughes <richard(a)hughsie.com>
Gerrit-Attention: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Attention: Sergii Dmytruk <sergii.dmytruk(a)3mdeb.com>
Gerrit-Comment-Date: Fri, 31 Jan 2025 09:35:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Comment-In-Reply-To: Peter Marheine <pmarheine(a)chromium.org>
Comment-In-Reply-To: Sergii Dmytruk <sergii.dmytruk(a)3mdeb.com>
Attention is currently required from: Anastasia Klimchuk, Richard Hughes.
Hello Peter Marheine, Richard Hughes, Sergii Dmytruk, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/86031?usp=email
to look at the new patch set (#3).
The following approvals got outdated and were removed:
Verified+1 by build bot (Jenkins)
Change subject: libflashrom: Update the API for progress callback
......................................................................
libflashrom: Update the API for progress callback
The initial version of API for progress callback would require the
callback function to make a second call to get the needed data about
progress state (current, total etc).
This patch changes the callback API, so that callback function gets
all needed data straight away as parameters, and with this,
callback has all the data to do its job.
Since the initial version was submitted and it was in the tree for a
while, the change needs to add a _v1 suffix for new thing and
deprecated attribute for old thing.
Testing: both unit tests and cli are libflashrom clients.
All unit tests run successfully, for the cli all scenarios from
commit 75dc0655b95dde91f1426a7e5aecfc04d7b8d631 run successfully.
Change-Id: Ia8cc0461c449b7e65888a64cdc594c55b81eae7a
Signed-off-by: Anastasia Klimchuk <aklm(a)flashrom.org>
---
M cli_classic.c
M cli_output.c
M include/cli_output.h
M include/flash.h
M include/libflashrom.h
M libflashrom.c
M libflashrom.map
M tests/chip.c
M tests/spi25.c
9 files changed, 76 insertions(+), 68 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/31/86031/3
--
To view, visit https://review.coreboot.org/c/flashrom/+/86031?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Ia8cc0461c449b7e65888a64cdc594c55b81eae7a
Gerrit-Change-Number: 86031
Gerrit-PatchSet: 3
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Richard Hughes <richard(a)hughsie.com>
Gerrit-Reviewer: Sergii Dmytruk <sergii.dmytruk(a)3mdeb.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Richard Hughes <richard(a)hughsie.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Attention is currently required from: Anastasia Klimchuk, Richard Hughes.
Sergii Dmytruk has posted comments on this change by Anastasia Klimchuk. ( https://review.coreboot.org/c/flashrom/+/86031?usp=email )
Change subject: libflashrom: Update the API for progress callback
......................................................................
Patch Set 2:
(3 comments)
File include/libflashrom.h:
https://review.coreboot.org/c/flashrom/+/86031/comment/fb624ba7_052a4062?us… :
PS2, Line 90: * @deprecated Use flashrom_set_progress_callback_v1 instead
Deprecation is when the thing remains accessible, but I don't see implementation of `flashrom_set_progress_callback()` anywhere. Did you forget to do it? The symbol in the `.map` file suggests this.
https://review.coreboot.org/c/flashrom/+/86031/comment/965b80e4_f0ffba5a?us… :
PS2, Line 101: void* user_data);
nit: the changes have inconsistent formatting of pointers (space is either before or after an asterisk).
https://review.coreboot.org/c/flashrom/+/86031/comment/995e07df_f71aa666?us… :
PS2, Line 113: void flashrom_set_progress_callback_v1(struct flashrom_flashctx *const flashctx,
Isn't this `v2`? E.g., Linux has `openat()` and `openat2()` syscalls.
--
To view, visit https://review.coreboot.org/c/flashrom/+/86031?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Ia8cc0461c449b7e65888a64cdc594c55b81eae7a
Gerrit-Change-Number: 86031
Gerrit-PatchSet: 2
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Richard Hughes <richard(a)hughsie.com>
Gerrit-Reviewer: Sergii Dmytruk <sergii.dmytruk(a)3mdeb.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Richard Hughes <richard(a)hughsie.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Tue, 28 Jan 2025 14:39:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: Anastasia Klimchuk, Richard Hughes, Sergii Dmytruk.
Peter Marheine has posted comments on this change by Anastasia Klimchuk. ( https://review.coreboot.org/c/flashrom/+/86031?usp=email )
Change subject: libflashrom: Update the API for progress callback
......................................................................
Patch Set 2:
(1 comment)
File include/libflashrom.h:
https://review.coreboot.org/c/flashrom/+/86031/comment/54151e08_ffd27bc8?us… :
PS1, Line 93: __attribute__((deprecated("Use flashrom_set_progress_callback_v1 instead")));
> I couldn't do it, got confused along the way - maybe I just went into the wrong rabbit hole? […]
I think we'd have to look at preprocessor symbols that tell us about the compiler and version, if anything. At this point it's probably safe to assume any reasonable version of GCC or Clang supports the `deprecated` attribute, but if there's any other compiler lurking out there that we might care about it might need special handling.
It might make the most sense just to go ahead with `deprecated`, and adjust if anybody discovers a compiler they want to use that doesn't understand it.
--
To view, visit https://review.coreboot.org/c/flashrom/+/86031?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Ia8cc0461c449b7e65888a64cdc594c55b81eae7a
Gerrit-Change-Number: 86031
Gerrit-PatchSet: 2
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Richard Hughes <richard(a)hughsie.com>
Gerrit-Reviewer: Sergii Dmytruk <sergii.dmytruk(a)3mdeb.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Richard Hughes <richard(a)hughsie.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Sergii Dmytruk <sergii.dmytruk(a)3mdeb.com>
Gerrit-Comment-Date: Tue, 28 Jan 2025 00:01:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Comment-In-Reply-To: Peter Marheine <pmarheine(a)chromium.org>
Attention is currently required from: Peter Marheine, Richard Hughes, Sergii Dmytruk.
Anastasia Klimchuk has posted comments on this change by Anastasia Klimchuk. ( https://review.coreboot.org/c/flashrom/+/86031?usp=email )
Change subject: libflashrom: Update the API for progress callback
......................................................................
Patch Set 2:
(1 comment)
File include/libflashrom.h:
https://review.coreboot.org/c/flashrom/+/86031/comment/2942451c_31f5532c?us… :
PS1, Line 93: __attribute__((deprecated("Use flashrom_set_progress_callback_v1 instead")));
I couldn't do it, got confused along the way - maybe I just went into the wrong rabbit hole?
I don't know how to guard around because,
`#ifdef __attribute__` is always false
`__has_c_attribute` is also compiler-specific
I understand that more than one compiler supports `__attribute__` , so guarding for only one specific compiler is too restrictive.
On the other hand, we have `__attribute__` in other places in the tree already (flash.h, fmap.h, raiden_debug_spi.c, udelay_dos.c).
I tried what the difference is:
with __attribute__((deprecated , attempt to use old method gives a build-time error
without __attribute__((deprecated , same attempt gives a link-time error
> Apparently [[deprecated]] is standard since C23 as well, but is probably much too new to use right now.
I agree that's too new, I remember contributor made a patch to be able to build without C23.
--
To view, visit https://review.coreboot.org/c/flashrom/+/86031?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Ia8cc0461c449b7e65888a64cdc594c55b81eae7a
Gerrit-Change-Number: 86031
Gerrit-PatchSet: 2
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Richard Hughes <richard(a)hughsie.com>
Gerrit-Reviewer: Sergii Dmytruk <sergii.dmytruk(a)3mdeb.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Richard Hughes <richard(a)hughsie.com>
Gerrit-Attention: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Attention: Sergii Dmytruk <sergii.dmytruk(a)3mdeb.com>
Gerrit-Comment-Date: Sat, 25 Jan 2025 11:10:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Peter Marheine <pmarheine(a)chromium.org>