Message ID | 20230405054730.3850-4-daniel.starke@siemens.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp85422vqo; Tue, 4 Apr 2023 23:09:29 -0700 (PDT) X-Google-Smtp-Source: AKy350aSsfBQsEGNx3GOVYAM+kpDuU/NWpNxds6PtFcnF/ViL60QuivUiuFBepC7oxKvVHA3N1HX X-Received: by 2002:a17:902:e549:b0:1a0:67ef:dc61 with SMTP id n9-20020a170902e54900b001a067efdc61mr6107416plf.17.1680674968736; Tue, 04 Apr 2023 23:09:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680674968; cv=none; d=google.com; s=arc-20160816; b=UrBgRzmIyITZFa0K0a8v26yROQvIpQWvSdnQVj3sM0vVwQtYo5ZrUmbbc+QEU7yjKY do7LioapuawIssuAholIc7xMsCpiRxpdqeekR6LfRPgVJIVHoOBdUjp2mjeVUDF8y+lT x00msnKMXreMWk2Z6+okFv5+FkebilhqPM1/slNmXj2PCpOoe4Ha08E04fV7N7XeAp0i PRteKUF2GIRAwTOC9wDC+jwOOefl4LepXi+NxV4ZYwaDLyPEZuIH+/dKCoE4Efz/wM6J gj+lgsYGuzMjXokbjsNRUGLluSn/PCkttpIHrLnqaNsQYcNops8t7vZbgl4or3yxmqSy YFjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xxgQqLsGOzLe4pCbEfkz/EaZ+wxQSNX7N39w6RgURFA=; b=yotuDck2Xnzm61HxGp2FziKatbygStWKaTbFKoRs4PQYQR3mIRjXQamZu+IyAKYmZv 0U3ZZf6SI+hQ12VP3wbqKEKOrOw4NX5m8HaNWUrQRuyrhh1pdCmpn/SiRo1RDMn9TaqP ORiHewAQJdkgeENKPWZgWaG7w2xYpcOoyBsgTAvjOKfJ37WcfhWDUg/QZYbQrdk3HZNe 1/wVq2r5nYqJl+C+x2YPu/atvMmmRKwuBZZ0ZdHpBGMbpJ4P+PraHa6qJyhgrIqC2n2h BUTaMAi4n7uwerLCzmrt+LISzQZ4W/twQ5W/f8YKfqfCSWr0uocqz0YU+lH240YKrxix dMzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=eZ3I4zrv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kb8-20020a170903338800b001a19b69c7ebsi11447169plb.345.2023.04.04.23.09.16; Tue, 04 Apr 2023 23:09:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=eZ3I4zrv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236933AbjDEFs5 (ORCPT <rfc822;lkml4gm@gmail.com> + 99 others); Wed, 5 Apr 2023 01:48:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236791AbjDEFsp (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 5 Apr 2023 01:48:45 -0400 Received: from mta-65-227.siemens.flowmailer.net (mta-65-227.siemens.flowmailer.net [185.136.65.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 163FE1FF9 for <linux-kernel@vger.kernel.org>; Tue, 4 Apr 2023 22:48:41 -0700 (PDT) Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 2023040505484057848010262370f28e for <linux-kernel@vger.kernel.org>; Wed, 05 Apr 2023 07:48:40 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=daniel.starke@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=xxgQqLsGOzLe4pCbEfkz/EaZ+wxQSNX7N39w6RgURFA=; b=eZ3I4zrvFPqu1M2TRu3krk2dat6R4RsYQhkGqaGoZg8Dz6mJCvbWnek5gvnvQgcjpjAr2r bTRBnWepQHm+WBIGdWQ4PLzvhZn31PC0F9cp62IHtxLXazhDtRCbaI7ueuveVH6am0Qj7Hi+ s6ni7+kz2sNpWRjDVWYpZGbw0OQ4I=; From: "D. Starke" <daniel.starke@siemens.com> To: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, ilpo.jarvinen@linux.intel.com Cc: linux-kernel@vger.kernel.org, Daniel Starke <daniel.starke@siemens.com> Subject: [PATCH 4/9] tty: n_gsm: fix unneeded initialization of ret in gsm_dlci_config Date: Wed, 5 Apr 2023 07:47:25 +0200 Message-Id: <20230405054730.3850-4-daniel.starke@siemens.com> In-Reply-To: <20230405054730.3850-1-daniel.starke@siemens.com> References: <20230405054730.3850-1-daniel.starke@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-314044:519-21489:flowmailer X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762315436278457778?= X-GMAIL-MSGID: =?utf-8?q?1762315436278457778?= |
Series |
[1/9] tty: n_gsm: fix redundant assignment of gsm->encoding
|
|
Commit Message
D. Starke
April 5, 2023, 5:47 a.m. UTC
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()") 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(-)
Comments
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; > >
> > 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)? No, it does not change any compiler warning. I will remove the tag. > > 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. I will move it accordingly. Best regards, Daniel Starke
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; int need_close = 0; int need_restart = 0;