Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp290642pxb; Thu, 12 Aug 2021 16:44:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1hU1WKkVEb6couPdf2afmvt6wOdQ2FGiWxnq61U0BQWmTbtsZXQyLxOhBLtoGF3C4MIng X-Received: by 2002:a02:2a07:: with SMTP id w7mr5959911jaw.96.1628811856093; Thu, 12 Aug 2021 16:44:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628811856; cv=none; d=google.com; s=arc-20160816; b=iSeZFo6zK9x7CjoUTT9VR6a+yvgAA/CUkQZnyCwfvC0/z02Zjj+zdQtMd2DbBjcwCV gU+VIrniIg6lidynim+wDkf/RhivsXCS1fR8ymxFbt6LlybU0OTCCmgdBt4BAeu5hct3 1bhJYt3+TpBC1kKIq3B6XvCfCtXWxI62P/JDoxN5/ffJC6Gdac3K5k8KRJMsRN2k4CFm 3sIQzs8fLMIMndu5tTjAtmzjihZQ0HYueZcUBJfZCuiNUGMP4rAhL6fjAOFQ+dvs/leJ yRdZU0eFv2t9Xd+hpRl7RvnvaU7GRuSKYvWyzh58815gQNh8xVSX6GtkR6k1cMN2fcXs HNSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=9hKkz1lx1aLm+kTyJZbEnNp+lmFdPxXG/3j8tSQu8mw=; b=YQlwJ2Mu5owo5BM+vkuCS9T6R2pKRCCkiJVu16Hq6XLoTLTdouLphVx661tV0NxiDn v1lJdH2mvkE9FT/piRsbf68pTBVYiAsvhnN+hU46mh7+ZTEyu2SZD9abZTt1dFr8QVeo EsH4QlSV+rcDAD2Mv1ZsVbt38RmYpVw07Ua06QJn0lKxcPax/Kzmk0kACtgmcmfRLZz/ HnoLMSG6NfmEDuZAF5vsD75iXrPXr6lNVUJzn/GPvDX5K8f47GEB+CwxQGdAcePTMmqd +HDjthrS512snY7QhFcKKP5nuZY4l6zp0+XSZcCaOfbFR0ifT0aEf/Kq2W5tRz7LcdTi aYcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="U/Wt0xmp"; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id az34si4722386jab.63.2021.08.12.16.44.05; Thu, 12 Aug 2021 16:44:16 -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=@kernel.org header.s=k20201202 header.b="U/Wt0xmp"; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234955AbhHLXOa (ORCPT + 99 others); Thu, 12 Aug 2021 19:14:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:44716 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229601AbhHLXO3 (ORCPT ); Thu, 12 Aug 2021 19:14:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DF36F61038; Thu, 12 Aug 2021 23:14:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628810043; bh=yG14bUeU1buiIIE2r2S/eD3JTfuifUtevK7unrjDIjI=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=U/Wt0xmpjxqZJQyQXnYcWuRXvKQaqPefRHygIJWvMH/UxrL7bwOqy4CU5NPfpBABf UhDStXmfUGywu3YBftUk5bPkjs2VkhE2FdyWGhfK+3ik7wQkUI229/k1pEiV2PCM09 oOsJ5783uNGVOnPuoEnnGr3moZ7eHIvJwNafpEjudwFQ3SerERrwTn7cIJ7xApwrlK h1mXM7n/wP5nSPvIXBPBnPeNXCHr8c0vPanNaoq/0kniDmyKNl/NtkwGYvq4hwoVva bK75eYZu0hvn1HYndkTZVwAe71fmIZ2HzGSjiZZN0ox8BhQ651mSCB/h4zRE2Dktbb 2CqD46g8YVB0Q== Subject: Re: [PATCH 3/3] staging: r8188eu: Reorganize error handling in rtw_drv_init() To: "Fabio M. De Francesco" Cc: Greg Kroah-Hartman , Phillip Potter , Larry Finger , Nick Desaulniers , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com References: <20210812204027.338872-1-nathan@kernel.org> <20210812204027.338872-4-nathan@kernel.org> <1651213.ETx7SW4KbR@localhost.localdomain> From: Nathan Chancellor Message-ID: <24e15d45-40b8-b8a7-b633-9e538324a29b@kernel.org> Date: Thu, 12 Aug 2021 16:14:01 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <1651213.ETx7SW4KbR@localhost.localdomain> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/12/2021 4:11 PM, Fabio M. De Francesco wrote: > On Thursday, August 12, 2021 10:40:27 PM CEST Nathan Chancellor wrote: >> [...] >> Looking at the error function as a whole, the error handling is odd >> compared to the rest of the kernel, which prefers to set error codes on >> goto paths, rather than a global "status" variable which determines the >> error code at the end of the function and function calls in the case of >> error. >> > "status" is not a global variable, instead it is a local variable with only > in-function visibility and it has an automatic storage duration (i.e., it is > allocated on the stack frame of the function and is destroyed when the stack > is unwound at the return from the function). > > According to the above definition there's no difference in storage classes > between the old "status" and the new "ret" (the latter being a merely rename > of the former). However, "ret" is a more appropriate name for that variable. > Furthermore, your handling of errors and return value is more consistent with > best practices. Sorry, I meant "global" with regards to the function (as in "was there an error in the function"), rather than "global" as a storage class. > Therefore, apart that minor misuse of the "global" class in your commit > message, it's a nice work and so... I am happy to redo the commit message if you and others so desire. > Acked-by: Fabio M. De Francesco Thank you for the review and ack! Cheers, Nathan