From patchwork Thu Sep 2 21:53:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12472773 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 245BCC433EF for ; Thu, 2 Sep 2021 21:53:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D2E27610A2 for ; Thu, 2 Sep 2021 21:53:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D2E27610A2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 6A7C86B00AF; Thu, 2 Sep 2021 17:53:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5B9168D0001; Thu, 2 Sep 2021 17:53:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 45B5B6B00B1; Thu, 2 Sep 2021 17:53:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0037.hostedemail.com [216.40.44.37]) by kanga.kvack.org (Postfix) with ESMTP id 318356B00AF for ; Thu, 2 Sep 2021 17:53:41 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id EBEAF1802ACAC for ; Thu, 2 Sep 2021 21:53:40 +0000 (UTC) X-FDA: 78543985800.02.667885E Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf26.hostedemail.com (Postfix) with ESMTP id A214F20019C3 for ; Thu, 2 Sep 2021 21:53:40 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 986D9610CE; Thu, 2 Sep 2021 21:53:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1630619619; bh=DTWTG9gVWp/29o4HzhhVP89+snAjpOzavGc7cJ3XeDM=; h=Date:From:To:Subject:In-Reply-To:From; b=IC+WlbhFzb+/Dhm5gaRPu0vCgilVZI82+y0C7aESs2jmryFL/CIzR+QSHNZIhxRyb lGGMdRT9VPc7dQYwZCBRmvNSbMV1VN9cp4O99coevUWEp8gOIr82C/sdwfgjcG5R++ OfgugHm4iksC+NRRGJfRi0mYwZAKXL9qph6oerRA= Date: Thu, 02 Sep 2021 14:53:39 -0700 From: Andrew Morton To: akpm@linux-foundation.org, david@redhat.com, imbrenda@linux.ibm.com, jack@suse.cz, jhubbard@nvidia.com, kirill.shutemov@linux.intel.com, linmiaohe@huawei.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, torvalds@linux-foundation.org Subject: [patch 070/212] mm: gup: remove useless BUG_ON in __get_user_pages() Message-ID: <20210902215339.7BPbOm3ul%akpm@linux-foundation.org> In-Reply-To: <20210902144820.78957dff93d7bea620d55a89@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=IC+WlbhF; spf=pass (imf26.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: A214F20019C3 X-Stat-Signature: gf8jo5b1up87nq55h4qqxsu8agoycwdu X-HE-Tag: 1630619620-375409 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Miaohe Lin Subject: mm: gup: remove useless BUG_ON in __get_user_pages() Indeed, this BUG_ON couldn't catch anything useful. We are sure ret == 0 here because we would already bail out if ret != 0 and ret is untouched till here. Link: https://lkml.kernel.org/r/20210807093620.21347-4-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: John Hubbard Reviewed-by: David Hildenbrand Reviewed-by: Claudio Imbrenda Cc: Jan Kara Cc: Kirill A. Shutemov Signed-off-by: Andrew Morton --- mm/gup.c | 1 - 1 file changed, 1 deletion(-) --- a/mm/gup.c~mm-gup-remove-useless-bug_on-in-__get_user_pages +++ a/mm/gup.c @@ -1149,7 +1149,6 @@ static long __get_user_pages(struct mm_s * We must stop here. */ BUG_ON(gup_flags & FOLL_NOWAIT); - BUG_ON(ret != 0); goto out; } continue;