From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93D16C433DF for ; Fri, 16 Oct 2020 02:50:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 011C72074D for ; Fri, 16 Oct 2020 02:50:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="hRJFlb+N" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 011C72074D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8B1B194007B; Thu, 15 Oct 2020 22:50:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 861AB94006D; Thu, 15 Oct 2020 22:50:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7770494007B; Thu, 15 Oct 2020 22:50:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0142.hostedemail.com [216.40.44.142]) by kanga.kvack.org (Postfix) with ESMTP id 4720294006D for ; Thu, 15 Oct 2020 22:50:24 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id E041B1EE6 for ; Fri, 16 Oct 2020 02:50:23 +0000 (UTC) X-FDA: 77376259926.13.cook86_31132fb27219 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id BF3B718140B67 for ; Fri, 16 Oct 2020 02:50:23 +0000 (UTC) X-HE-Tag: cook86_31132fb27219 X-Filterd-Recvd-Size: 2415 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Fri, 16 Oct 2020 02:50:23 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 64CB82074D; Fri, 16 Oct 2020 02:50:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602816622; bh=2Lrf3xNueGp4Ipkr4K+aKF9mdcpeFyIChR8i8iUna8E=; h=Date:From:To:Subject:In-Reply-To:From; b=hRJFlb+NwEybvA4kwsCKm06wRqIacfAXKGebGJxB+6xKyaKkDVi/C4SzSk0hw9gv5 4xVYMGKi6uSqIviHW+gb9gamN2YKyO2qH7hv408mwIfd6Ngrqj3+YJhsXjSuvzT4vB sFNOzMB8Xj0/TByrjWXMpAchA71gP9cTPTLqxPKA= Date: Thu, 15 Oct 2020 19:50:21 -0700 From: Andrew Morton To: akpm@linux-foundation.org, linux-mm@kvack.org, mm-commits@vger.kernel.org, sudipm.mukherjee@gmail.com, torvalds@linux-foundation.org Subject: [patch 149/156] kernel/relay.c: drop unneeded initialization Message-ID: <20201016025021.FK42J5jIw%akpm@linux-foundation.org> In-Reply-To: <20201015192732.f448da14e9854c7cb7299956@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Sudip Mukherjee Subject: kernel/relay.c: drop unneeded initialization The variable 'consumed' is initialized with the consumed count but immediately after that the consumed count is updated and assigned to 'consumed' again thus overwriting the previous value. So, drop the unneeded initialization. Link: https://lkml.kernel.org/r/20201005205727.1147-1-sudipm.mukherjee@gmail.com Signed-off-by: Sudip Mukherjee Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton --- kernel/relay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/relay.c~kernel-relayc-drop-unneeded-initialization +++ a/kernel/relay.c @@ -1002,7 +1002,7 @@ static int relay_file_read_avail(struct size_t subbuf_size = buf->chan->subbuf_size; size_t n_subbufs = buf->chan->n_subbufs; size_t produced = buf->subbufs_produced; - size_t consumed = buf->subbufs_consumed; + size_t consumed; relay_file_read_consume(buf, 0, 0); _