From patchwork Tue Dec 17 20:53:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Pakki X-Patchwork-Id: 11298725 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 843CE921 for ; Tue, 17 Dec 2019 20:55:23 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 551A9206D8 for ; Tue, 17 Dec 2019 20:55:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=umn.edu header.i=@umn.edu header.b="KW9uxdKV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 551A9206D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=umn.edu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ihJr9-0000hI-2N; Tue, 17 Dec 2019 20:54:11 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ihJr7-0000hD-Mx for xen-devel@lists.xenproject.org; Tue, 17 Dec 2019 20:54:09 +0000 X-Inumbo-ID: 59b3d9ca-210f-11ea-a1e1-bc764e2007e4 Received: from mta-p7.oit.umn.edu (unknown [134.84.196.207]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 59b3d9ca-210f-11ea-a1e1-bc764e2007e4; Tue, 17 Dec 2019 20:54:00 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-p7.oit.umn.edu (Postfix) with ESMTP id 47cr3D091Nz9vLGV for ; Tue, 17 Dec 2019 20:54:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at umn.edu Received: from mta-p7.oit.umn.edu ([127.0.0.1]) by localhost (mta-p7.oit.umn.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jBcfM2gpgR21 for ; Tue, 17 Dec 2019 14:53:59 -0600 (CST) Received: from mail-yb1-f198.google.com (mail-yb1-f198.google.com [209.85.219.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mta-p7.oit.umn.edu (Postfix) with ESMTPS id 47cr3C61SPz9vLGj for ; Tue, 17 Dec 2019 14:53:59 -0600 (CST) Received: by mail-yb1-f198.google.com with SMTP id y204so7986663yby.18 for ; Tue, 17 Dec 2019 12:53:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umn.edu; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=knhSf+eyCdoX1uYdgnl9DAzGqM/zDzsAxGOMt75GOeY=; b=KW9uxdKVEE1cGboEmFPtl1bF+X0FhEtizkUnApethUm/LhLaZszjO3xBtQCAIuI1Ar 2SK9l6JiGdphs8PEFxbVTQKAQwDAMzijOfUw5x+JwRfDC0O2cl0a5F8oG6ejZ1SW6zSp wabutn9GBBX35Wf0/fzS8xQx0FrLU4eRhy+S6/sd4As/7jaNgpHp6v8+h0eXo0fjxpXK h3TNpQsiC5U2tXb6B6bNEe1uKsFyO+HSBQSNyaaHaU5ZfeItF9bnUV/KcT4LyRMoueDM TK41NghYcTzCTo3hT5T68vg3M/V55K02wE8nLdtdqfhBmNvgBcObaDY+P8lfgJ4ITY2D 3FIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=knhSf+eyCdoX1uYdgnl9DAzGqM/zDzsAxGOMt75GOeY=; b=OGGHVKk6Z3FoN3kZe+2QIEgCCeJKB9IWSYAz8WoRh12Z2OGoXgnmRRLys10sgxzn2L yLery2pY03+GHUkEiNmhZZB/LMVi+CDIewFMsjei0qAIvvdtQFtYMMSm5WpmaZXC3umU 7sLcv2ouU5xPSMnPnjhocw8MiYXoVQVghIdC/jNEJVsT4biZgjSKSUtSmn9qa8HnRgUy Ikj6j89ZLfWg5jdiZpipSaFt8nXhKYnjn0mozqld3tAx+E3tdvLA3aBs+Z+Y7mQKt04J sxiE54D+SE3+ln9V5tDwD2/fALHmM6xpDEttjeaWEZlMH3PGjy5ulaFKJq37MJbA7sFA 8Wuw== X-Gm-Message-State: APjAAAXHeXKkj1/9Eu1QujWa0wKfOHqOsMv1DdU1kt2baAk9jc2P4q0g J93ziYMWDU0rlf7y3EZrYC8r7bUArAKvGOGGpmi2a1ks+kOIxaK6u7aI+qN/iDojbRPks3+8LF2 0ggCixtJTXXK1fzJraQHuyrG78fj4wnc= X-Received: by 2002:a25:dd04:: with SMTP id u4mr21884ybg.419.1576616039238; Tue, 17 Dec 2019 12:53:59 -0800 (PST) X-Google-Smtp-Source: APXvYqzgA5SI4ho9qhM2qkA9c0wLxK4/wVAABvXhm0AgOJCd5pQ/kuKS89YzxeQKtfbjs+EEsNCSGQ== X-Received: by 2002:a25:dd04:: with SMTP id u4mr21862ybg.419.1576616039020; Tue, 17 Dec 2019 12:53:59 -0800 (PST) Received: from cs-u-syssec1.dtc.umn.edu (cs-u-syssec1.cs.umn.edu. [128.101.106.66]) by smtp.gmail.com with ESMTPSA id d143sm8500294ywb.51.2019.12.17.12.53.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 12:53:58 -0800 (PST) From: Aditya Pakki To: pakki001@umn.edu Date: Tue, 17 Dec 2019 14:53:56 -0600 Message-Id: <20191217205356.29172-1-pakki001@umn.edu> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2] xen/grant-table: remove multiple BUG_ON on gnttab_interface X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , kjlu@umn.edu, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, Boris Ostrovsky Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" gnttab_request_version() always sets the gnttab_interface variable and the assertions to check for empty gnttab_interface is unnecessary. The patch eliminates multiple such assertions. Signed-off-by: Aditya Pakki Reviewed-by: Juergen Gross --- v1: Eliminate more BUG_ON calls, as suggested by Juergen Gross. --- drivers/xen/grant-table.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c index 49b381e104ef..7b36b51cdb9f 100644 --- a/drivers/xen/grant-table.c +++ b/drivers/xen/grant-table.c @@ -664,7 +664,6 @@ static int grow_gnttab_list(unsigned int more_frames) unsigned int nr_glist_frames, new_nr_glist_frames; unsigned int grefs_per_frame; - BUG_ON(gnttab_interface == NULL); grefs_per_frame = gnttab_interface->grefs_per_grant_frame; new_nr_grant_frames = nr_grant_frames + more_frames; @@ -1160,7 +1159,6 @@ EXPORT_SYMBOL_GPL(gnttab_unmap_refs_sync); static unsigned int nr_status_frames(unsigned int nr_grant_frames) { - BUG_ON(gnttab_interface == NULL); return gnttab_frames(nr_grant_frames, SPP); } @@ -1388,7 +1386,6 @@ static int gnttab_expand(unsigned int req_entries) int rc; unsigned int cur, extra; - BUG_ON(gnttab_interface == NULL); cur = nr_grant_frames; extra = ((req_entries + gnttab_interface->grefs_per_grant_frame - 1) / gnttab_interface->grefs_per_grant_frame); @@ -1423,7 +1420,6 @@ int gnttab_init(void) /* Determine the maximum number of frames required for the * grant reference free list on the current hypervisor. */ - BUG_ON(gnttab_interface == NULL); max_nr_glist_frames = (max_nr_grant_frames * gnttab_interface->grefs_per_grant_frame / RPP);