Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp2084368pxb; Sun, 5 Sep 2021 08:16:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwC5Mr3e7/I89Gr3WDo0slVae/m0AK3zGByjJ60hbFChJSL0UpYWOkXemw00nQy+DiMQylt X-Received: by 2002:a92:c248:: with SMTP id k8mr4056519ilo.78.1630854975797; Sun, 05 Sep 2021 08:16:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630854975; cv=none; d=google.com; s=arc-20160816; b=AxTVzMnGmTalIcs5NPEPW9GMqd6Nh0+q2VG20Hhv9RfUO+KuwI69o/AE8YEsY07Pho uFnpngezR40NSKVqEUl5LP9lyvXAcJaDv8cumA52M+D+qAxRXYvCDYJbP7D5GyMDcGcR Q97D5zlts/fknKwxNd267rLlc5l5bxPRNaUDdFTXy4eHzWV9/HL2iWxlZpXUiCEOdKIO RLanc7BcjkpEvkf6K0nF/a8w0IirQdW3CBYoIq8sKMVX8ISNhR3O9z70xoo8Ef2QH2/D mBHWmbejlImjfy66CU1KEwjBWvPgar6L5uUETo6K6AKtqL956hrCcFYKr6cgVfAqkfaj b1kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=gW+mBpILbPJTEP0okZSolnQyIGUB/6tj5sfUD9C7ngk=; b=xiMTIzYF3tN245sn8KSMTHZGgLWinIse5JyMELH4ytQ9TC0tQlyuuLIACjNjtRq9Zw DYz8veBoArnvE8HJ9EZU5eEgssAmQBdhLIDTq6y9RiM61wTfOMzWgBvaE2UCOaC8xJK9 EPY3OnikqFd4YiSBL9hyGy7K9/cWbcVaJIdglUwYXiJHo2dcsWWPeTnqtRrhSbr+UUcw p7/Ay2SNU2R4jyKSbfSJFHLdAMoGdl7M9lStynHitEKmMBw1C+qPqFBkvox4DZ1ShGYr M3MPW4s/FR5CHS5WrKriK/wCaPlOHvC6hcImbQ5qFWuDR6eIAsQcy/ITAbByk/e1ncZD qo6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=S3FwZ5JG; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v17si4859654ilm.40.2021.09.05.08.15.51; Sun, 05 Sep 2021 08:16:15 -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=@linuxfoundation.org header.s=korg header.b=S3FwZ5JG; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236156AbhIEOtL (ORCPT + 99 others); Sun, 5 Sep 2021 10:49:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:57680 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229566AbhIEOtJ (ORCPT ); Sun, 5 Sep 2021 10:49:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E839E60F5E; Sun, 5 Sep 2021 14:48:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1630853286; bh=Ml6h4k7pc7nhRrmhLJIKHEX5HhqaFagSdme0GwtDJWM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=S3FwZ5JGx5uDlYlbF26JN9f2eJdulDA8fw1YIntCNoFowXdZ20MDmF+t7ETAPSc7P uDgkzU29g0S89ZgF7jcumMIP17S9dGnyLROmstyfXAkSgtwcZXgFYL/yJUtrKGnGU/ fv8giwbl7IrxDQA7+C1h+6WhFy808Mwzx9oeJBbk= Date: Sun, 5 Sep 2021 16:48:03 +0200 From: Greg KH To: Saurav Girepunje Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, straube.linux@gmail.com, martin@kaiser.cx, nathan@kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, saurav.girepunje@hotmail.com Subject: Re: [PATCH v2] staging: r8188eu: os_dep: simplifiy the rtw_resume function Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 04, 2021 at 05:44:44PM +0530, Saurav Girepunje wrote: > Remove unused variable ret and pwrpriv. > Remove the condition with no effect (if == else) in usb_intf.c > file. > Remove rtw_resume_process() and move whole thing to rtw_resume(). > > Signed-off-by: Saurav Girepunje > --- > > ChangeLog V2: > - Remove rtw_resume_process() and move whole thing to rtw_resume(). > --- > drivers/staging/r8188eu/include/usb_osintf.h | 2 -- > drivers/staging/r8188eu/os_dep/usb_intf.c | 12 ------------ > 2 files changed, 14 deletions(-) > > diff --git a/drivers/staging/r8188eu/include/usb_osintf.h b/drivers/staging/r8188eu/include/usb_osintf.h > index d1a1f739309c..34229b1cb081 100644 > --- a/drivers/staging/r8188eu/include/usb_osintf.h > +++ b/drivers/staging/r8188eu/include/usb_osintf.h > @@ -24,6 +24,4 @@ void *scdb_findEntry(struct adapter *priv, unsigned char *macAddr, > void nat25_db_expire(struct adapter *priv); > int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method); > > -int rtw_resume_process(struct adapter *padapter); > - > #endif > diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c > index bb85ab77fd26..77b03e7631b7 100644 > --- a/drivers/staging/r8188eu/os_dep/usb_intf.c > +++ b/drivers/staging/r8188eu/os_dep/usb_intf.c > @@ -493,18 +493,6 @@ static int rtw_resume(struct usb_interface *pusb_intf) > { > struct dvobj_priv *dvobj = usb_get_intfdata(pusb_intf); > struct adapter *padapter = dvobj->if1; > - struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv; > - int ret = 0; > - > - if (pwrpriv->bInternalAutoSuspend) > - ret = rtw_resume_process(padapter); > - else > - ret = rtw_resume_process(padapter); > - return ret; > -} > - > -int rtw_resume_process(struct adapter *padapter) > -{ > struct net_device *pnetdev; > struct pwrctrl_priv *pwrpriv = NULL; > int ret = -1; You can also remove the test for padapter being NULL in this function, as you just proved it could never be null otherwise the above function you removed would have crashed, right? You should do that all at once so we remember why that test was removed. thanks, greg k-h