#include <linux/slab.h>
 #include <linux/jiffies.h>
 #include <linux/delay.h>
+#include <linux/time.h>
+
 #include "../pci.h"
 
 #ifdef MODULE_PARAM_PREFIX
        u32 encoding = FIELD_GET(PCI_EXP_LNKCAP_L0SEL, lnkcap);
 
        if (encoding == 0x7)
-               return (5 * 1000);      /* > 4us */
+               return 5 * NSEC_PER_USEC;       /* > 4us */
        return (64 << encoding);
 }
 
        u32 encoding = FIELD_GET(PCI_EXP_LNKCAP_L1EL, lnkcap);
 
        if (encoding == 0x7)
-               return (65 * 1000);     /* > 64us */
-       return (1000 << encoding);
+               return 65 * NSEC_PER_USEC;      /* > 64us */
+       return NSEC_PER_USEC << encoding;
 }
 
 /* Convert L1 acceptable latency encoding to ns */
 {
        if (encoding == 0x7)
                return U32_MAX;
-       return (1000 << encoding);
+       return NSEC_PER_USEC << encoding;
 }
 
 /* Convert L1SS T_pwr encoding to usec */
  */
 static void encode_l12_threshold(u32 threshold_us, u32 *scale, u32 *value)
 {
-       u64 threshold_ns = (u64) threshold_us * 1000;
+       u64 threshold_ns = (u64)threshold_us * NSEC_PER_USEC;
 
        /*
         * LTR_L1.2_THRESHOLD_Value ("value") is a 10-bit field with max
                if ((link->aspm_capable & ASPM_STATE_L1) &&
                    (latency + l1_switch_latency > acceptable_l1))
                        link->aspm_capable &= ~ASPM_STATE_L1;
-               l1_switch_latency += 1000;
+               l1_switch_latency += NSEC_PER_USEC;
 
                link = link->parent;
        }