Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4c93566e2a61b48ef071a8d8a8fa9904c83a668e
Commit:     4c93566e2a61b48ef071a8d8a8fa9904c83a668e
Parent:     acea6852f32b8805e166d885ed7e9f0c7cd10d41
Author:     David S. Miller <[EMAIL PROTECTED]>
AuthorDate: Mon Jan 21 23:20:58 2008 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Jan 23 03:11:39 2008 -0800

    [TULIP] DMFE: Fix SROM parsing regression.
    
    Changeset 16b110c3fd760620b4a787db6ed512fe531ab1b5 (dmfe warning fix)
    bothed up the offsets read from the SROM so that it doesn't read the
    same datums it used to.
    
    The change made transformations like turning:
    
        "srom + 34"
    
    into
    
        "(__le32 *)srom + 34/4"
    
    which doesn't work because 4 does not divide evenly
    into 34 so we're using a different pointer offset
    than in the original code.
    
    I've changed theses cases in dmfe_parse_srom() to
    consistently use "(type *)(srom + offset)" preserving
    the offsets from the original code.
    
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 drivers/net/tulip/dmfe.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c
index b4891ca..6562004 100644
--- a/drivers/net/tulip/dmfe.c
+++ b/drivers/net/tulip/dmfe.c
@@ -1909,7 +1909,7 @@ static void dmfe_parse_srom(struct dmfe_board_info * db)
        if ( ( (int) srom[18] & 0xff) == SROM_V41_CODE) {
                /* SROM V4.01 */
                /* Get NIC support media mode */
-               db->NIC_capability = le16_to_cpup((__le16 *)srom + 34/2);
+               db->NIC_capability = le16_to_cpup((__le16 *) (srom + 34));
                db->PHY_reg4 = 0;
                for (tmp_reg = 1; tmp_reg < 0x10; tmp_reg <<= 1) {
                        switch( db->NIC_capability & tmp_reg ) {
@@ -1921,8 +1921,8 @@ static void dmfe_parse_srom(struct dmfe_board_info * db)
                }
 
                /* Media Mode Force or not check */
-               dmfe_mode = le32_to_cpup((__le32 *)srom + 34/4) &
-                               le32_to_cpup((__le32 *)srom + 36/4);
+               dmfe_mode = (le32_to_cpup((__le32 *) (srom + 34)) &
+                            le32_to_cpup((__le32 *) (srom + 36)));
                switch(dmfe_mode) {
                case 0x4: dmfe_media_mode = DMFE_100MHF; break; /* 100MHF */
                case 0x2: dmfe_media_mode = DMFE_10MFD; break;  /* 10MFD */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to