Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp911392ybv; Sat, 22 Feb 2020 18:20:38 -0800 (PST) X-Google-Smtp-Source: APXvYqzXzTSFkEN8mp7Qx7yAYbcNZkFeQil6gx0jSCbcROkQzQjDeY+Zxp2II1GSJX3LFRDaQQqD X-Received: by 2002:aca:d484:: with SMTP id l126mr7718026oig.114.1582424438834; Sat, 22 Feb 2020 18:20:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582424438; cv=none; d=google.com; s=arc-20160816; b=HqSf0H+lnnWn0Ets7+2eNkuQD0xUHP5V/bmkvE5FS4lkDz7VsRC5cShdqcxCmzW5Nf Be8h2mIvt9Yeu1QWnzo7byUSq15O/kHXZ04+8kg3gm1lOwJlH2mMQpINdFRNx2Vb8uS1 wmMbe8/uZA4Ijr0mrsrwWsGZuebew1cl/fORpIL3oqivggkNkOYSKiHH1ZqEh0v7LfAq 0ysCwbFxmDa57HbrCZ/+m7Y3XqPT+bCiEiCD/b0FCWvgGLct4yDV/Z0Vpy1AdsoN73Mq dUMeVQPOeVjbLYXc3n0H0uOJL9Yavj5v7/xnLWUWULLLJAG3/GJKEkqOggoLdlMCotnH ye+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=DlzDCWKnpP64oLtQaBAbzFOIcuprG8j5G+iWBrmKVrg=; b=orO773aRRVI5C9N0DMvLZ8n7HLFc9PtClyjY66LNLNvbFZMiDm70wiBhlIPcI+0kVt 0ODu5yqw8DaZ9+kmdPiID72S8LlYvWRdC6I0aQdT78+V43QujoCBEShLKe9i1I7IihU6 6SrG0VBmfosJ1C4rZ19YDPlc8cpn6GFRwK0d2xYghNo0gUzZKFuyGxNgjZNCDt2fwjLe i99hWvoHCGAy18hpoB4yGREpdjUMXSri6rbr+PTrtWRSN87ghZS7nR7I42V+GBCDGWZ1 WPf+2PcjgpE9vqpizm/i5G970GVKC5PGZ0o8V57KDMyIufni68IXfHjg2eyEbfldcUYh 1GTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=J87BUl1G; 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 v3si4279844otn.140.2020.02.22.18.20.26; Sat, 22 Feb 2020 18:20:38 -0800 (PST) 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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=J87BUl1G; 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 S1727100AbgBWCUO (ORCPT + 99 others); Sat, 22 Feb 2020 21:20:14 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:42051 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726965AbgBWCUO (ORCPT ); Sat, 22 Feb 2020 21:20:14 -0500 Received: by mail-lf1-f67.google.com with SMTP id 83so4292212lfh.9 for ; Sat, 22 Feb 2020 18:20:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DlzDCWKnpP64oLtQaBAbzFOIcuprG8j5G+iWBrmKVrg=; b=J87BUl1GAtEGuqJhlVY2/k9SfnX3/EJ26CnJ5zhPvKO27Ck4gIMAaEcEp6RkXK1CoH cYeUu7QkJG+o7g82QaU04EprymxperNTYgWURB5uT+eAQBNQAFtc9siHaFRsGCPU/lfu 6B0xzEvBpPVHL7GX3USuIS4PmGhz5I5USMHYg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DlzDCWKnpP64oLtQaBAbzFOIcuprG8j5G+iWBrmKVrg=; b=qaKBSOpNdngtBL1bZC2lzdBNkYUldcuUzKu/XljZUgOcHO0Rdo/bFpn4C31FXYi1L3 jEPCMNG81gI8/nfdqJsCcQL/pB7ZkgoL71fnAZiTZM1WpbmuMBRkcD/Z5UpGCTLzhQBA G5lQyiaVz7INU8jjonc1GWwkQqaPK2a+nf/c6jmF2eCZXnA6TtaBlzIyPdrzcV1CWJx0 qFV2nnSgQ5tgRxyzWgRSRe1WWzzU0+MPU2WJFqtmiSVNfiix+oU6JrmnOmZOjrO3Q5yA iV8P7vgcUnxSxHOhq2VWMf9s1jgsMsHAeSWMkvY5nTDIaAhJfKFjS+DzQvBnFpxLHbd2 jCLg== X-Gm-Message-State: APjAAAXsorz+eJFftFLV5oMzpixKI4WzW+oebBT8EwNwCCsZy23inmBz BKcMno4rQWptV637r/VKpKSjqQ9bIk0= X-Received: by 2002:a19:ca15:: with SMTP id a21mr8258634lfg.67.1582424412309; Sat, 22 Feb 2020 18:20:12 -0800 (PST) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com. [209.85.208.172]) by smtp.gmail.com with ESMTPSA id w8sm3947170ljj.75.2020.02.22.18.20.11 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 22 Feb 2020 18:20:11 -0800 (PST) Received: by mail-lj1-f172.google.com with SMTP id q23so6237481ljm.4 for ; Sat, 22 Feb 2020 18:20:11 -0800 (PST) X-Received: by 2002:a2e:97cc:: with SMTP id m12mr26028515ljj.241.1582424410837; Sat, 22 Feb 2020 18:20:10 -0800 (PST) MIME-Version: 1.0 References: <20200223011154.GY23230@ZenIV.linux.org.uk> <20200223011626.4103706-1-viro@ZenIV.linux.org.uk> <20200223011626.4103706-21-viro@ZenIV.linux.org.uk> In-Reply-To: <20200223011626.4103706-21-viro@ZenIV.linux.org.uk> From: Linus Torvalds Date: Sat, 22 Feb 2020 18:19:55 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC][PATCH v2 21/34] merging pick_link() with get_link(), part 4 To: Al Viro Cc: linux-fsdevel , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ok, so far I haven't seen anything bad. But I keep noticing these odd stylistic things... On Sat, Feb 22, 2020 at 5:22 PM Al Viro wrote: > > - return step_into(nd, flags, dentry, inode, seq); > + err = step_into(nd, flags, dentry, inode, seq); > + if (!err) > + return NULL; > + else if (err > 0) > + return get_link(nd); > + else > + return ERR_PTR(err); > } What? Those "else" statements make no sense. Each if-statement has a "return" in it. It's done. The else part is not adding anything but confusion. IOW, this should be if (!err) return NULL; if (err > 0) return get_link(nd); return ERR_PTR(err); with not an 'else' in sight. Linus