Re: [PATCH V2 1/6] rtla/osnoise: Add helper functions to manipulate osnoise/options

From: Steven Rostedt
Date: Wed Feb 01 2023 - 14:25:42 EST


On Tue, 31 Jan 2023 17:30:02 +0100
Daniel Bristot de Oliveira <bristot@xxxxxxxxxx> wrote:

> +#define OSNOISE_OPTION(name, option_str) \
> +static int osnoise_get_##name(struct osnoise_context *context) \
> +{ \
> + if (context->opt_##name != OSNOISE_OPTION_INIT_VAL) \
> + return context->opt_##name; \
> + \
> + if (context->orig_opt_##name != OSNOISE_OPTION_INIT_VAL) \
> + return context->orig_opt_##name; \
> + \
> + context->orig_opt_##name = osnoise_options_get_option(option_str); \
> + \
> + return context->orig_opt_##name; \
> +} \
> + \

What you could have done is not make this into a super macro (as there's
only one instance of it). And then add a patch that turns it into this
macro as the first patch of a series that adds another user.

Because I don't understand why this exists when it only has one user.

-- Steve