Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1302968ybp; Wed, 9 Oct 2019 11:56:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwT909ohJITuGNmwhsriNJa7w25ENmo46uGzxOFxq0knhS8/b/48pRbfmjxarvxyGHiThWC X-Received: by 2002:aa7:ce94:: with SMTP id y20mr4339973edv.189.1570647379576; Wed, 09 Oct 2019 11:56:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570647379; cv=none; d=google.com; s=arc-20160816; b=DiOa1hU7fXrk5J2VvmK/gNSfya6raFSDiliI6xeTuIze5UMBNi3SP992qjpmmEm4M1 TkFzzsKteyWxG+HW/JyQNatdrzs+eNa4yxx9F5f2WJFZpCcL8IVh4Qs0LTFisMRpWhvZ 2W7sXcEFI6ySlUAavbkE6mPDA1QEOj3xWdUEm0goParPV5AIlxsmGqgSPYyQ9r1zvP05 HyKvJCz/0cle05MSq1XErLj+6jnOyb1J66OiqR3Qy/smDbT5XL5BP7UbOr3ykAE5x8xV 8rNCyBi1/guRfAI01bUq8ovs/XiRXnOFtFaZoWZLHFECy9P3mudRonGZf7PbJ8raaxZM lMLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=IAU6fXxVaSLsCEP/EfazHOYGKhvSit3kIAdu9JJbXqU=; b=KKm9ycTXxSSohJRY33ziSik9VHvsS3CmcLAbRvkPJibbaoSIpFq4vW0zwoRWPhlUJy +pFibpgLnAvprqzJS+sqnVXNxJq6oiUWuSeEyUq4F0ypOkhmLP1fiWaTUtTIfoJP4H1J 82j5K1TvgFzVbHmPc42sq20abQl/DIWvBKlvraLMmatfNNAun+QV7Wb1d+deYfvHz/7P nf3IKJ+paem6F1bnzT8PQdnfl2ePs7Dov0j9XMKjRdWNQTpOtRCk7GGTAlrk9Oe7bUcb viYiiWyz3Peu8zbg9lIfQpz0BGonl+fSdZlSZ99sydEtdYElc51d6SO7gQ39YMaGk5tC UoVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t18si1557474eju.329.2019.10.09.11.55.56; Wed, 09 Oct 2019 11:56:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731589AbfJISzK (ORCPT + 99 others); Wed, 9 Oct 2019 14:55:10 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:65467 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729535AbfJISzK (ORCPT ); Wed, 9 Oct 2019 14:55:10 -0400 X-IronPort-AV: E=Sophos;i="5.67,277,1566856800"; d="scan'208";a="405482097" Received: from 81-65-53-202.rev.numericable.fr (HELO hadrien) ([81.65.53.202]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2019 20:55:08 +0200 Date: Wed, 9 Oct 2019 20:55:08 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Wambui Karuga cc: outreachy-kernel@googlegroups.com, gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [Outreachy kernel] [PATCH] staging: kpc2000: Remove unnecessary return variable In-Reply-To: <20191009170703.GA2869@wambui> Message-ID: References: <20191009170703.GA2869@wambui> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 9 Oct 2019, Wambui Karuga wrote: > Remove unnecessary variable `val` in kp_spi_read_reg() that only holds > the return value from readq(). > Issue found by coccinelle using the script: > > @@ > local idexpression ret; > expression e; > @@ > > -ret = > +return > e; > -return ret; > > Signed-off-by: Wambui Karuga Acked-by: Julia Lawall > --- > drivers/staging/kpc2000/kpc2000_spi.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c > index 3be33c450cab..6ba94b0131da 100644 > --- a/drivers/staging/kpc2000/kpc2000_spi.c > +++ b/drivers/staging/kpc2000/kpc2000_spi.c > @@ -162,14 +162,12 @@ union kp_spi_ffctrl { > kp_spi_read_reg(struct kp_spi_controller_state *cs, int idx) > { > u64 __iomem *addr = cs->base; > - u64 val; > > addr += idx; > if ((idx == KP_SPI_REG_CONFIG) && (cs->conf_cache >= 0)) > return cs->conf_cache; > > - val = readq(addr); > - return val; > + return readq(addr); > } > > static inline void > -- > 2.23.0 > > -- > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20191009170703.GA2869%40wambui. >