From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex G. Date: Mon, 21 Dec 2020 11:43:54 -0600 Subject: [PATCH 7/8] spl: fit: Replace #ifdef blocks with more readable constructs In-Reply-To: References: <20201216000944.2832585-1-mr.nuke.me@gmail.com> <20201216000944.2832585-8-mr.nuke.me@gmail.com> Message-ID: <6fbf45ca-449a-e39a-390a-9be9d37c68a6@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 12/18/20 8:29 PM, Simon Glass wrote: > On Tue, 15 Dec 2020 at 17:10, Alexandru Gagniuc wrote: >> >> Use the IS_ENABLED() macro to control code flow, instead of the >> caveman approach of sprinkling #ifdefs. Code size is not affected, as >> the linker garbage-collects unused functions. However, readability is >> improved significantly. >> >> Signed-off-by: Alexandru Gagniuc >> --- >> common/spl/spl_fit.c | 53 ++++++++++++++++++++------------------------ >> 1 file changed, 24 insertions(+), 29 deletions(-) > > I am trying to imagine stick drawings with #ifdefs > #ifdef #if #if #if #if #if #if #if #if #endif #if #if #if #if #if #if #if #if #if #if #if #if #ifdef #endif #endif #endif #endif #endif #endif #endif #endif #endif #endif #endif #endif #endif #endif #endif #endif #endif #ifdef #if #if #if #if #if #if #if #if #endif #endif > Reviewed-by: Simon Glass >