Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2176213pxb; Wed, 9 Feb 2022 12:30:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWgcFEoNLUNwT81ahvhPHGYRfzXneWwLqpcHjXgNQxS9u1OTM0z4wjGk0I5LHZ83y31GQl X-Received: by 2002:a17:902:7c0b:: with SMTP id x11mr3887853pll.138.1644438610696; Wed, 09 Feb 2022 12:30:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644438610; cv=none; d=google.com; s=arc-20160816; b=hmvhQaZq3u12DcCddkiW0dFA5I6dL1Y5uk3/g9blkED6D7hJwuNEed5EISTw1lck6a zQ/uNWBXXZzk6UiienTS1BmZkSq+WaABkdc/jRuZ8Bgd7b+pY7Wbw9uGVrnF+HSHuG7m MBwAqv3gFWZgSo1krK6aIF+UPFniTprr25HeBK8m1rDs94jiV4aCJHCxb9Hrye22XPOs nbWeKMOFTKlGOQTz6jM9jZge437Mym9BwG+WbUxM/PexpXB2TER3I2nPMdE57bsNogvA RMxXW2IC3hXLo2/0NF3xW3fv7p6TVhHYwFrLMwY2O/1E4MFLAJyuyL0Cfb0ZRUYtT/RY Z96A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ZqCsdtECQHXTZr8IpF8umy+6Cux+k4bWSLZZ1TOrY2Q=; b=X6svVfrBj2xPEff5zsqMkVCvSmN2cdVp5hXbzgoxLGezZQmtVzL/8ibVedsLUfjTf2 gAtvMgOYoeVUg3ZzoefsHPox+s1nGX4JLxWYJFT/TM73STpVCOumP34wmMW2SVEU7mGr 06Oj88e4K5mgjdmNqAVtAwd25gFRcpdbs6BP8PgSsp45dHIikgjpEDgbg9UI32a2Qjj7 9qGZW8LpB2L1XGlAyvJRGK2ffIkLIaGJv1LyGl7sT3wmLvj3aGmwCaaS15us9LSGQ97f HoxwwyYO55Cxo/z5JWZEzSBWcrghcLjg8XLX5G0IvOovobKfxPAQhdDDYYCDE/g/nk6R zNlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IKDerEoh; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id y14si15183338pll.426.2022.02.09.12.30.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 12:30:10 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IKDerEoh; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8DE9EE0186F7; Wed, 9 Feb 2022 12:06:22 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230136AbiBITOi (ORCPT + 99 others); Wed, 9 Feb 2022 14:14:38 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:38344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230056AbiBITOh (ORCPT ); Wed, 9 Feb 2022 14:14:37 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F104EC0DE7C7 for ; Wed, 9 Feb 2022 11:14:29 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id i34so6149848lfv.2 for ; Wed, 09 Feb 2022 11:14:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=ZqCsdtECQHXTZr8IpF8umy+6Cux+k4bWSLZZ1TOrY2Q=; b=IKDerEohVoRWS2zeh1Y+i/Y+oGfN/IIFKarRBaZ8JIubn4k6oVNLzPazkiW0fwezsf YxdtZPi0pw6Ij6mW7ItW3Vu5BrLzjD+LRKptIqk7vpZCndqBNDg4TNKyAxLECgzKxWh+ +EHkydPog7Qvffd6Q0vrtErsXbnjvk60VQKwnagxLJoXh0SHAw5lbolnlCfSliKBdCwJ j8lF22zTpYNrWaDlsk0VQiQlgzS35UoMx9OeFTL2Esv4YFAiXkfnnpGzIVZ+yJMrT75i TzrEaR1OlxYBKfqDgtHCj+/6OzYw8fAuAxpstNl2j2awsd7nHBl/HOHk3cA3onHVIDZi BLcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=ZqCsdtECQHXTZr8IpF8umy+6Cux+k4bWSLZZ1TOrY2Q=; b=1Wj4KAMcRDYjZY2a8WHrl0zT7V1ah1UB4K+gx3IrYBWcJmA8I0uzuFxF6nEkXbFzvh 3XkFl3tsVO+gicbXgHsyrTQWeBOWYfBaFpmHEC6/cUTI0Qu/+e2IEDAF63WOcOUazABu 2d/Zw3SH2ezntmy9OYppuzGT54RAriNoXmCi85sHx/8J8p8fG5fGEq/3chYz8xcTsgvm DopL/u6wKNf4MGCDuoc/d39b2m37JwIEn3Qyw/JqU8EpAWsE+NcmIJiiiSCx+62dixRL inRLdRBD5Y418dep06DWbUY55r9VeNcJfwsm7q+YHWOI/ww4fxpbDDBKMDh9x1KzR0Js pCxQ== X-Gm-Message-State: AOAM5335qVgHe88SO0sZuCwoU45b5GIzkb5gnEOK7B/gOWdwxxSffMAb WpYJC+UiTCBvxq6Kw99dQRSPJ4we6Dm98Q== X-Received: by 2002:a05:6512:3c96:: with SMTP id h22mr2539605lfv.262.1644434024921; Wed, 09 Feb 2022 11:13:44 -0800 (PST) Received: from [192.168.1.11] ([217.117.245.154]) by smtp.gmail.com with ESMTPSA id bt24sm285368lfb.246.2022.02.09.11.13.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Feb 2022 11:13:44 -0800 (PST) Message-ID: Date: Wed, 9 Feb 2022 22:13:42 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v2] staging: r8188eu: keep the success path and error path separate Content-Language: en-US To: Vihas Makwana , Larry Finger , Phillip Potter , Greg Kroah-Hartman , Michael Straube , Martin Kaiser Cc: Dan Carpenter , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org References: <20220209190752.7232-1-makvihas@gmail.com> From: Pavel Skripkin In-Reply-To: <20220209190752.7232-1-makvihas@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vihas, On 2/9/22 22:07, Vihas Makwana wrote: > Keep the success path and error path separate in rtw_usb_if1_init() and > drop the "status" variable. > Also, remove do-nothing gotos. > > Signed-off-by: Vihas Makwana > --- Looks good, thanks Reviewed-by: Pavel Skripkin > v1->v2: > Just `return NULL` instead of `padapter=NULL/return padapter` > drivers/staging/r8188eu/os_dep/usb_intf.c | 30 +++++++++-------------- > 1 file changed, 12 insertions(+), 18 deletions(-) > > diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c > index 10c33e2ae..668e79a3c 100644 > --- a/drivers/staging/r8188eu/os_dep/usb_intf.c > +++ b/drivers/staging/r8188eu/os_dep/usb_intf.c > @@ -336,13 +336,13 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj, > { > struct adapter *padapter = NULL; > struct net_device *pnetdev = NULL; > - int status = _FAIL; > struct io_priv *piopriv; > struct intf_hdl *pintf; > > padapter = vzalloc(sizeof(*padapter)); > if (!padapter) > - goto exit; > + return NULL; > + > padapter->dvobj = dvobj; > dvobj->if1 = padapter; > > @@ -421,26 +421,20 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj, > , padapter->hw_init_completed > ); > > - status = _SUCCESS; > + return padapter; > > free_drv_sw: > - if (status != _SUCCESS) { > - rtw_cancel_all_timer(padapter); > - rtw_free_drv_sw(padapter); > - } > + rtw_cancel_all_timer(padapter); > + rtw_free_drv_sw(padapter); > handle_dualmac: > - if (status != _SUCCESS) > - rtw_handle_dualmac(padapter, 0); > + rtw_handle_dualmac(padapter, 0); > free_adapter: > - if (status != _SUCCESS) { > - if (pnetdev) > - rtw_free_netdev(pnetdev); > - else if (padapter) > - vfree(padapter); > - padapter = NULL; > - } > -exit: > - return padapter; > + if (pnetdev) > + rtw_free_netdev(pnetdev); > + else if (padapter) > + vfree(padapter); > + > + return NULL; > } > > static void rtw_usb_if1_deinit(struct adapter *if1) With regards, Pavel Skripkin