Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp190672pxb; Mon, 16 Aug 2021 03:18:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzT6oK0QiFRX0T1WqZdNA0wLnlJs9mhW5lycXJZBZK9Z/UxBlqWtGJ02YyQviRRHEszqeaI X-Received: by 2002:a17:907:c11:: with SMTP id ga17mr14669387ejc.298.1629109105670; Mon, 16 Aug 2021 03:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629109105; cv=none; d=google.com; s=arc-20160816; b=XKEGvfxWNlptn4QmClP2OZt4hqtECwAYB6SvLYyEggZ0JtGyYL+NflXA+OxwQGMFAJ xClqTMgFZq9PDMMXQXo5YX5CnTkwuRo9Z/K2tVb4hIQ3HQGi+W/fjF5tWl9G2U6FhFvE 4YfG5jATRe76a2hFDdNw+knxvlJvECHqQqnOaXtUF/lkPACovweE1OwaF15E4eCIjg0g JVmEJIIp6Auzq8Yc4GQYzlM1aTjuzzl6jrN5y+WE9uzv0Ik9+Yl6OZwzjLi87hlcB4z3 S1lt6qyoL5ncFJCV7Dmw9+FS5yrChswPWGR62xSDSQfzEIIeXZQmKqTctrOih+WX6/mO 7wYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UVW6kIMO+vANMX1HgjohnPiDWRD88704SfiqfsvGvrY=; b=XUVT2Dsp/6iB0xl0WfBfxi+9zuFioinaRRXiaXR3yGaO5+BmyCUzu3P6Iqh05pdvnd bG8SeUkK1R7zaYj6c1MTHT4X8jNDu0UttenBFFvCPwalOjAqJqQ45Gh2qW6iMtJLAq4P 9YMcPnqOeXAMMVqqYWveHKZns+khqUIC0eKLSZ9L1e9ZxsV8/1NMunzCynhJhPpZ0N+f mh99Qx55ZRnVEDZ9I9ORVWttTqn5c7iPdrl1I5QOtcqAd8lziOHdQuAAT2Lz+E2xX1s/ d4iX+CfyUxcLWKWEUqpqcIOMFQMvqx9J6JNZAXtX2iYTovJflI0JrRVEinSRcc2T7z8H fnCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DKz7kaaW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y1si5908993edc.551.2021.08.16.03.18.02; Mon, 16 Aug 2021 03:18:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DKz7kaaW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235650AbhHPKQc (ORCPT + 99 others); Mon, 16 Aug 2021 06:16:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231355AbhHPKQb (ORCPT ); Mon, 16 Aug 2021 06:16:31 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22169C061764 for ; Mon, 16 Aug 2021 03:16:00 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id cq23so8237209edb.12 for ; Mon, 16 Aug 2021 03:16:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UVW6kIMO+vANMX1HgjohnPiDWRD88704SfiqfsvGvrY=; b=DKz7kaaWh76EEz1NKm98fpj3E8kOJxDG5IeUBcDQLsm2STIJvj735JLGQS2y3G/e0V rEAcZt9v/mcJJi0DVLXvYQmpWrSBl/OqG6/nj1yG66Wfjtz1yjMa5iPlfFH1zRfdZYFm p7PekcV43teXYUHSNw+mp2j1bMbSV2ppHYzycFloWd145F95/J8ic3mDq0Ct3J9E9/vE CB914QCPyZYZG5JKPxcYvUTAcpCQHNjWIGZtbbRJASUlmX8ULCvy/Y6RwCroAPTbFAd2 3rEpc8f7gIg1i5i77RSWR3L/OcvZc9XM1NV75/mIyc+T0jUeIix5AfmGqduMFD7Hjgiw VVjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UVW6kIMO+vANMX1HgjohnPiDWRD88704SfiqfsvGvrY=; b=aH8i0/fAzPhO1p+pFTfBALrUSf2mVNuNruNI9yOkR3LqS/I5Y/JxRKE3kLWSWKQGpT Hit4E/QCWvFQ69ZoenmAgc4SW655TR3FBnlejPJtih9ixTaucZg73qGd5IlKdYXJPpbc gBON5JDZacW+iJxdXl7M9vb4BiipVU/FiKTde3S/zYzd0XMS/OSyyUGRpj4tZ8hBLApZ NxMiHhpbSV+PfmmcKhuQdqquPQ7RuJ4NKv3QKcjshA9jI2l+JUFf1D7N/U9/eke0MCrl uEXriueeJ4kdR+tgvkz8P/wBQh8PXR2jAZTfFkrptzI8G4Z8zloXC+b/WiAP4KnCkhGZ oxfQ== X-Gm-Message-State: AOAM532oceIkSh824DiNc2icJm1gZdOi4dHakPb/sai2uYIsBi+Ljq5q wK4zTSrGiDiDwVhjDD607Bk= X-Received: by 2002:a05:6402:3485:: with SMTP id v5mr2683605edc.205.1629108958744; Mon, 16 Aug 2021 03:15:58 -0700 (PDT) Received: from localhost.localdomain (host-79-22-109-211.retail.telecomitalia.it. [79.22.109.211]) by smtp.gmail.com with ESMTPSA id be23sm4602202edb.68.2021.08.16.03.15.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Aug 2021 03:15:58 -0700 (PDT) From: "Fabio M. De Francesco" To: Nathan Chancellor , Dan Carpenter Cc: Greg Kroah-Hartman , Phillip Potter , Larry Finger , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: r8188eu: Remove unnecessary ret variable in rtw_drv_init() Date: Mon, 16 Aug 2021 12:15:56 +0200 Message-ID: <2121129.EM0CHCvl88@localhost.localdomain> In-Reply-To: <20210816090500.GG1931@kadam> References: <20210813201418.4018631-1-nathan@kernel.org> <20210816090500.GG1931@kadam> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, August 16, 2021 11:05:00 AM CEST Dan Carpenter wrote: > To be honest, I prefered the original. > > foo = alloc(); > if (!foo) { > ret = -EWHATEVER; > goto free_last_thing; > } > > I like this style of error handling because all the information is > there. You don't need to scroll down. > Thinking deeper about this style of error handling, I find that Dan is quite right in preferring readability over removal of (technically unnecessary) temporary variables. Perhaps the trade-off between brevity and readability should (in general) favor the latter. Furthermore, those temporary variables make the code easily adaptable/ extensible in cases where, in future revisions of the code, there will be more different errors to handle. However, it's mainly a matter of style, so... > > I don't really care about this specific patch at all. It's a small > thing. But we had someone come through who was sort of obsessed with > removing these sorts of variables. Just because you can remove a > variable doesn't necessarily make the code more readable. > > If you're doing the work and maintaining the driver you get to choose > your own style to some extent. > I agree: choose your own style (to some extent). Thanks, Fabio > > But I don't want to encourage people to > start sending these sort of patches more generally. > > regards, > dan carpenter