From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF280C433E0 for ; Sun, 2 Aug 2020 14:53:58 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 89D432072A for ; Sun, 2 Aug 2020 14:53:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Ri+G2px5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 89D432072A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-kernel-mentees-bounces@lists.linuxfoundation.org Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 5A5D787D33; Sun, 2 Aug 2020 14:53:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tw-lqIKkgFM5; Sun, 2 Aug 2020 14:53:57 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id D1DFE87CDD; Sun, 2 Aug 2020 14:53:57 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id B58A9C0889; Sun, 2 Aug 2020 14:53:57 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3C9A7C004C for ; Sun, 2 Aug 2020 14:53:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 2BE8187D11 for ; Sun, 2 Aug 2020 14:53:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q9DL05DZENJh for ; Sun, 2 Aug 2020 14:53:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by hemlock.osuosl.org (Postfix) with ESMTPS id E1BB687CDD for ; Sun, 2 Aug 2020 14:53:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596380035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1kkoTewt7Fx4Q+2DDC1UGcR4JlqqtBcQK2oUP1r3rTc=; b=Ri+G2px5TAe5FeHVfcMJzEdsFXKpWPtbbAf/hPS73FK1f6FU3ZQlM15r3MOTvgOPne08l4 0P9jqJc5vyA3gROc4fOot6fXxv0Ah+2KHQEgfkDWScibcOiaCCoEshuIDhE755qGOSyaN4 UAJSXfoqHfNBZyeYXA8AztJxhIjmqAg= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-500-TXtC1HoWPfaKD1y3OD6dLg-1; Sun, 02 Aug 2020 10:53:51 -0400 X-MC-Unique: TXtC1HoWPfaKD1y3OD6dLg-1 Received: by mail-qv1-f71.google.com with SMTP id q4so16708843qvu.6 for ; Sun, 02 Aug 2020 07:53:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=1kkoTewt7Fx4Q+2DDC1UGcR4JlqqtBcQK2oUP1r3rTc=; b=BfCVWGYZ37+VlQI4i7wqBAbKqRVRs37AwM1FuKXvcB+l8XxSaKO9wVurE0oLM5fl8c 6Uq1YSLPd1goE6y7JcLV2oLjD5VtuqBJScGr0nZaT+UmAScXEarOrR8mr4bPdd/9D29W D+QpsjVkBy7Z57LYAYbDDzIp3d97Hg2ZMMLpnN7AmC8eavKcLH/Ntat9QCeaXAR3cO8F hJr7YZGl8KAW73cekngj7ihfsijA66pFETyo1FDcpYPain3ix5sYtpxuyx+3NzQVaJI2 mWpr/bmNik/QfkqKkVTh1zMGGVYoiYEQBNYLxLHd5DnQvMCyq1F+zS3yxRS4siPtvoNU eX8g== X-Gm-Message-State: AOAM5310u6H0FgiR3c8o36PqNZomaxx67Z+LJMfZsgAWatfsOgt051Kq mxJp6HZKhLgmZoYwU8DBVvRkpHMEOgE8ehCba+aZzaN8I8irfYmq1+WE+I/nQoUs9mVLeDlWYxI Fg2BEPGoHv8y3QziBLywIbaMBpQkOEenJPnUC9KJDKPpP5Koz X-Received: by 2002:a0c:f007:: with SMTP id z7mr12711380qvk.53.1596380031293; Sun, 02 Aug 2020 07:53:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsaj772ZR8xxDSmSbCv1i3DbzhNyKSnnIAtdh3ZvECGhzafck69cLoHqLTgfamrb5jJgzXtg== X-Received: by 2002:a0c:f007:: with SMTP id z7mr12711349qvk.53.1596380031093; Sun, 02 Aug 2020 07:53:51 -0700 (PDT) Received: from trix.remote.csb (075-142-250-213.res.spectrum.com. [75.142.250.213]) by smtp.gmail.com with ESMTPSA id t127sm16326265qkc.100.2020.08.02.07.53.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 02 Aug 2020 07:53:50 -0700 (PDT) To: Borislav Petkov , "Saheed O. Bolarinwa" References: <20200801112446.149549-1-refactormyself@gmail.com> <20200801125657.GA25391@nazgul.tnic> From: Tom Rix Message-ID: <6ecce8f3-350a-b5d5-82c9-4609f2298e61@redhat.com> Date: Sun, 2 Aug 2020 07:53:46 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200801125657.GA25391@nazgul.tnic> Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: Vignesh Raghavendra , linux-pci@vger.kernel.org, linux-fpga@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-ide@vger.kernel.org, linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, Miquel Raynal , linux-rdma@vger.kernel.org, Richard Weinberger , Joerg Roedel , linux-atm-general@lists.sourceforge.net, helgaas@kernel.org, Jakub Kicinski , linux-kernel-mentees@lists.linuxfoundation.org, Wolfgang Grandegger , intel-gfx@lists.freedesktop.org, linux-gpio@vger.kernel.org, Marc Kleine-Budde , Kalle Valo , linux-edac@vger.kernel.org, linux-hwmon@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, linux-crypto@vger.kernel.org, dmaengine@vger.kernel.org, "David S. Miller" Subject: Re: [Linux-kernel-mentees] [RFC PATCH 00/17] Drop uses of pci_read_config_*() return value X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" On 8/1/20 5:56 AM, Borislav Petkov wrote: > On Sat, Aug 01, 2020 at 01:24:29PM +0200, Saheed O. Bolarinwa wrote: >> The return value of pci_read_config_*() may not indicate a device error. >> However, the value read by these functions is more likely to indicate >> this kind of error. This presents two overlapping ways of reporting >> errors and complicates error checking. > So why isn't the *value check done in the pci_read_config_* functions > instead of touching gazillion callers? > > For example, pci_conf{1,2}_read() could check whether the u32 *value it > just read depending on the access method, whether that value is ~0 and > return proper PCIBIOS_ error in that case. > > The check you're replicating > > if (val32 == (u32)~0) > > everywhere, instead, is just ugly and tests a naked value ~0 which > doesn't mean anything... > I agree, if there is a change, it should be in the pci_read_* functions. Anything returning void should not fail and likely future users of the proposed change will not do the extra checks. Tom _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees