From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B73F9C47256 for ; Tue, 5 May 2020 09:33:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A0D79206B9 for ; Tue, 5 May 2020 09:33:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728487AbgEEJdq (ORCPT ); Tue, 5 May 2020 05:33:46 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:44627 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728180AbgEEJdq (ORCPT ); Tue, 5 May 2020 05:33:46 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jVtxP-0003YD-NN; Tue, 05 May 2020 09:33:43 +0000 From: Colin King To: Alexander Viro , Jens Axboe , linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH]i[next] io_uring: remove redundant check on force_nonblock Date: Tue, 5 May 2020 10:33:43 +0100 Message-Id: <20200505093343.41869-1-colin.king@canonical.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: io-uring-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org From: Colin Ian King The check on force_nonblock is redundant as this is performed several statements earlier and also returns with -EAGAIN. Remove the redundant check. Addresses-Coverity: ("Logicall dead code") Signed-off-by: Colin Ian King --- fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index e5dfbbd2aa34..4b1efb062f7f 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -2782,7 +2782,7 @@ static int io_splice(struct io_kiocb *req, bool force_nonblock) poff_in = (sp->off_in == -1) ? NULL : &sp->off_in; poff_out = (sp->off_out == -1) ? NULL : &sp->off_out; ret = do_splice(in, poff_in, out, poff_out, sp->len, flags); - if (force_nonblock && ret == -EAGAIN) + if (ret == -EAGAIN) return -EAGAIN; io_put_file(req, in, (sp->flags & SPLICE_F_FD_IN_FIXED)); -- 2.25.1