Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1614447ybt; Thu, 2 Jul 2020 09:29:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYFExiPG0kFmhewQqLkJPB4nyE5uhxOiLjmQAz2oRzCrT0t+3zEs85nTFzrmpUW2lm08X1 X-Received: by 2002:a05:6402:3138:: with SMTP id dd24mr36372700edb.118.1593707383322; Thu, 02 Jul 2020 09:29:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593707383; cv=none; d=google.com; s=arc-20160816; b=Jx5e5N4JRMMJo4nAm62/C7vsBRVhTLQ+u6z6h55PyyJCujtTvc4iCjYLJiyeTzuTrW rU0PVSSArtaL6QBUeA27ZSEnwOsfeNpH+l9X/O9BStF6umw4Yc5WTUhm0pyqgcHD7ko3 rLDeqttwSdjgHvXmglLX0szIIPX+iQcCTcYe8shwEC/tzGERXuVqRq5W4KmK9OGdBBdu C7uzX7qHQrESTE8Y83azi9/6sjmETfU/z7Q8/wNtcKlKqXEtRYAjYjq8HF+CUeLyF2HW l+OoCG/pjr+uq4zIk3eazSoBvfc45LJ2lkMHj8VOaCYNUKQZrdWDOK4yBN5RiyghCwZ4 ZNZQ== 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:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=729wRp2/PBhbh0Gnc86Vq7P7Z2CAjYw3uUDYdxrU638=; b=KUeWij/SQnGpeZ8zIlK6qm9KnUOK0PFInnUSW+uAh6ID+MBAWPdeVyPgUZmBU+U9fo A8QSgvgUb9xrXVQ7eeIDX6hPoA7KzHVZXmrD3wlN2+mwiFfZJJJyVE2j40LJs3ER5eKh gbYYuFVlTLDqxueyicWbjFz+CQwJrcwC3rTMxLYBowqnPea+THS26cqx08rQ+Ea5lCW/ nSETocYV9UwatmTjOeyQgzRYeKhmbB3sSqeFql/kiNB5uMp63NF1wpGV0JefVEIZJGlP 4UCX9C3Td2rLViLdkRhtAmX9OC5qFd1oYWk6DZuFvVQtjOpsivYHkQAmE/MilmZNyYvk cqeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dc5QYiRb; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ni2si5460249ejb.480.2020.07.02.09.29.20; Thu, 02 Jul 2020 09:29:43 -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=@gmail.com header.s=20161025 header.b=dc5QYiRb; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726765AbgGBQ16 (ORCPT + 99 others); Thu, 2 Jul 2020 12:27:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726199AbgGBQ14 (ORCPT ); Thu, 2 Jul 2020 12:27:56 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09274C08C5C1; Thu, 2 Jul 2020 09:27:56 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id dr13so30495589ejc.3; Thu, 02 Jul 2020 09:27:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=729wRp2/PBhbh0Gnc86Vq7P7Z2CAjYw3uUDYdxrU638=; b=dc5QYiRbUgMXusOZ+GdrLCj6a0s03jHIZwIzI35u/J16JDM/e/zV5h1eOuO7qzz29w LhFwjNVSsoswvAdbmPIUFa433B533j57PZzNcHehyEatS+5NDPNMmKzkJL0kRWGOzbPU kJtApVxyPQLHfNZiQqKY1Erb3NlGv02bNk5/TeyrHsXdopFFh1U0WkE+vfcmbBrr2nz0 v3KW2jCRheh2S9c3IPLD8hrachGyQIG5rOnA1JFWcI3PDVnQB0NHvHP9klaSN1MTalMJ oIVrNo+c9ofQw0i8P3LC5cKLBrTYeqz8Q6VNm3zbQ6Zan5u6CsNtiSMQRFRQxES7/KVR cf6g== 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=729wRp2/PBhbh0Gnc86Vq7P7Z2CAjYw3uUDYdxrU638=; b=S+go2/+gIr6rElc32iLpNQqP2HwIMVjQ9FjCd1G6QDMXMuKuUTxOsPga1rThCNhIgl 45FeVzYCQT8Mr1yXgGQ0/R4SRmOU2U+ZvFkgL4Cb4h9CYO9Qjt45aJJgG6GnYdBqecX0 0jNX+gjHTOT4rZI78aLdk21UZXpiZU+6dubED10rovilpsxcWg0RpPQWfDvgxMgOExNH 7j3SMOKwsRDMdixyYD/vqbQLHCenIy/mdrkige89gVkfa81Kiikr82xOSmEVvz9bpytU Lxrye1q2bM/UX/8Y4CBAekvZK96E3vwQyOoULquQTJcDF3WLX7lP3CYwrlwweKaQue5k USNQ== X-Gm-Message-State: AOAM531cgltdNLRSji3oJqs7DQvp+7RCq74/CKGFwcXZJ7QgsENTYJpq 7WbzBLAIvODHaPUTpZK2kS8= X-Received: by 2002:a17:906:fac1:: with SMTP id lu1mr23313087ejb.427.1593707274720; Thu, 02 Jul 2020 09:27:54 -0700 (PDT) Received: from localhost.localdomain ([2a02:a03f:b7f9:7600:4932:71ef:3c73:a14f]) by smtp.gmail.com with ESMTPSA id gu15sm7375188ejb.111.2020.07.02.09.27.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2020 09:27:54 -0700 (PDT) From: Luc Van Oostenryck To: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Luc Van Oostenryck Subject: [PATCH v2 0/3] pci: enforce usage of 'pci_channel_state_t' Date: Thu, 2 Jul 2020 18:26:48 +0200 Message-Id: <20200702162651.49526-1-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.27.0