Re: Patch review request

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

 



On Tue, 30 Dec 2008, Matthew Wilcox wrote:

On Tue, Dec 30, 2008 at 03:35:27PM +1100, Timothy S. Nelson wrote:
	Hi all.  Jesse Barnes requested that I post some patches from bug
12168 here for review.

diff -urN linux-2.6.27/drivers/pci/rom.c linux-2.6.27.rom/drivers/pci/rom.c
--- linux-2.6.27/drivers/pci/rom.c	2008-10-10 09:13:53.000000000 +1100
+++ linux-2.6.27.rom/drivers/pci/rom.c	2008-12-29 14:48:58.000000000 +1100
@@ -73,19 +73,19 @@
 		void __iomem *pds;
 		/* Standard PCI ROMs start out with these bytes 55 AA */
 		if (readb(image) != 0x55)
-			break;
+			return -EIO;

pci_get_rom_size() returns a size_t, not an ssize_t, so returning an
error number is a bad idea.  A negative number is going to be treated as
a very large positive number, so there's opportunity for lots of mayhem.
0 already indicates an error, so I don't quite see what problem you're
trying to fix here.

In the large scale, I'm trying to solve the problem that this function returns a 0 sometimes when it shouldn't. I haven't figured out why that is at this point (I'm still new to kernel problem-solving), but Jesse Barnes has suggested that it might be due to image - rom being zero. I thought that returning different things for the "Invalid ROM" case, and the "image - rom = 0" case might be useful both to myself and future problem solvers.

	HTH, and I'll keep working on it.


---------------------------------------------------------------------
| Name: Tim Nelson                 | Because the Creator is,        |
| E-mail: wayland@xxxxxxxxxxxxx    | I am                           |
---------------------------------------------------------------------

----BEGIN GEEK CODE BLOCK----
Version 3.12
GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V- PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI++++ D G+ e++>++++ h! y-
-----END GEEK CODE BLOCK-----

--
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