Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp214558ybg; Wed, 18 Mar 2020 21:08:22 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvtVIuInUF0fU7Zk01dyCx5kijJ3xDpIhL0mdbiBB48zzBzegN1uaJaazldPCV5Lch4IPHW X-Received: by 2002:a9d:74cf:: with SMTP id a15mr803237otl.258.1584590901959; Wed, 18 Mar 2020 21:08:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584590901; cv=none; d=google.com; s=arc-20160816; b=c5fcHkH+i3VhUayhN2jmE/5/RHXnUR36+bfm5ybxTPcRwFopc8U/SYVO14c9yCG8pR RozKBTqXCi/pNAMs2vnWOX2POgZFul/Ht+xvXoAvZEe6FazWux33NcsyPoGj1lH/CNoK jLy5ZMCO0XZN7ziyuyNUZdbQJo9KZO829LZxGgzr/zP4GWuVfvrgOeWiOwvQloF6I6TY 7pOLZfCFTk+ftodLDMhk7XpCP4du0PjYrw8hYkG3/zoQPeO4NvyyyK1ETkpAi+0a6bJx lIBNOvCf4azrFWG/g50vgN0+J+E7ioaK+sJKj2L9ZwJDMHBBdBz2bLScYj9/7DvxUS7J ILgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:organization :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=JqZGVem4rI66UrgmQlCfN5l+r//ZyO/zrduFLQUqFkQ=; b=vydD5oaRZxb9tTFZynBQFRDEIOj3+Q0zZtTps/2IlfuN3YzbuaPha+LsIglWJm953j SGOV1q/ZOvNIOFQdrxhFGGwAjtx4MTbh4YjPWO+LTUoR6hEzOJQ4LInqiFS3AojrTN9W OexEKRteDEZBmTXWucb4bulpmxmRDRuDsw2ZJLtaVfbr2KOkRFcDE+/rGyMJx1Jyt5pM 0+KrxnW4Myx9EmXM8+WMZnS7NGDD0sNF5+JZ1wixeojcMqR3PnpNz0YM3YKMqTKcP/RS se7QM4oCzvLTlr3V3nq81VCOPdrDWpDQeLAYi+TIwxjdRA4mPocGPovsjdLzYfCt2XoP eDDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Kbx8CKEi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e15si388862oie.5.2020.03.18.21.08.08; Wed, 18 Mar 2020 21:08:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Kbx8CKEi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725856AbgCSEHy (ORCPT + 99 others); Thu, 19 Mar 2020 00:07:54 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:43275 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725601AbgCSEHx (ORCPT ); Thu, 19 Mar 2020 00:07:53 -0400 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=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Cc: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Simon Gaiser , linux-kernel@vger.kernel.org (open list) Subject: [PATCH] xen-pciback: fix INTERRUPT_TYPE_* defines 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 Content-Type: text/plain; charset=UTF-8 Organization: Invisible Things Lab Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.21.0