Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp267909imm; Fri, 13 Jul 2018 23:45:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc/FYXqssB0tucDR5BatRE0L9BOpa73fogZMbD3FiEUhntI0yMA0F9T38YuN9o9VPSEJQRT X-Received: by 2002:a17:902:82c7:: with SMTP id u7-v6mr9090142plz.83.1531550741641; Fri, 13 Jul 2018 23:45:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531550741; cv=none; d=google.com; s=arc-20160816; b=AwasOrvlKJnEFH8mF96Z48jKldvAEGGGTKSYln6g37YNzYpvAzrhWteFQI6xC+Wm7V gbryA0hYAU7bSSeCAgS4NE2BFl/SZP4yZPq03EYo1lVtIBBS5is04sIMMCvEYrpXwDoP XsOHSGLB+Gz+lQWv5YaYOQDETdBg3xA3l957jxU8gAT1XVtNGcJgcPY3tEYPZYOwOxou XHFdDht+G5TN3mhMjESrd32U/W5D5jXcSaKNHlokomeFKwGGqF4vGgcJ+VMC80hFtZK5 U9oTUY0uUNnXEZbpjcWJWqXOnKpxXJ6WD7kSiy6Iuc7p8Th+1uGLQpnQ35Sfe2GeaDfA EMEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=s19SHndGrnAHrD0xsnFtATh0MQMQDtQxO+l9h2ZRoag=; b=ILKssV3YtI5sxVWLNTuTI8flAqNCfAm1u3AgX6NTaVBd8pSygzVYF3TxYk7WtjPsS7 +1eBmdUl8RR8Zj/qzcI8mnm03lRIDIFr1l/I0FE6A4N43/NO/GeJ22WzhHzWzgSCBIzM 9sdyU7JQdu04BOeIfhZw5ktKWWx6iuYFiE3cAV8JBvJLdTAAydOxwzOMKl8NHJXSQ7yD BYSnqsdFqKzCSUu/Uo3+C4pTVa6Fcypi/6YWmPNDjymirAnIfCXXvIB5LMWoEVrRR2pa 40PPSTwIXOm9op5LO70tUL/SnHYC+qj1NNnhfHIzdUTmfOm4oI8fcFEbrwnKa2WOT4uU ZOMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o12-v6si25190901plg.154.2018.07.13.23.45.25; Fri, 13 Jul 2018 23:45:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726119AbeGNHCr (ORCPT + 99 others); Sat, 14 Jul 2018 03:02:47 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54960 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725959AbeGNHCr (ORCPT ); Sat, 14 Jul 2018 03:02:47 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 91CC58A5; Sat, 14 Jul 2018 06:44:49 +0000 (UTC) Date: Sat, 14 Jul 2018 08:39:04 +0200 From: Greg Kroah-Hartman To: Todd Poynor Cc: Rob Springer , John Joseph , Ben Chan , devel@driverdev.osuosl.org, Zhongze Hu , linux-kernel@vger.kernel.org, Simon Que , Guenter Roeck , Todd Poynor , Dmitry Torokhov Subject: Re: [PATCH 13/18] staging: gasket: gasket_enable_dev fixups Message-ID: <20180714063904.GH20451@kroah.com> References: <20180714055816.223754-1-toddpoynor@gmail.com> <20180714055816.223754-14-toddpoynor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180714055816.223754-14-toddpoynor@gmail.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 13, 2018 at 10:58:11PM -0700, Todd Poynor wrote: > From: Todd Poynor > > Remove unnecessary variable. > > Bail out if no physical device. > > Signed-off-by: Todd Poynor > --- > drivers/staging/gasket/gasket_core.c | 19 ++++++------------- > 1 file changed, 6 insertions(+), 13 deletions(-) > > diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c > index 65aa7cf454fb..f7d8f66e8746 100644 > --- a/drivers/staging/gasket/gasket_core.c > +++ b/drivers/staging/gasket/gasket_core.c > @@ -915,8 +915,6 @@ static int gasket_enable_dev( > { > int tbl_idx; > int ret; > - bool has_dma_ops; > - struct device *ddev; > const struct gasket_driver_desc *driver_desc = > internal_desc->driver_desc; > > @@ -934,26 +932,21 @@ static int gasket_enable_dev( > return ret; > } > > - has_dma_ops = true; > + if (!gasket_dev->pci_dev) { > + gasket_log_error(gasket_dev, > + "%s: no physical device", __func__); > + return -ENODEV; > + } How can this ever be true? I don't see where this can be removed to enable this error check to be hit. What am I missing? thanks, greg k-h