Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp53049ybt; Tue, 7 Jul 2020 15:51:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYMrZQjaStTIqIyVC5OucgdcPp9OSSTdTij+8gPAQ1+RGB/dVZ9aHw7trdMSEOs0DCeiqv X-Received: by 2002:a50:a1e7:: with SMTP id 94mr62099111edk.165.1594162287650; Tue, 07 Jul 2020 15:51:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594162287; cv=none; d=google.com; s=arc-20160816; b=cBzuaHtKOINHTAHo1ZbWeQu3rVl9b5j6OLEk4f99n+k+Lm2rQdDNuWFIQgOynKUTOr yqCyqyT4oQOLFKFD4znSUXkBfoZZ89dEbN72FY1JdAHOBy9RryIVzwQyGS1s97P1QNY/ ZHRxGkuh6bt2QJw4JbiW3EK85DLy1wak3vnPdzEyoc6LH7zLuK/arilrUP0qg228JDhr XC00uc4fwcTaw9xp+fz5CtmBoLvAZoO/Lc4IzrvOGT5RjoTDKvtAOvJ3ZiJo9sf+T599 W18mieao4fOnlmy39ybVafIk2iaB/VBr2ZrwOLUr0ZbJs23nlrFr9DpjrgvSff+4TOvv vg/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=zNf+o78ZRq4zBvLqZJ7wSslMRPp7azn9MkyUVzDX//k=; b=y2tmVAydUkiBdnZEYydNPSsDu93JXUy7q5SISMhs1HowpgA1UlPYk0CXq5H+p+jZRR nndZDp0YwjnCwgbvzO01BSumY6gES+cX4PrsKl9K1+QmTMVfIlG8F6mQgfefZhlbC1gI uiezczMT3FzjMnXljv44FYMpMgtu5sOVTKySN/HW2W4+KWyt4ZMUwvGFw47hJaKmh5Ni 6+56+2n/HzLBbRnIJanlxXNlJhp+WUOFC70kPF8VrH64iEWJsAPgutBLqoMjyd31iTMv A2PJyO3MJ+4BBLzPPxh8ywi3L7LQ20hCkgxeecVPMe0OUPod8qH1nU9P7sB9nDpHIi+A VB4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BoMX280e; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w17si14768542ejk.421.2020.07.07.15.50.59; Tue, 07 Jul 2020 15:51:27 -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; dkim=pass header.i=@kernel.org header.s=default header.b=BoMX280e; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728417AbgGGWRK (ORCPT + 99 others); Tue, 7 Jul 2020 18:17:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:45546 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726946AbgGGWRK (ORCPT ); Tue, 7 Jul 2020 18:17:10 -0400 Received: from localhost (mobile-166-175-191-139.mycingular.net [166.175.191.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9E84920720; Tue, 7 Jul 2020 22:17:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594160230; bh=igRw/elAJpmXW1QKqDLoTjdA6cufEesoAiQ9X3RKU98=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=BoMX280eZ6j8c0uOMxf7N8F68APr7FNfRfBWmRG8kE/UF2+Ea/a2QAPbPTrtXkOVA xH2jXglyK3hKURat5vSMKtHPYw0UE/TZ6xIKvmWcBlulRQygeyGsY4NbH+k9CQcv/r QQzd+jaGi93ARw7lHyK+DiNmw5aMyiFQXU94vrIs= Date: Tue, 7 Jul 2020 17:17:08 -0500 From: Bjorn Helgaas To: Luc Van Oostenryck Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/3] pci: enforce usage of 'pci_channel_state_t' Message-ID: <20200707221708.GA390968@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200702162651.49526-1-luc.vanoostenryck@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 02, 2020 at 06:26:48PM +0200, Luc Van Oostenryck wrote: > The definition of pci_channel_io_normal and friends is relatively > complicated and ugly: > typedef unsigned int __bitwise pci_channel_state_t; > enum pci_channel_state { > pci_channel_io_normal = (__force pci_channel_state_t) 1, > ... > }; > > This is clearly motivated by a desire to have some strong typing > for this constants but: > * in C enums are weakly typed (they're essentially the same as 'int') > * sparse only allow to define bitwise ints, not bitwise enums. > > This series is a preparation step to introduce bitwise enums. > This would allow to define these constant without having to use > the force cast: > enum __bitwise pci_channel_state { > pci_channel_io_normal = 1, > ... > }; > or, equivalently: > typedef enum __bitwise { > pci_channel_io_normal = 1, > ... > } pci_channel_state_t; > > > Note: the first patch is, I think, uncontroversial, the other ones > less so but can be safely dropped. > > > Changes since v1: > * add missing conversion > * try to avoid using 'enum pci_channel_state' in include/linux/pci.h > * try to avoid using 'enum pci_channel_state' in the documentation > > > Luc Van Oostenryck (3): > pci: use 'pci_channel_state_t' instead of 'enum pci_channel_state' > pci: use anonymous 'enum' instead of 'enum pci_channel_state' > pci: update to doc to use 'pci_channel_state_t' > > Documentation/PCI/pci-error-recovery.rst | 8 ++++---- > arch/powerpc/kernel/eeh_driver.c | 2 +- > drivers/block/rsxx/core.c | 2 +- > drivers/dma/ioat/init.c | 2 +- > drivers/media/pci/ngene/ngene-cards.c | 2 +- > drivers/misc/genwqe/card_base.c | 2 +- > drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- > drivers/net/ethernet/intel/ice/ice_main.c | 2 +- > drivers/net/ethernet/intel/ixgb/ixgb_main.c | 4 ++-- > drivers/net/ethernet/sfc/efx.c | 2 +- > drivers/net/ethernet/sfc/falcon/efx.c | 2 +- > drivers/pci/pci.h | 2 +- > drivers/pci/pcie/err.c | 4 ++-- > drivers/pci/pcie/portdrv_pci.c | 2 +- > drivers/scsi/aacraid/linit.c | 2 +- > drivers/scsi/sym53c8xx_2/sym_glue.c | 2 +- > drivers/staging/qlge/qlge_main.c | 2 +- > include/linux/pci.h | 4 ++-- > 18 files changed, 24 insertions(+), 24 deletions(-) Since it's all basically "use pci_channel_state_t instead of enum pci_channel_state", I squashed these all together and applied the result to pci/error for v5.8, thanks!