Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[pandora-kernel.git] / drivers / ieee1394 / csr.c
index ab0c80f..c90be40 100644 (file)
@@ -133,8 +133,7 @@ static void host_reset(struct hpsb_host *host)
                 host->csr.state &= ~0x100;
         }
 
-        host->csr.topology_map[1] =
-                cpu_to_be32(be32_to_cpu(host->csr.topology_map[1]) + 1);
+       be32_add_cpu(&host->csr.topology_map[1], 1);
         host->csr.topology_map[2] = cpu_to_be32(host->node_count << 16
                                                 | host->selfid_count);
         host->csr.topology_map[0] =
@@ -142,8 +141,7 @@ static void host_reset(struct hpsb_host *host)
                             | csr_crc16(host->csr.topology_map + 1,
                                         host->selfid_count + 2));
 
-        host->csr.speed_map[1] =
-                cpu_to_be32(be32_to_cpu(host->csr.speed_map[1]) + 1);
+       be32_add_cpu(&host->csr.speed_map[1], 1);
         host->csr.speed_map[0] = cpu_to_be32(0x3f1 << 16
                                              | csr_crc16(host->csr.speed_map+1,
                                                          0x3f1));
@@ -158,12 +156,10 @@ static void host_reset(struct hpsb_host *host)
  */
 static inline void calculate_expire(struct csr_control *csr)
 {
-       unsigned long usecs =
-               (csr->split_timeout_hi & 0x07) * USEC_PER_SEC +
-               (csr->split_timeout_lo >> 19) * 125L;
-
-       csr->expire = usecs_to_jiffies(usecs > 100000L ? usecs : 100000L);
+       unsigned int usecs = (csr->split_timeout_hi & 7) * 1000000 +
+                            (csr->split_timeout_lo >> 19) * 125;
 
+       csr->expire = usecs_to_jiffies(usecs > 100000 ? usecs : 100000);
        HPSB_VERBOSE("CSR: setting expire to %lu, HZ=%u", csr->expire, HZ);
 }