We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef24989 commit 669c285Copy full SHA for 669c285
drivers/gpu/drm/msm/msm_drv.h
@@ -537,15 +537,12 @@ static inline int align_pitch(int width, int bpp)
537
static inline unsigned long timeout_to_jiffies(const ktime_t *timeout)
538
{
539
ktime_t now = ktime_get();
540
- s64 remaining_jiffies;
541
542
- if (ktime_compare(*timeout, now) < 0) {
543
- remaining_jiffies = 0;
544
- } else {
545
- ktime_t rem = ktime_sub(*timeout, now);
546
- remaining_jiffies = ktime_divns(rem, NSEC_PER_SEC / HZ);
547
- }
+ if (ktime_compare(*timeout, now) <= 0)
+ return 0;
548
+ ktime_t rem = ktime_sub(*timeout, now);
+ s64 remaining_jiffies = ktime_divns(rem, NSEC_PER_SEC / HZ);
549
return clamp(remaining_jiffies, 1LL, (s64)INT_MAX);
550
}
551
0 commit comments