Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4235083imu; Sat, 19 Jan 2019 05:18:09 -0800 (PST) X-Google-Smtp-Source: ALg8bN5qWOHlwZuHIxFajwOHiUcHzllba/+UeFUVVJoQGKS1rFRurDoXcwHiFoY6SwMQba9v5iex X-Received: by 2002:a62:6e07:: with SMTP id j7mr23812399pfc.135.1547903889634; Sat, 19 Jan 2019 05:18:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547903889; cv=none; d=google.com; s=arc-20160816; b=IoyACweag7/MaYttooYtQlYzU3CBNmo1FDaeYM1g4hlqxb5Eu6nnUrJAbF2f8w72ou xiAvQLAVC3ou2xmx+43JeM0bELHK9l0hpr+Q1u8pmiTT0jEZn1D1otCoNwvD9MTpHnmK Lmv12+NhNL2aRJU9UsjAOL7G3RfKjEGlCzhfQxepa/Rpfskz94jgj0yYwBey+7DzPOiO m6LbwhMRu0Xn3N3obYWtFLJiqiXvqlg3q9W/vtVEMLnrnCciBkE/tb1nNYi/FLGcZTOr vMbq8i/Zvx5Lbw6efISi9ZxnB7ySfim68NxPeMXHvTrfAqQOg5KQoPXy310QAMqAygOx 2dYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=6Usb1G2zB/mi3ZYQqdKNDMxoFb3DbC7dKskUTEEBBhU=; b=ESE53Bpm99Pbzplc3swFdl9jPiAc5mfq31VQ/sBjTUly2nni1Omaqq70osn+YC/b5f 2wE+/yRAmPYbXle6maqcSEr2Zs7gobrA9ySgZpMcC6XvkGlOfVvZbnPcUGBGhViAWSml TwhDQ8XFnWIkxBrxZhdXu0qb3eCTZd6PvDbBeDt8qrhajG7eAUyXVNksHLuExIPN4BEu xW1YV8X4S2i241KhbU5BJ/Ga+4W+Wap+D8nj4s/nKABAs4A1Pf02HtexgFfwIxkoMyFx rt/ET5wHE6BZDV2zaWUrLCb9LMmzKJfWEjA2eRSfVwXnVRKX5QyDU9HBpAg/3Vr/T7+9 V8fw== 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 q7si7446505pfa.99.2019.01.19.05.17.53; Sat, 19 Jan 2019 05:18:09 -0800 (PST) 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 S1728137AbfASNPr (ORCPT + 99 others); Sat, 19 Jan 2019 08:15:47 -0500 Received: from mout.gmx.net ([212.227.15.18]:51943 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727965AbfASNPq (ORCPT ); Sat, 19 Jan 2019 08:15:46 -0500 Received: from localhost.localdomain ([116.30.194.192]) by mail.gmx.com (mrgmx002 [212.227.17.184]) with ESMTPSA (Nemesis) id 0M9b03-1gw64G47wd-00CwVv; Sat, 19 Jan 2019 14:15:45 +0100 From: Chengguang Xu To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Chengguang Xu Subject: [PATCH] uio: remove redundant check Date: Sat, 19 Jan 2019 21:15:34 +0800 Message-Id: <20190119131534.13434-1-cgxu519@gmx.com> X-Mailer: git-send-email 2.17.2 X-Provags-ID: V03:K1:6j5u0xjxOb9QjftycIktpbOM3JqMWTyc0vHezmJRs/2CsqhXCjn XW38DAzg+IQNdKmrcteFelq0l9CHCuSgfkYB74EoPE2crnPAeJPIKWfu7AUQd6P1jHwf+rl 0SSfaOgT3Wo+18C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lTfv5Rb67NXDaM9gAHNiuIRAE38B9y5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is not necessary to check idev->info several times under mutex lock, so just remove redundant check. Signed-off-by: Chengguang Xu --- drivers/uio/uio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c index 46e5c1c31ebe..effe72834c2f 100644 --- a/drivers/uio/uio.c +++ b/drivers/uio/uio.c @@ -494,7 +494,7 @@ static int uio_open(struct inode *inode, struct file *filep) goto err_infoopen; } - if (idev->info && idev->info->open) + if (idev->info->open) ret = idev->info->open(idev->info, inode); mutex_unlock(&idev->info_lock); if (ret) @@ -635,7 +635,7 @@ static ssize_t uio_write(struct file *filep, const char __user *buf, goto out; } - if (!idev->info || !idev->info->irq) { + if (!idev->info->irq) { retval = -EIO; goto out; } -- 2.17.2