Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp945805pxb; Fri, 13 Aug 2021 09:44:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBPO8AhztPq6ldlrC+xSv89s9zta2i0C2UBEoGBoSW4SEwQHw9BUMzE1OLgfaVn9II4jD0 X-Received: by 2002:a17:906:17c4:: with SMTP id u4mr3401369eje.481.1628873087434; Fri, 13 Aug 2021 09:44:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628873087; cv=none; d=google.com; s=arc-20160816; b=j1gyWsOy3/rEXM8jzFuLlHZIokyGD655nMCKWAkUWOl743vUxxeYwsT295pEJxe8BS L4nxeDP0Ulm5WvDxD2H3dbMVzSYFvLTM2dz3rdRGFR8pKWHBgh01CveFORv/9VYttDXQ pK5CmyXGvvMWpKeodjeutjAf7qPQcz2EqawD1bfN0y0pDReIwXM49nOSjmUq/869pWdc Xj4Ze7u2VQcd4HvdV4wU/Ag8MJPIPvbnPhknOHJu9J1EGrtDwiHqu5SpZ6pigixOFSJV ngDWJAiWWwmMxfLAfmCfAnqWVsV7SH9vN6qLnJJ/ra3gPgKWQNeIzjTE1O7FNJ30xaKU /Kug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=bg+ey9jn4eCnxo8lKaJlDWoU38GqGlmQ73XY5Oghpto=; b=N/99q3PzkoIwowlT8zuX0ZEy5Pcsp2BjKv2sSYWOMegpSQSzRC0PWchN2fpDF6htL1 kLbaTZ1LLdgPEdyss0zu1651MOAx1phGeB1sIP64ESiDyhJLEkTsNSd/euZOHtsHuLDE 1K28HcslorrrKNS5ISUTJNpgRBze2rjkSp+4EApM2JeIt/ne7bVSzA1e419N83KfC7PU vDmVYfD+bQO8OxmDqK735YONmgYb29C0WdSsWe5b1U91j2MXoDVT+9U4CCWYACzgk6Q4 HBa8CprKmTdoQ4r+T4cVCNLTYY9EurxMYKdpUaizI2UScEquWiUg+as6L2D5nBjHlAWH zfLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=m38Siw5G; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s10si2450502edd.264.2021.08.13.09.44.23; Fri, 13 Aug 2021 09:44:47 -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=@gmail.com header.s=20161025 header.b=m38Siw5G; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235757AbhHMQlW (ORCPT + 99 others); Fri, 13 Aug 2021 12:41:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233838AbhHMQlW (ORCPT ); Fri, 13 Aug 2021 12:41:22 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2874FC061756; Fri, 13 Aug 2021 09:40:55 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id o1-20020a05600c5101b02902e676fe1f04so8012745wms.1; Fri, 13 Aug 2021 09:40:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=bg+ey9jn4eCnxo8lKaJlDWoU38GqGlmQ73XY5Oghpto=; b=m38Siw5Gbam+IOURK2ZK13+BuFuM7+/tFvcTXm9BY15+1V/J1ZyOUbcNLgReI4RxhF 9A8pLcmDVKdMWWyVLLrP8Oyxgpg9ynvWY7RKdBwD7wv7cLhyXgNIK4qiA8NzdTsuhY5T qYSYWzGi6aLBoH8iZtOVKt7ErSklgGcF5e07tUPodZK6Lu4Sorr8vCe80eN3cOLibEww Rd7NSCnJ4HiTqtYBbklf4sZBtzIDi3AjZCRdD2YPMvykbkPYKehlFGEZTV++67itIz2e 4xscEI4oG8Ko3tX989VL64qj68tmH+gi1LzHBQABRWTmt+HsW0+hkKCuVpDRSh1CCG6R ZzLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=bg+ey9jn4eCnxo8lKaJlDWoU38GqGlmQ73XY5Oghpto=; b=Gc7ofzeH0bMKjo6dAXY3X8imLRHmeJ3d7HhHBVjPutT19v7gV1O4t7YpNstXOT3cQo 6vS2tTO9YIQGfzVQAA5MKBTJetOy1GA4yUOvXZQmUGUQlcfLmrQjIGjypTgpqJMK/JWC R+lfs9KTaePUyEXIUIMuU6Y9ZDSGlpMAYz1BGXYI6iS/daE6LRsDG1jEAbrvWN/tVxVm 33JmSkYGSShBeZbSJlCZv5p80GzWfkRMTAON5QPP5D0He2k7j3MrtNi9ewX/zoXhpWWc srx3lyhAlXNy7JK56RTeEzM6jzQ6zKgXxdef8A+rkNdZklRaaSFiTCWdxNyh9zr8w9Cb xCJA== X-Gm-Message-State: AOAM5317ueZAId8/I6HjyvJfVRRujEaJGaSAhjjevN6eQiuNb8xC00b6 uYaL5F4T34QviIkkmFub0CM= X-Received: by 2002:a1c:9a8b:: with SMTP id c133mr3474079wme.103.1628872853722; Fri, 13 Aug 2021 09:40:53 -0700 (PDT) Received: from pc ([196.234.235.93]) by smtp.gmail.com with ESMTPSA id d13sm1604669wra.70.2021.08.13.09.40.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Aug 2021 09:40:53 -0700 (PDT) Date: Fri, 13 Aug 2021 17:40:49 +0100 From: Salah Triki To: Keith Packard , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: misc: chaoskey: remove useless else Message-ID: <20210813164049.GA2310720@pc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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