From: Tejun Heo <tj@kernel.org>
To: Alexander Gordeev <agordeev@redhat.com>
Cc: linux-kernel@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>,
Michael Ellerman <michael@ellerman.id.au>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Ben Hutchings <bhutchings@solarflare.com>,
David Laight <David.Laight@ACULAB.COM>,
Mark Lord <kernel@start.ca>, "H. Peter Anvin" <hpa@zytor.com>,
linux-pci@vger.kernel.org
Subject: Re: [PATCH RFC v2 08/29] PCI/MSI: Make pci_enable_msix() 'nvec' argument unsigned int
Date: Wed, 20 Nov 2013 11:14:12 -0500 [thread overview]
Message-ID: <20131120161412.GH28946@htj.dyndns.org> (raw)
In-Reply-To: <93e145deeb238ad805196762cae696d3ae67f812.1382103786.git.agordeev@redhat.com>
Hello,
On Fri, Oct 18, 2013 at 07:12:08PM +0200, Alexander Gordeev wrote:
> Make pci_enable_msix() and pci_enable_msi_block() consistent
> with regard to the type of 'nvec' argument. Indeed, a number
> of vectors to allocate is a natural value, so make it unsigned.
I'm personally not a big fan of using unsigneds where they're just
used as numbers unless strictly necessary. They don't really provide
any meaningful protection and we often end up in situations where we
want to encode error conditions in the same type variable as return
value or whatever and end up with silly situations like functions
which take unsigned and returns integer or having a separate err
variable when the high bit of the orignal variable would have worked
just fine. Also, people have different thresholds for what should be
unsigned and we end up with half things unsigned and the other signed.
I'll defer the decision to Bjorn but I'd vote for converting things to
int.
Thanks.
--
tejun
next prev parent reply other threads:[~2013-11-20 16:14 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-18 17:12 [PATCH RFC v2 00/29] Introduce pcim_enable_msi*() family helpers Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 01/29] PCI/MSI/s390: Fix single MSI only check Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 02/29] PCI/MSI/s390: Remove superfluous check of MSI type Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 03/29] PCI/MSI/pSeries: Fix wrong error code reporting Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 04/29] PCI/MSI/pSeries: Make quota traversing and requesting race-safe Alexander Gordeev
2013-11-20 15:43 ` Tejun Heo
2013-10-18 17:12 ` [PATCH RFC v2 05/29] PCI/MSI: Fix return value when populate_msi_sysfs() failed Alexander Gordeev
2013-11-20 15:50 ` Tejun Heo
2013-10-18 17:12 ` [PATCH RFC v2 06/29] PCI/MSI: Get rid of useless count of msi_desc leftovers Alexander Gordeev
2013-11-20 16:07 ` Tejun Heo
2013-11-22 18:27 ` Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 07/29] PCI/MSI: Return -ENOSYS for unimplemented interfaces, not -1 Alexander Gordeev
2013-11-20 16:07 ` Tejun Heo
2013-10-18 17:12 ` [PATCH RFC v2 08/29] PCI/MSI: Make pci_enable_msix() 'nvec' argument unsigned int Alexander Gordeev
2013-11-20 16:14 ` Tejun Heo [this message]
2013-11-22 18:34 ` Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 09/29] PCI/MSI: Factor out pci_get_msi_cap() interface Alexander Gordeev
2013-11-20 16:18 ` Tejun Heo
2013-11-25 13:49 ` Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 10/29] PCI/MSI: Get rid of pci_enable_msi_block_auto() interface Alexander Gordeev
2013-11-20 16:21 ` Tejun Heo
2013-10-18 17:12 ` [PATCH RFC v2 11/29] PCI/MSI: Convert pci_msix_table_size() to a public interface Alexander Gordeev
2013-11-20 16:23 ` Tejun Heo
2013-11-22 18:38 ` Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 12/29] PCI/MSI: Introduce pcim_enable_msi*() family helpers Alexander Gordeev
2013-10-24 10:51 ` Tejun Heo
2013-10-24 10:57 ` David Laight
2013-10-24 11:01 ` Tejun Heo
2013-10-24 11:41 ` Alexander Gordeev
2013-10-25 2:22 ` Mark Lord
2013-10-25 9:10 ` David Laight
2013-10-25 10:01 ` Alexander Gordeev
2013-10-25 14:52 ` intel e1000e pci driver issue on RT Linux kernel Karicheri, Muralidharan
2013-10-25 14:59 ` Karicheri, Muralidharan
2013-10-27 22:27 ` [PATCH RFC v2 12/29] PCI/MSI: Introduce pcim_enable_msi*() family helpers Michael Ellerman
2013-10-28 16:30 ` Mark Lord
2013-10-24 14:31 ` Alexander Gordeev
2013-10-25 2:23 ` Mark Lord
2013-11-04 8:12 ` Alexander Gordeev
2013-11-20 17:15 ` Tejun Heo
2013-11-22 18:44 ` Alexander Gordeev
2013-11-22 18:44 ` Tejun Heo
2013-11-22 18:54 ` Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 13/29] ipr: Do not call pci_disable_msi/msix() if pci_enable_msi/msix() failed Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 14/29] ipr: Make use of pcim_enable_msi/msix() interfaces Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 15/29] ixgbe: Make use of pcim_enable_msix_range() interface Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 16/29] ixgbevf: " Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 17/29] megaraid: Make use of pcim_enable_msix() interface Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 18/29] ntb: Fix missed call to pci_enable_msix() Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 19/29] ntb: Make use of pcim_enable_msix/msix_exact() interfaces Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 20/29] qib: Make use of pcim_enable_msix() and pci_msix_table_size() interfaces Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 21/29] qla2xxx: Make use of pcim_enable_msix_range() interface Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 22/29] qlge: Get rid of an redundant assignment Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 23/29] qlge: Make use of pcim_enable_msix() interface Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 24/29] tg3: " Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 25/29] vmxnet3: Return -EINVAL if number of requested MSI-Xs is not enough Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 26/29] vmxnet3: Fixup a weird loop exit Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 27/29] vmxnet3: Return -ENOSPC when not enough MSI-X vectors available Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 28/29] vmxnet3: Limit number of rx queues to 1 if per-queue MSI-Xs failed Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 29/29] vmxnet3: Make use of pcim_enable_msix_range() interface Alexander Gordeev
2013-10-21 8:51 ` David Laight
2013-10-21 10:19 ` Alexander Gordeev
2013-11-11 19:56 ` [PATCH RFC v2 00/29] Introduce pcim_enable_msi*() family helpers Alexander Gordeev
2013-11-20 17:16 ` Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131120161412.GH28946@htj.dyndns.org \
--to=tj@kernel.org \
--cc=David.Laight@ACULAB.COM \
--cc=agordeev@redhat.com \
--cc=benh@kernel.crashing.org \
--cc=bhelgaas@google.com \
--cc=bhutchings@solarflare.com \
--cc=hpa@zytor.com \
--cc=kernel@start.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=michael@ellerman.id.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).