From patchwork Wed Jan 17 23:11:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ronnie Sahlberg X-Patchwork-Id: 10172173 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F21B7601D3 for ; Wed, 17 Jan 2018 23:11:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0BE32094F for ; Wed, 17 Jan 2018 23:11:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D561526E75; Wed, 17 Jan 2018 23:11:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 500D0204FA for ; Wed, 17 Jan 2018 23:11:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753970AbeAQXLZ (ORCPT ); Wed, 17 Jan 2018 18:11:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53624 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753087AbeAQXLY (ORCPT ); Wed, 17 Jan 2018 18:11:24 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5668561470; Wed, 17 Jan 2018 23:11:24 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DF70B5D6A8; Wed, 17 Jan 2018 23:11:23 +0000 (UTC) Received: from zmail25.collab.prod.int.phx2.redhat.com (zmail25.collab.prod.int.phx2.redhat.com [10.5.83.31]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6CD2C18033D8; Wed, 17 Jan 2018 23:11:23 +0000 (UTC) Date: Wed, 17 Jan 2018 18:11:23 -0500 (EST) From: Ronnie Sahlberg To: Colin King Cc: Steve French , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <2031352942.702941.1516230683335.JavaMail.zimbra@redhat.com> In-Reply-To: <20180117095239.10670-1-colin.king@canonical.com> References: <20180117095239.10670-1-colin.king@canonical.com> Subject: Re: [PATCH] cifs: remove redundant duplicated assignment of pointer 'node' MIME-Version: 1.0 X-Originating-IP: [10.64.54.86, 10.4.195.30] Thread-Topic: cifs: remove redundant duplicated assignment of pointer 'node' Thread-Index: 2JtkT6SVdM+Rpe1NK1AqSspjuPs1Pg== X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 17 Jan 2018 23:11:24 +0000 (UTC) Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Reviewed-by: Ronnie Sahlberg ----- Original Message ----- From: "Colin King" To: "Steve French" , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Sent: Wednesday, 17 January, 2018 8:52:39 PM Subject: [PATCH] cifs: remove redundant duplicated assignment of pointer 'node' From: Colin Ian King Node is assigned twice to rb_first(root), first during declaration time and second after a taking a spin lock, so we have a duplicated assignment. Remove the first assignment because it is redundant and also not protected by the spin lock. Cleans up clang warning: fs/cifs/connect.c:4435:18: warning: Value stored to 'node' during its initialization is never read Signed-off-by: Colin Ian King --- fs/cifs/connect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 0efd22e75ac7..63c5d85fe25e 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -4432,7 +4432,7 @@ cifs_prune_tlinks(struct work_struct *work) struct cifs_sb_info *cifs_sb = container_of(work, struct cifs_sb_info, prune_tlinks.work); struct rb_root *root = &cifs_sb->tlink_tree; - struct rb_node *node = rb_first(root); + struct rb_node *node; struct rb_node *tmp; struct tcon_link *tlink;