Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp1162018pxt; Sat, 7 Aug 2021 02:37:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6qKKJg2HacnzN1K/PXmhyxmfTNDT25freM9wG7/cdCW//AqK5XNfNN0fSP3NTMUVrgyCH X-Received: by 2002:a92:6503:: with SMTP id z3mr79605ilb.258.1628329039707; Sat, 07 Aug 2021 02:37:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628329039; cv=none; d=google.com; s=arc-20160816; b=eMyyuoj9+77JUqfjs4SbwOyly3UgFHaJim0KMVhjyYpU1FTMu6taevSCFoLCDEoj4z f2uRsebTxD2wYAnVoiqLr37gV02DyeWRgOYQXT7fiRnogabJb95SThK8qL845W8APswC UbloE8W3uWRiGG2chp7EZSNIb6v5RAycDxiWm++18bn+7egvjNa9jAFeCGf7RvbY1uLa 2QASEwJPYrK+1RssOvNBVXCAwdW8lCPm3MI/E0TSkBKfQISUhdokrdl/yJ8GnpX7/d1U YDGYuXkIwMQkFEdKhLSMhrgaCyxekW7OQcVfRECefwXHUu0ZT3XRLujtB8BiGrXYvSCP NEmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=YrARYan7KJtIWHye6v0MrM4MZODB2NcevnUrIsONIw0=; b=DAfftuHslIaDFxqVd+cFtp30tOBb8Oaw7Smc6AzW6W6JPFNo2vmPtzU5EruUz/lN+/ 21gD+vk1H9HpvO7yPOOuOrUTHjc610i4rHtFPmu46EK0oHHkoEHj5PSNhs5jxNQY5rUO 3aRUn912NnTk/1VH7E7XZlVA7vLIwq5wvBdw/TFqSCnJCEXcpUcNR82ItKgItkegNf0J OI0Zcpw8nbqw3Z2KpEVhSymg7KJtFBiEQquXAE6peEP9J120/i425nCvHdRTZeru12X/ y8QnFqt5Yd2V6QKVDtJJrI9h+u4ZV+JbYPpu3jqfAlEZJXCiGKEGtuL6RVfGZvsbmvwU dijw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i4si6576420ilv.135.2021.08.07.02.37.08; Sat, 07 Aug 2021 02:37:19 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231741AbhHGJgi (ORCPT + 99 others); Sat, 7 Aug 2021 05:36:38 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:13246 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231633AbhHGJgh (ORCPT ); Sat, 7 Aug 2021 05:36:37 -0400 Received: from dggeme703-chm.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Ghcfd3Mg3z1CT0k; Sat, 7 Aug 2021 17:36:09 +0800 (CST) Received: from huawei.com (10.175.124.27) by dggeme703-chm.china.huawei.com (10.1.199.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Sat, 7 Aug 2021 17:36:18 +0800 From: Miaohe Lin To: CC: , , , , , , Subject: [PATCH 3/5] mm: gup: remove useless BUG_ON in __get_user_pages() Date: Sat, 7 Aug 2021 17:36:18 +0800 Message-ID: <20210807093620.21347-4-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20210807093620.21347-1-linmiaohe@huawei.com> References: <20210807093620.21347-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggeme703-chm.china.huawei.com (10.1.199.99) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Miaohe Lin --- mm/gup.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/gup.c b/mm/gup.c index d6056dcab02c..d7e4507de6b1 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -1149,7 +1149,6 @@ static long __get_user_pages(struct mm_struct *mm, * We must stop here. */ BUG_ON(gup_flags & FOLL_NOWAIT); - BUG_ON(ret != 0); goto out; } continue; -- 2.23.0