Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5613886pxv; Wed, 28 Jul 2021 15:18:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwT5XjAySn+FkZWB+uLW2lRcR2kQe9owejkxHtMSS9PCUXzK53OYFd6zDdcOwCtFnLXaNXy X-Received: by 2002:a05:6402:1cb2:: with SMTP id cz18mr2281667edb.339.1627510703175; Wed, 28 Jul 2021 15:18:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627510703; cv=none; d=google.com; s=arc-20160816; b=UmamSVf9FN1UyvqMWRlgD3QbQxCMMvu1V7/jPGqEOvEDaEi9VaqdCksUtclznrya0r 2gQnuDDvmFrn30D1T9qb1V/OY0ortIvVF2+yGCmfu1e+4sJHrYPzTuzVfYiIIyKp0FcC Fd5kUioUtCwKQ/BC5o1GE261+iB4H7oGbMRuzkz9bOeA+0xnf/azMF6HoCYwoRjIw8rL 6ATWK62f0bfPb1NmITdHAJRmu28o9Myq7Kbk6+521nO7nF6K6CXopV0ixwRrJSw3jYe3 MtDQ+ZUMWuZ9Ah6yvD92Zr2oe4eEbYgTV3O1Zh9BQmfMfDx4+w1xGmsu3VdoPhu4WOLS sgiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=jeJiSNj8GG/bpxgrwHx4MLS89uNGuQzaFNDrzHZRGz0=; b=ZqUjXqEvbZPlASxyUAMtDmAwlNL7aUJs3oMNmNccRaP82FL+heKhvwR+hayxiWfz8b fwx0GWKT8lUwiY94wkdWMpGJi/cgcK1Eic/9u5pvF/YQiuYrS55WKBFvOumHb/WFnSsl 2WMFD0TCgCp3cEMAacYGLJG248fOv1HfbbtUTCuhvGoR6UBj4Cc23OVVhon3YS2U9u9/ MJCT6NX5C9H8olS2mem0sLEHrIaMsRCTCbN+ZFU9WcLEcY0nAuNe1LMjaqZoMAui7VF3 2OXj8PCu7wqx0gThlsIXkcwukfAj6MR5/EVZjXGUHJTP0DiNYc81+mRZY6GwovMbdH3Z GHLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TpBqYtzG; 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 r18si895606edv.355.2021.07.28.15.17.59; Wed, 28 Jul 2021 15:18:23 -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=k20201202 header.b=TpBqYtzG; 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 S232114AbhG1WQl (ORCPT + 99 others); Wed, 28 Jul 2021 18:16:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:52514 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231982AbhG1WQk (ORCPT ); Wed, 28 Jul 2021 18:16:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4AAE0603E9; Wed, 28 Jul 2021 22:16:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627510598; bh=eFciqfWNmyLu0Hy7m//jYdIb3XQRAWS7pAgCiQ+QOrY=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=TpBqYtzGa+W1ndTSO0DuTp5u4MzXsIXirVbD3RxaB90Mc9xEMTbMent/ltieHiMpf 35ajIt87rvIn3Dx0JSyKKHoGzYCUw7epqi9oQlDhQ/4S72NHxJokeBjUfSaIR18jKJ TaMw6pgH+gMz9ea5srkjmHW9LSQgKHrUM1ylvTD6rWVjINQkwhntV3jgcbaxLKTOBg tgt8LuObwbUjZHbtDHsk34nO3qKy+YGuOmGcG1M/L28FF+dhmUsHbA1t+oj++WldpI Y3JQal54fTsOIDF1psZ6QhGAMUx2mtjhvGyehF5rOXu2ev7xPlz2iAwxDA1KXpU+T4 JsA8sGbfUFyMg== Date: Wed, 28 Jul 2021 17:16:36 -0500 From: Bjorn Helgaas To: Shanker R Donthineni Cc: Amey Narkhede , Bjorn Helgaas , alex.williamson@redhat.com, Raphael Norwitz , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, kw@linux.com, Sinan Kaya , Len Brown , "Rafael J . Wysocki" Subject: Re: [PATCH v10 1/8] PCI: Add pcie_reset_flr to follow calling convention of other reset methods Message-ID: <20210728221636.GA858116@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <64a0049e-00dc-8b10-6c9a-0b270c0a181d@nvidia.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 28, 2021 at 04:58:14PM -0500, Shanker R Donthineni wrote: > On 7/28/21 3:23 PM, Bjorn Helgaas wrote: > > On Wed, Jul 28, 2021 at 01:54:16PM -0500, Shanker R Donthineni wrote: > >> On 7/27/21 5:12 PM, Bjorn Helgaas wrote: > >>> On Fri, Jul 09, 2021 at 06:08:06PM +0530, Amey Narkhede wrote: > >>>> Add has_pcie_flr bitfield in struct pci_dev to indicate support for PCIe > >>>> FLR to avoid reading PCI_EXP_DEVCAP multiple times. > >> - pcie_capability_read_dword(dev, PCI_EXP_DEVCAP, &cap); > >> - return cap & PCI_EXP_DEVCAP_FLR; > >> + return !!FIELD_GET(PCI_EXP_DEVCAP_FLR, dev->devcap); > > > > Nice, thanks for reminding me of FIELD_GET(). I like how that works > > without having to #define *_SHIFT values. I personally don't care for > > "!!" and would probably write something like: > > > > return FIELD_GET(PCI_EXP_DEVCAP_FLR, dev->devcap) == 1; > > Both are same since FLR is a single bit value. Right; this is a style preference, not a correctness question.