]> err.no Git - linux-2.6/commitdiff
e1000: Use ARRAY_SIZE macro when appropriate
authorAhmed S. Darwish <darwish.07@gmail.com>
Tue, 6 Mar 2007 16:58:02 +0000 (08:58 -0800)
committerJeff Garzik <jeff@garzik.org>
Sat, 28 Apr 2007 15:00:57 +0000 (11:00 -0400)
A patch to use ARRAY_SIZE macro already defined in kernel.h.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/e1000/e1000_ethtool.c

index 6777887295f538822d006aa582986cac6eeb94a7..a094288f027799de860daba8356b4921fb07ca25 100644 (file)
@@ -742,7 +742,7 @@ err_setup:
        uint32_t pat, value;                                                   \
        uint32_t test[] =                                                      \
                {0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF};              \
-       for (pat = 0; pat < sizeof(test)/sizeof(test[0]); pat++) {              \
+       for (pat = 0; pat < ARRAY_SIZE(test); pat++) {              \
                E1000_WRITE_REG(&adapter->hw, R, (test[pat] & W));             \
                value = E1000_READ_REG(&adapter->hw, R);                       \
                if (value != (test[pat] & W & M)) {                             \