Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3071760ybt; Mon, 29 Jun 2020 14:33:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDnUUgTaJfx0Lofguby/26rUYP7sEOznc5hIhdhi8afVFMsKu+/ZtNva9eWXFSpf9shCX6 X-Received: by 2002:a50:88e1:: with SMTP id d88mr19752921edd.74.1593466388666; Mon, 29 Jun 2020 14:33:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593466388; cv=none; d=google.com; s=arc-20160816; b=EQwtgFdCx2SofO0oeQkqgrNtWRRelqIeLkA97qZpmeE+EafKDAN46aGO1exLtf5yIW inz4sUFFj+STmGdVBQRWn8c6yeFecWegbLNuF37zaHGHsGqMe8hBTEiiFkj+Kteno90U NJyOPbVwXGq4PdtGOTnWf4xEmKes1uf+IAG9nb3vTT2SicWX5/MmVwiqHwCOFlmLbb4/ xwisHm9dSM5GUbfdRG8WFAnO4kUidv30SiN7YmhBhjMAo2Zwhk82TFEfcox92KPD+RNL j0J9pnKH9ySVKXjKBzwhY3seb6simYjE21ExbHdCx5lJ5mtOat7Zy9dC67wcmpB16qfJ w1VA== 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=XbekMOOBSb9o6jxWpTJZbzcM9iOM6tbbxUr77zyn/gM=; b=Cew+vfFOZkA+fKUjmDl7H5YCpEHBQ+n6PFO3pOKt5yP6ic6gl5k64Tn4WAl6tnBEmo zdxR4lK+WU0HGsJR2pO2lLsmUqAVAZBWTiNlxDyCBT0Y9mG8wkltt6yLv/nufjDFW0lN 50CCT7/I01yJVuXFZ2z7ORwhLmP+xxKkEwaw8Rq+ZHyMSGlw0AsNPAwvHGiIdt3iqCoH k6sH8H5ghBAfIFIa5MS/XbNuM40RV1Ij0ue2a6tC/YTePIM+zalhKuC8G32BNdkmm7Vk mEbRjGGuVYh4TGEGiC1LrkNbOKlc8xTwBLj9EGWcgdwNaexc/PWjw+JEhAz1K6OmvRky 3NfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Z49jyX8f; 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 b7si396244eds.524.2020.06.29.14.32.46; Mon, 29 Jun 2020 14:33:08 -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=Z49jyX8f; 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 S2388543AbgF2V3i (ORCPT + 99 others); Mon, 29 Jun 2020 17:29:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:49358 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391228AbgF2V3f (ORCPT ); Mon, 29 Jun 2020 17:29:35 -0400 Received: from localhost (mobile-166-170-222-206.mycingular.net [166.170.222.206]) (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 17289208DB; Mon, 29 Jun 2020 21:29:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593466174; bh=BkG+yGTjXZVHnFw4CzZ0K2Sg1A7LotTp1tk1WvurSIk=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Z49jyX8fGPzDFYBcQFcoyu+W8uRwpEm0+aaCH1NA5W2mwQMhM0qX7H5IHUPUUHi7j QsS/qbS0VhMLwWo/rELHE5LIejYWA3iOO/Cz0/RcGGsvivvMmnq2klCZssKF5kghoG IONltDBXInGlrUUEVKFJHB7VW4jAw5JtphSkiol8= Date: Mon, 29 Jun 2020 16:29:28 -0500 From: Bjorn Helgaas To: Luc Van Oostenryck Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] pci: consolidate typing of pci_error_handlers::error_detected() Message-ID: <20200629212928.GA3296753@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200628161233.73079-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 Sun, Jun 28, 2020 at 06:12:33PM +0200, Luc Van Oostenryck wrote: > The method struct pci_error_handlers::error_detected() is defined and > documented as taking an 'enum pci_channel_state' for the second > argument but most drivers use 'pci_channel_state_t' instead. > This 'pci_channel_state_t' is not a typedef for the enum but a typedef > for a bitwise type in order to have better/stricter typechecking. > > So, consolidate everything by using the restricted type in the > method's definition, in the documentation and in the drivers not > using 'pci_channel_state_t'. $ git grep "\" Documentation/PCI/pci-error-recovery.rst: enum pci_channel_state { Documentation/PCI/pci-error-recovery.rst:pci_channel_state value of pci_channel_io_perm_failure. arch/powerpc/kernel/eeh_driver.c:static void eeh_set_channel_state(struct eeh_pe *root, enum pci_channel_state s) drivers/net/ethernet/intel/ice/ice_main.c:ice_pci_err_detected(struct pci_dev *pdev, enum pci_channel_state err) drivers/pci/pci.h: enum pci_channel_state state, drivers/pci/pcie/err.c: enum pci_channel_state state, drivers/pci/pcie/err.c: enum pci_channel_state state, Should these be changed as well? If not, why not? Some of them look analogous to the ones changed below. > Note: Currently, from a typechecking point of view this patch change > nothing because only the constants defined by the enum > are bitwise, not the enum itself (sparse doesn't have > the notion of 'bitwise enum'). This may change in some > not too far future, hence the patch. > > Signed-off-by: Luc Van Oostenryck > --- > Documentation/PCI/pci-error-recovery.rst | 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/ixgb/ixgb_main.c | 4 ++-- > drivers/net/ethernet/sfc/efx.c | 2 +- > drivers/net/ethernet/sfc/falcon/efx.c | 2 +- > 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 | 2 +- > 14 files changed, 15 insertions(+), 15 deletions(-)