If C supported algebraic data types, the issue not specified vs. zero would be easy to solve; that would just be some sort of sum type. But yeah, this definitely is a problem in the current code base, but I haven't gotten around to think about a proper generic solution.
Often the default option is chosen to be zero, so that only things that are non-default need to be specified; this might not really work here though, since quite a few options are not booleans. An idea would be to introduce another setting (maybe do_pme_init) and only call f71808a_pme_init if this setting is true/1. Sure, this isn't the nicest solution, but it would reduce the the chance of breaking things for existing boards.

View Change

2 comments:

To view, visit change 32376. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I5d8008176d2972976b387c558658b8e70b50af8e
Gerrit-Change-Number: 32376
Gerrit-PatchSet: 4
Gerrit-Owner: Max Blau
Gerrit-Reviewer: Felix Held <felix-coreboot@felixheld.de>
Gerrit-Reviewer: Martin Roth <martinroth@google.com>
Gerrit-Reviewer: Max Blau
Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Patrick Rudolph <siro@das-labor.org>
Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-Comment-Date: Thu, 25 Apr 2019 16:45:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Max Blau
Gerrit-MessageType: comment