]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
driver core: Use the ktime_us_delta() helper
authorZenghui Yu <yuzenghui@huawei.com>
Mon, 3 Aug 2020 03:33:43 +0000 (11:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Sep 2020 11:32:06 +0000 (13:32 +0200)
Use the ktime_us_delta() helper to measure the driver probe time. Given the
helpers already returns an s64 value, let's drop the unnecessary casting to
s64 as well. There is no functional change.

Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
Link: https://lore.kernel.org/r/20200803033343.1178-1-yuzenghui@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/dd.c

index 857b0a928e8d0d9fb63aaabcfd2770e9652d72e3..6e7319ca5bde6561e0e10545b6ea4972c7b6869a 100644 (file)
@@ -658,15 +658,14 @@ done:
  */
 static int really_probe_debug(struct device *dev, struct device_driver *drv)
 {
-       ktime_t calltime, delta, rettime;
+       ktime_t calltime, rettime;
        int ret;
 
        calltime = ktime_get();
        ret = really_probe(dev, drv);
        rettime = ktime_get();
-       delta = ktime_sub(rettime, calltime);
        pr_debug("probe of %s returned %d after %lld usecs\n",
-                dev_name(dev), ret, (s64) ktime_to_us(delta));
+                dev_name(dev), ret, ktime_us_delta(rettime, calltime));
        return ret;
 }