All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: "D. Starke" <daniel.starke@siemens.com>
Cc: linux-serial <linux-serial@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/9] tty: n_gsm: fix unneeded initialization of ret in gsm_dlci_config
Date: Wed, 5 Apr 2023 11:23:09 +0300 (EEST)	[thread overview]
Message-ID: <2d67db22-3a5d-1ed7-cfa7-d549aa1475b@linux.intel.com> (raw)
In-Reply-To: <20230405054730.3850-4-daniel.starke@siemens.com>

On Wed, 5 Apr 2023, D. Starke wrote:

> From: Daniel Starke <daniel.starke@siemens.com>
> 
> The variable 'ret' is not used before assignment from gsm_activate_mux().
> Still it gets initialized to zero at declaration.
> 
> Fix this as remarked in the link below by removing the initialization.
> 
> Fixes: edd5f60c3400 ("tty: n_gsm: fix mux activation issues in gsm_config()")

This doesn't "fix" any bug so Fixes tag seems inappropriate unless does it 
fix a compiler warning (in which case you should quote the warning in 
this changelog and state you're fixing this warning from compiler)?

> Link: https://lore.kernel.org/all/b42bc4d1-cc9d-d115-c981-aaa053bdc59f@kernel.org/
> 
> Signed-off-by: Daniel Starke <daniel.starke@siemens.com>
> ---
>  drivers/tty/n_gsm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
> index eb21ca583642..d42b92cbae88 100644
> --- a/drivers/tty/n_gsm.c
> +++ b/drivers/tty/n_gsm.c
> @@ -3276,7 +3276,7 @@ static void gsm_copy_config_values(struct gsm_mux *gsm,
>  
>  static int gsm_config(struct gsm_mux *gsm, struct gsm_config *c)
>  {
> -	int ret = 0;
> +	int ret;

While at it, I'd move the declaration into the block where it's used so 
the scope where the variable is used is easier to see on the first glance.

>  	int need_close = 0;
>  	int need_restart = 0;
>  
> 


-- 
 i.


  reply	other threads:[~2023-04-05  8:23 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-05  5:47 [PATCH 1/9] tty: n_gsm: fix redundant assignment of gsm->encoding D. Starke
2023-04-05  5:47 ` [PATCH 2/9] tty: n_gsm: add restart parameter to DLC specific ioctl config D. Starke
2023-04-05  8:15   ` Ilpo Järvinen
2023-04-06  5:17     ` Starke, Daniel
2023-04-05  5:47 ` [PATCH 3/9] tty: n_gsm: add missing description to gsm_config D. Starke
2023-04-05  8:18   ` Ilpo Järvinen
2023-04-06  5:26     ` Starke, Daniel
2023-04-05  5:47 ` [PATCH 4/9] tty: n_gsm: fix unneeded initialization of ret in gsm_dlci_config D. Starke
2023-04-05  8:23   ` Ilpo Järvinen [this message]
2023-04-06  5:31     ` Starke, Daniel
2023-04-05  5:47 ` [PATCH 5/9] tty: n_gsm: add open_error counter to gsm_mux D. Starke
2023-04-05  8:41   ` Ilpo Järvinen
2023-04-06  5:42     ` Starke, Daniel
2023-04-05  5:47 ` [PATCH 6/9] tty: n_gsm: increase malformed counter for malformed control frames D. Starke
2023-04-05  8:44   ` Ilpo Järvinen
2023-04-06  5:45     ` Starke, Daniel
2023-04-05  5:47 ` [PATCH 7/9] tty: n_gsm: increase gsm_mux unsupported counted where appropriate D. Starke
2023-04-05  9:00   ` Ilpo Järvinen
2023-04-06  5:57     ` Starke, Daniel
2023-04-05  5:47 ` [PATCH 8/9] tty: n_gsm: add DLCI specific rx/tx statistics D. Starke
2023-04-05  9:13   ` Ilpo Järvinen
2023-04-06  6:02     ` Starke, Daniel
2023-04-05  5:47 ` [PATCH 9/9] tty: n_gsm: cleanup gsm_control_command and gsm_control_reply D. Starke
2023-04-05  9:15   ` Ilpo Järvinen
2023-04-06  6:04     ` Starke, Daniel
2023-04-05  8:16 ` [PATCH 1/9] tty: n_gsm: fix redundant assignment of gsm->encoding Ilpo Järvinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d67db22-3a5d-1ed7-cfa7-d549aa1475b@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=daniel.starke@siemens.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.