[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20071021.163558.98394216.davem@davemloft.net>
Date: Sun, 21 Oct 2007 16:35:58 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: olof@...om.net
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH v2] niu: Cleanup PAGE_SIZE checks a bit
From: Olof Johansson <olof@...om.net>
Date: Sat, 20 Oct 2007 14:33:57 -0500
> PAGE_SIZE in this case is 64KB, so I don't quite get why gcc can't tell
> that the line in question will never be reached.
GCC does not do that kind of full flow analysis based upon constant
expression simplification to determine if a store like this into a
type smaller than the constant value can handle can actually occur.
> I suggest the following instead, but I can unfortunately not do anything but
> build test it.
>
> Also, the driver does some other checks to make sure that PAGE_SIZE is a
> power of two (BUILD_BUG_ON() in niu_init()), doesn't seem like that could
> ever be untrue? Or are there really archs with non-power-of-two PAGE_SIZE?
It was just overly-anal assertion checking. I tend to prefer using
code instead of comments to describe invariants, but this one is
pretty unrealistic and silly.
> Signed-off-by: Olof Johansson <olof@...om.net>
>
> --
>
> Ack! It should obviously use min(), not max()!
:-)
Applied, thanks!
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists