Received: by 2002:a05:6a10:c7d3:0:0:0:0 with SMTP id h19csp47472pxy; Fri, 13 Aug 2021 23:40:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsnJNcfvzfB02pdWChjB9SZLHyhJsYRDRPr+zjAVU+ep8R9AZqfIEPvBvE4hWbfyrESoRJ X-Received: by 2002:a05:6e02:17cf:: with SMTP id z15mr1326298ilu.103.1628923200899; Fri, 13 Aug 2021 23:40:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628923200; cv=none; d=google.com; s=arc-20160816; b=o2yx8VhUW82kQwcTycUqnw+HUy08QBnX47Sjxyw8n3U9EWx2w5/6jG523++ixA+lPJ LiExdKCde3u0zAK0mhO8dC1ic1udf1hcV9mOgVdYMXQfkh4eA3qDWLONqdnbZZEqdtFh LkuNJtpFx+ZTqnd9rc8d5U/7flbCVz2dupZvx24wpiw3+m5VHU64S9I4k3gSdXFPHzWe 3m0t3FC6HJVEBgOX/eOfqmQWtfEBAjeE1hYey4thic34c1Oiaek0IZC+bVayNvH+Q7qT 0HRbpozGVGlzp8Dw31mNPeElvBYn0VAS4lzmh3S+HHQnz6KxSPwFRJ8F73ntqLM3mUQ7 aZdw== 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=Pt2xfxqC/8NB0egBfx3SuVDqN9wnKxPzTgdhelwdbvc=; b=cV2TvzGVL219ciZFJWtqvh8u4VFTtULJVmCdDexuSYP/98bG2NQ/zt2gcollTpM5kF GbR4Z+FGX6sc4qYPDstEYe3Oa73tTcipJhe6i+dEQHGTi0LYMp4h9/vwLsaDHeim/y9l w9on67UCkfzv329WWZlv069i8dkAIQ4FC7e7kDHr3gNZ245Ti5zGCuPbzjcQ83tFQDf5 oT4HJBDLengt8/iGEF9h53hArpeMwkNFgkpSbBcMazP+qnbYddkNoDL6ihIxewVs66ff rmS39BgBME0Xw5GYSih00MDZJilejfAnUNkGXXG3vUExOg0bCscdqgubpV8lBL6Sfh3G 3aKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=thhtb19F; 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 p14si4036195jas.66.2021.08.13.23.39.48; Fri, 13 Aug 2021 23:40:00 -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=thhtb19F; 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 S237072AbhHNGf2 (ORCPT + 99 others); Sat, 14 Aug 2021 02:35:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:52720 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232021AbhHNGf0 (ORCPT ); Sat, 14 Aug 2021 02:35:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7C4C260F42; Sat, 14 Aug 2021 06:34:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628922899; bh=oGtCt58JZdQiy65LwaHzaDn8T8xIXJtqmI5aaXJcyuk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=thhtb19F8xctA5Icf80p/PaOqEb1XnQMEjYzQqQTuKWptreYYlXDrnkNMh/6VpXrI fvKu54R4raNNkrVXamAGhCm2Rzet7GJUYcpfyrmvUVEuwe9er5YOOM/cYn6UBDkhUJ texw5uJ1h19DmphJl5aSOqGC8xpYzGeYcJCza4kQ= Date: Sat, 14 Aug 2021 08:34:54 +0200 From: Greg Kroah-Hartman To: Salah Triki Cc: Keith Packard , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: misc: chaoskey: remove useless else Message-ID: References: <20210813164049.GA2310720@pc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210813164049.GA2310720@pc> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 13, 2021 at 05:40:49PM +0100, Salah Triki wrote: > Remove useless else in order to make the code cleaner. > > Signed-off-by: Salah Triki > --- > drivers/usb/misc/chaoskey.c | 11 ++++------- > 1 file changed, 4 insertions(+), 7 deletions(-) > > diff --git a/drivers/usb/misc/chaoskey.c b/drivers/usb/misc/chaoskey.c > index 87067c3d6109..9814ac2201d5 100644 > --- a/drivers/usb/misc/chaoskey.c > +++ b/drivers/usb/misc/chaoskey.c > @@ -299,14 +299,11 @@ static int chaoskey_release(struct inode *inode, struct file *file) > > --dev->open; > > - if (!dev->present) { > - if (dev->open == 0) { > - mutex_unlock(&dev->lock); > + mutex_unlock(&dev->lock); > + > + if (!dev->present) > + if (dev->open == 0) > chaoskey_free(dev); > - } else > - mutex_unlock(&dev->lock); > - } else > - mutex_unlock(&dev->lock); > > usb_dbg(interface, "release success"); > return 0; > -- > 2.25.1 > Please fix whatever tool "found" this code to be changed so that it does not introduce bugs again, that's a broken tool. thanks, greg k-h