From patchwork Thu Mar 19 04:06:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= X-Patchwork-Id: 11446463 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 5E4B71392 for ; Thu, 19 Mar 2020 04:09:44 +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 300522072C for ; Thu, 19 Mar 2020 04:09:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Kbx8CKEi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 300522072C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=invisiblethingslab.com Authentication-Results: mail.kernel.org; spf=pass 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 1jEmTL-0003Wr-Mi; Thu, 19 Mar 2020 04:07:55 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jEmTK-0003Wm-8k for xen-devel@lists.xenproject.org; Thu, 19 Mar 2020 04:07:54 +0000 X-Inumbo-ID: 342c75b0-6997-11ea-b34e-bc764e2007e4 Received: from out4-smtp.messagingengine.com (unknown [66.111.4.28]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 342c75b0-6997-11ea-b34e-bc764e2007e4; Thu, 19 Mar 2020 04:07:53 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 2CA815C02B0; Thu, 19 Mar 2020 00:07:52 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 19 Mar 2020 00:07:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=JqZGVe m4rI66UrgmQlCfN5l+r//ZyO/zrduFLQUqFkQ=; b=Kbx8CKEieLma6upRs2muMG 15H4EBafz+XjJQCJYzbgTzoFdPa7GoiTeRe0ngQIgIqCP1OR5fojIDYoQQXGMfWJ zW9hFwlygiMbyXLHCF8VRPEQi6Ya93W2sonbg0CvGdinOf5gIs/mpqgiefDZ4ngp YT4L7NeWlTomatV4tiVG/653NJCUZ0yBBxZ+iHqTlShWKOvTo4q7mG7wMwDs4jfY 03tlTocXY9F//JkFyOTcVlcig5GnRL655lfJJ2qUJ1Upm8jsgZqMxOrtdKqfT7q1 tU6WbGsxkE9Qt8eKQRbHFE/X2fFFrSWeVBoLLCHkfe70TSJQoNus97iHXwVZRihQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudefkedgieelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffogggtohfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucfkphepledurdeihedrfeegrdef feenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg hrmhgrrhgvkhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhm X-ME-Proxy: Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id 8C7763280063; Thu, 19 Mar 2020 00:07:50 -0400 (EDT) From: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Thu, 19 Mar 2020 05:06:40 +0100 Message-Id: <20200319040648.10396-1-marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Organization: Invisible Things Lab Subject: [Xen-devel] [PATCH] xen-pciback: fix INTERRUPT_TYPE_* defines 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 , =?utf-8?q?Marek_Marczykowski-G?= =?utf-8?q?=C3=B3recki?= , open list , Simon Gaiser , Boris Ostrovsky , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" INTERRUPT_TYPE_NONE should be 0, as it is assumed in xen_pcibk_get_interrupt_type(). Fix the definition, and also shift other values to not leave holes. But also use INTERRUPT_TYPE_NONE in xen_pcibk_get_interrupt_type() to avoid similar confusions in the future. Fixes: 476878e4b2be ("xen-pciback: optionally allow interrupt enable flag writes") Signed-off-by: Marek Marczykowski-Górecki --- drivers/xen/xen-pciback/conf_space.c | 2 +- drivers/xen/xen-pciback/conf_space.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/xen/xen-pciback/conf_space.c b/drivers/xen/xen-pciback/conf_space.c index b20e43e148ce..b4e4ec9cd496 100644 --- a/drivers/xen/xen-pciback/conf_space.c +++ b/drivers/xen/xen-pciback/conf_space.c @@ -290,7 +290,7 @@ int xen_pcibk_get_interrupt_type(struct pci_dev *dev) { int err; u16 val; - int ret = 0; + int ret = INTERRUPT_TYPE_NONE; err = pci_read_config_word(dev, PCI_COMMAND, &val); if (err) diff --git a/drivers/xen/xen-pciback/conf_space.h b/drivers/xen/xen-pciback/conf_space.h index 28c45180a12e..5fe431c79f25 100644 --- a/drivers/xen/xen-pciback/conf_space.h +++ b/drivers/xen/xen-pciback/conf_space.h @@ -65,10 +65,10 @@ struct config_field_entry { void *data; }; -#define INTERRUPT_TYPE_NONE (1<<0) -#define INTERRUPT_TYPE_INTX (1<<1) -#define INTERRUPT_TYPE_MSI (1<<2) -#define INTERRUPT_TYPE_MSIX (1<<3) +#define INTERRUPT_TYPE_NONE (0) +#define INTERRUPT_TYPE_INTX (1<<0) +#define INTERRUPT_TYPE_MSI (1<<1) +#define INTERRUPT_TYPE_MSIX (1<<2) extern bool xen_pcibk_permissive;