David Miller wrote:
From: Chuck Lever <[EMAIL PROTECTED]>
Date: Fri, 02 Nov 2007 15:14:26 -0400
The (int) type cast in skb_truesize_check() is unneeded: without it, all
the variable types in the conditional expression are unsigned integers. As
it stands, the type cast causes a comparison between a signed and an
unsigned integer, which can produce unexpected results.
Signed-off-by: Chuck Lever <[EMAIL PROTECTED]>
This is checking for skb->truesize being decremented too much by other
code, which could cause a wraparound below zero, so we do want
negaitve checks here.
If that's truly the case, document the requirement (perhaps using
something the compiler itself can verify) instead of using a clever
type cast trick.
Here's the problem with leaving these little surprises in commonly used
kernel headers. Suppose the developer of a network driver or network
file system that uses one of these headers wants to employ static code
analysis to identify issues introduced by new patches to their
subsystem. The tool warnings generated in kernel headers are just
noise, and make using such code analysis difficult.
begin:vcard
fn:Chuck Lever
n:Lever;Chuck
org:Oracle Corporation;Corporate Architecture: Linux Projects Group
adr:;;1015 Granger Avenue;Ann Arbor;MI;48104;USA
title:Principal Member of Staff
tel;work:+1 248 614 5091
x-mozilla-html:FALSE
version:2.1
end:vcard