From patchwork Tue Feb 25 13:25:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 11403795 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 CFBDF17D5 for ; Tue, 25 Feb 2020 13:27:13 +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 B593120658 for ; Tue, 25 Feb 2020 13:27:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B593120658 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org 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 1j6aDt-00089d-OP; Tue, 25 Feb 2020 13:26:05 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j6aDs-00089W-QO for xen-devel@lists.xenproject.org; Tue, 25 Feb 2020 13:26:04 +0000 X-Inumbo-ID: 5e77c562-57d2-11ea-9300-12813bfff9fa Received: from mail-ed1-f67.google.com (unknown [209.85.208.67]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 5e77c562-57d2-11ea-9300-12813bfff9fa; Tue, 25 Feb 2020 13:26:03 +0000 (UTC) Received: by mail-ed1-f67.google.com with SMTP id v28so16186738edw.12 for ; Tue, 25 Feb 2020 05:26:03 -0800 (PST) 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; bh=uZA9A6HxbvZTEBvpgsZ28pS/XyxkUyt0ZrvPfBZrho4=; b=N9RUHcYrQ774yl+OulM7PQaM8huHJ8A3hB8U0zpeCbEfQbmZkcECH7XnGZ/zHSPu9B FeimUOrM9esEY+AGWgMcP08fsvmfKfUYiR5JGSV8FqaYakplrUzSjFt9vNBTO46xNrfu CrI4wgaeSvJm6XN4519I+bT09M9Wg6dffEOZDGl9o7CYNlQhJqzHJwTjIEIpJZewl9hb /M2iUUW1rX9WSI/60d1wf76cyAs7UAe/yAurGV8StHM03VQ1DzsKXQbFI/5RIu8OI7/h hZ/vUUyP9GOjNOC+BKXXjx3/EFt9KlqlL0Fo0BZEN5f0jV6L6azhUSkvdwAt3OlRw2L5 dPOA== X-Gm-Message-State: APjAAAXjNE70rF/7LTo3z3Zn0MRMml7Mol2NMmnx9b4KDAo4O0gyqZ19 +JGdKN4BSS7dXVWtPRa4ukF+JrKPEC0= X-Google-Smtp-Source: APXvYqwy9rB6Bm71qBiS2+cq0l76GImr6YPu2vYdk0M2sVt+vJMbhDsRp6fC9aYSz6qIfz8KBMA9gA== X-Received: by 2002:a17:906:8306:: with SMTP id j6mr51613585ejx.105.1582637162276; Tue, 25 Feb 2020 05:26:02 -0800 (PST) Received: from ufe34d9ed68d054.ant.amazon.com (54-240-197-235.amazon.com. [54.240.197.235]) by smtp.gmail.com with ESMTPSA id y4sm958463ejj.87.2020.02.25.05.26.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2020 05:26:01 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Tue, 25 Feb 2020 13:25:58 +0000 Message-Id: <20200225132558.26152-1-julien@xen.org> X-Mailer: git-send-email 2.17.1 Subject: [Xen-devel] [PATCH] xen/grant-table: Remove outdated warning in gnttab_grow_table() 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: Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , Andrew Cooper , Julien Grall , Ian Jackson , George Dunlap , Jan Beulich MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" One of the warning message in gnttab_grow_table() refers to a function was removed in commit 6425f91c72 "xen/gnttab: Fold grant_table_{create, set_limits}() into grant_table_init()". Since the commit, gt->active will be allocated while initializing the grant table at domain creation. Therefore gt-active will always be valid. Rather than replacing the warning by another one, we can now downgrade the check to an ASSERT(). Signed-off-by: Julien Grall --- xen/common/grant_table.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index bc37acae0e..930d20b346 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -1793,11 +1793,7 @@ gnttab_grow_table(struct domain *d, unsigned int req_nr_frames) struct grant_table *gt = d->grant_table; unsigned int i, j; - if ( unlikely(!gt->active) ) - { - gprintk(XENLOG_WARNING, "grant_table_set_limits() call missing\n"); - return -ENODEV; - } + ASSERT(gt->active); if ( req_nr_frames < INITIAL_NR_GRANT_FRAMES ) req_nr_frames = INITIAL_NR_GRANT_FRAMES;