[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20200803033343.1178-1-yuzenghui@huawei.com>
Date: Mon, 3 Aug 2020 11:33:43 +0800
From: Zenghui Yu <yuzenghui@...wei.com>
To: <gregkh@...uxfoundation.org>, <rafael@...nel.org>
CC: <linux-kernel@...r.kernel.org>, <wanghaibin.wang@...wei.com>,
<tglx@...utronix.de>, Zenghui Yu <yuzenghui@...wei.com>
Subject: [PATCH] driver core: Use the ktime_us_delta() helper
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@...wei.com>
---
drivers/base/dd.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 3cefe89e94ca..0ef5b2f32932 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -618,15 +618,14 @@ static int really_probe(struct device *dev, struct device_driver *drv)
*/
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;
}
--
2.19.1
Powered by blists - more mailing lists