Re: [PATCH v1 2/2] usb: typec: tcpm: Add module parameter to wrap around logs
From: Greg Kroah-Hartman
Date: Tue May 18 2021 - 09:31:31 EST
On Mon, May 17, 2021 at 04:36:09PM -0700, Badhri Jagan Sridharan wrote:
> When the buffer is full, TCPM stops logging into the buffer.
> This change adds log_wraparound module parameter which when set
> flushes out the oldest log entries (FIFO) to make way for the
> newer ones.
>
> Signed-off-by: Badhri Jagan Sridharan <badhri@xxxxxxxxxx>
> ---
> drivers/usb/typec/tcpm/tcpm.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index b79194919b27..a369decade60 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -38,6 +38,10 @@ static bool modparam_log_misc_dev;
> module_param_named(log_misc_dev, modparam_log_misc_dev, bool, 0444);
> MODULE_PARM_DESC(log_misc_dev, "Expose tcpm logs through misc device");
>
> +static bool modparam_log_wraparound;
> +module_param_named(log_wraparound, modparam_log_wraparound, bool, 0444);
> +MODULE_PARM_DESC(log_wraparound, "Wrap around logs");
Again, no, this we know better than to add new module parameters, this
is not ok.
greg k-h