Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2608155pxu; Mon, 14 Dec 2020 06:46:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJyd6lFh4ktSoRdkzSCY43F/whInzVkhH6FQrcTm4wkrBoARFvQNJ1piNXKNLuWbOYEMkm2C X-Received: by 2002:a05:6402:8cc:: with SMTP id d12mr24758225edz.0.1607957198109; Mon, 14 Dec 2020 06:46:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607957198; cv=none; d=google.com; s=arc-20160816; b=A3OKNB9sTQL1oEdcx4PEdNcU1Eer0PgHpqDqL3+4mSkSQoJhlNL3KSAl7f8DXmiiB0 rKUS4qPudeFbCAmmVf/pXlEVkr5pPuOTtGKhtgMncv6e7BIKIzWCN5mfKKpeVa1gP6TW 1dWyvxpzJC16irSmY/CltpqInx5HHKkMxPe5DhjoZcDJD+GDGO3r/dTieMZ8AIx1HrVh XTzTx8SPfhIkF2hqQS+5O4y6PpKJQ9tsI5QCwOU2fQL7E5n0Uqd37fjBrhm2E3ZVf6Ye qYPpClSCQ03wwjQyfs4h54RsC24RrpjFQHAZfJNfIi+Dbz4p/reIED+ktY67K58Ijtcw T6ZA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:date; bh=LNBNXXS6D5tURwCkiwYXLCsaoL9ZsnDj/oZPzqXV+Ps=; b=vBrYGgaKMTGR9CW18N/m3fmrTSzlLrDHb4lTxW30ryx/ExzCaflp7oIGETUyz7xiL3 1Plni4JWv3leVpCTjPuqGqGur38Zp8wfS8AhA+3SNucWkWISeizJhq+VRsUCcgMEh5JE CX7Fn3w6RoT2wX3ys0qeSXMi5nbifIbrGGS/GzjgfQ18gNpwteBD2LQf6BD9rj+vQ8mF vnIt81lzBa2cN3C6I44Emho6UnaFEB/swPEZfUWoNrwyRZ0e0zOPnTa0RZWNwGqPX1cF N0ooylf3eA6R+9i7gM4snfrF2EoVRvx1o4ad6j3ohLcHqK8LMTikHUSbA0HJOEfwZKWk DgjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Oe6NnjfN; 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 l8si9767300ejp.707.2020.12.14.06.46.14; Mon, 14 Dec 2020 06:46:38 -0800 (PST) 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=Oe6NnjfN; 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 S2438831AbgLNMFC (ORCPT + 99 others); Mon, 14 Dec 2020 07:05:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:43094 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731381AbgLNME5 (ORCPT ); Mon, 14 Dec 2020 07:04:57 -0500 Date: Mon, 14 Dec 2020 13:05:22 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1607947456; bh=/zOYosf9OQG2h8LPMbK40g0Rf7i8gWLhYVSwdcnUXJ4=; h=From:To:Cc:Subject:References:In-Reply-To:From; b=Oe6NnjfNRkdkhcaCP18EWC1UVQsi/Pr6RgH9GD4wp4h4xCuJkICFLZyNO/NY0dTuB qgIgjXUD42PBTkrBH1qOfBImeqrlH+xFveEYG3yzLuOpyxaG+Ninve6ykmXazJVGtJ x5vXxqfCqao6A282886Ga8HvKuMbqI/hkUGuXKkg= From: Greg KH To: Zou Wei Cc: mathias.nyman@intel.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] usb: xhci: remove unused variable Message-ID: References: <1607945531-15059-1-git-send-email-zou_wei@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1607945531-15059-1-git-send-email-zou_wei@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 14, 2020 at 07:32:11PM +0800, Zou Wei wrote: > Fix variable set but not used compilation warnings: > > drivers/usb/host/xhci.c:1338:15: warning: variable ‘len’ set but not used [-Wunused-but-set-variable] > unsigned int len; > ^~~ > > Signed-off-by: Zou Wei > --- > drivers/usb/host/xhci.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c > index 91ab81c..24e5a0f 100644 > --- a/drivers/usb/host/xhci.c > +++ b/drivers/usb/host/xhci.c > @@ -1335,7 +1335,6 @@ static bool xhci_urb_temp_buffer_required(struct usb_hcd *hcd, > > static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb) > { > - unsigned int len; > unsigned int buf_len; > enum dma_data_direction dir; > > @@ -1351,10 +1350,10 @@ static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb) > dir); > > if (usb_urb_dir_in(urb)) > - len = sg_pcopy_from_buffer(urb->sg, urb->num_sgs, > - urb->transfer_buffer, > - buf_len, > - 0); > + sg_pcopy_from_buffer(urb->sg, urb->num_sgs, > + urb->transfer_buffer, > + buf_len, > + 0); Why not test that this worked properly? thanks, greg k-h