Thread (24 messages) 24 messages, 8 authors, 2020-07-16

RE: [RFC PATCH 00/35] Move all PCIBIOS* definitions into arch/x86

From: David Laight <hidden>
Date: 2020-07-15 14:32:42
Also in: linux-kernel-mentees

From: Arnd Bergmann
Sent: 15 July 2020 07:47
On Wed, Jul 15, 2020 at 1:46 AM Bjorn Helgaas [off-list ref] wrote:

 So something like:
quoted
  void pci_read_config_word(struct pci_dev *dev, int where, u16 *val)

and where we used to return anything non-zero, we just set *val = ~0
instead?  I think we do that already in most, maybe all, cases.
Right, this is what I had in mind. If we start by removing the handling
of the return code in all files that clearly don't need it, looking at
whatever remains will give a much better idea of what a good interface
should be.
It would be best to get rid of that nasty 'u16 *' parameter.
Make the return int and return the read value or -1 on error.
(Or maybe 0xffff0000 on error??)

For a 32bit read (there must be one for the BARs) returning
a 64bit signed integer would work even for 32bit systems.

If code cares about the error, and it can be detected then
it can check. Otherwise the it all 'just works'.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help