rcu_read_lock();                                                \
        local_devdata = rcu_dereference(devdata);                       \
        if (local_devdata)                                              \
-               p = snprintf(buf, PAGE_SIZE, "%ld\n",                   \
-                      atomic64_read(&local_devdata->counters->_name)); \
+               p = snprintf(buf, PAGE_SIZE, "%lld\n",                  \
+                      (s64)atomic64_read(&local_devdata->counters->_name));    \
        rcu_read_unlock();                                              \
        return p;                                                       \
 }
        }
 
        for (i = 0; i < (NX842_HIST_SLOTS - 2); i++) {
-               bytes = snprintf(p, bytes_remain, "%u-%uus:\t%ld\n",
+               bytes = snprintf(p, bytes_remain, "%u-%uus:\t%lld\n",
                               i ? (2<<(i-1)) : 0, (2<<i)-1,
-                              atomic64_read(×[i]));
+                              (s64)atomic64_read(×[i]));
                bytes_remain -= bytes;
                p += bytes;
        }
        /* The last bucket holds everything over
         * 2<<(NX842_HIST_SLOTS - 2) us */
-       bytes = snprintf(p, bytes_remain, "%uus - :\t%ld\n",
+       bytes = snprintf(p, bytes_remain, "%uus - :\t%lld\n",
                        2<<(NX842_HIST_SLOTS - 2),
-                       atomic64_read(×[(NX842_HIST_SLOTS - 1)]));
+                       (s64)atomic64_read(×[(NX842_HIST_SLOTS - 1)]));
        p += bytes;
 
        rcu_read_unlock();