Re: [PATCH v1 1/4] advice: add a function to set the value of an advice type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ben,

On Fri, 30 Jul 2021, Ben Boeckel wrote:

> This is setup for removing the `advice` global variables.

The idea to separate out this patch from the rest was probably to make
things easier to review.

However, without any callers of this function, I find it pretty hard to
review it.

My recommendation would be to move the addition of all the callers of this
function from 3/4 here (obviously without removing the assignments of the
global variables, that removal should stay with 3/4).

Ciao,
Dscho

>
> Signed-off-by: Ben Boeckel <mathstuf@xxxxxxxxx>
> ---
>  advice.c | 5 +++++
>  advice.h | 5 +++++
>  2 files changed, 10 insertions(+)
>
> diff --git a/advice.c b/advice.c
> index 0b9c89c48a..fd58631dc1 100644
> --- a/advice.c
> +++ b/advice.c
> @@ -187,6 +187,11 @@ int advice_enabled(enum advice_type type)
>  	}
>  }
>
> +void advice_set(enum advice_type type, int value)
> +{
> +	advice_setting[type].enabled = value;
> +}
> +
>  void advise_if_enabled(enum advice_type type, const char *advice, ...)
>  {
>  	va_list params;
> diff --git a/advice.h b/advice.h
> index bd26c385d0..74425a9f1a 100644
> --- a/advice.h
> +++ b/advice.h
> @@ -87,6 +87,11 @@ void advise(const char *advice, ...);
>   */
>  int advice_enabled(enum advice_type type);
>
> +/**
> + * Enable or disable advice of a certain kind.
> + */
> +void advice_set(enum advice_type type, int value);
> +
>  /**
>   * Checks the visibility of the advice before printing.
>   */
> --
> 2.31.1
>
>




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux