Re: Questionable code in pci_sal_read

From: Matthew Wilcox <matthew_at_wil.cx>
Date: 2005-01-26 08:15:58
On Tue, Jan 25, 2005 at 12:47:03PM -0800, Luck, Tony wrote:
> So you (and Matthew Wilcox) are advocating this change?
>  
> -	if ((seg > 255) || (bus > 255) || (devfn > 255) || (reg > 4095))
> +	if ((seg > 65535) || (bus > 255) || (devfn > 255) || (reg > 4095))

Yes.

> "seg", "bus", etc. are all "int" ... should we be extra paranoid
> and check for negative values (or change the definitions to unsigned),
> or is that over the top?

I believe Bjorn has a patch to change the pci_raw_ops to use unsigned int.
Best to send that separately though.

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Tue Jan 25 16:26:13 2005

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:35 EST