Re: [PATCH RFC v2 08/29] PCI/MSI: Make pci_enable_msix() 'nvec' argument unsigned int

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux