public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] drm/exynos/ipp: Replace struct timeval usage
Date: Mon, 01 Jun 2015 21:26:35 +0200	[thread overview]
Message-ID: <1520355.0EVvn96T68@wuerfel> (raw)
In-Reply-To: <20150601033859.GA3254@tinar>

On Monday 01 June 2015 09:09:00 Tina Ruchandani wrote:
> @@ -1518,10 +1519,11 @@ static int ipp_send_event(struct exynos_drm_ippdrv *ippdrv,
>         e = list_first_entry(&c_node->event_list,
>                 struct drm_exynos_ipp_send_event, base.link);
>  
> -       do_gettimeofday(&now);
> -       DRM_DEBUG_KMS("tv_sec[%ld]tv_usec[%ld]\n", now.tv_sec, now.tv_usec);
> +       getnstimeofday64(&now);
> +       DRM_DEBUG_KMS("tv_sec[%lld]tv_usec[%lld]\n", now.tv_sec, (now.tv_nsec /
> +                                                               NSEC_PER_SEC));
>         e->event.tv_sec = now.tv_sec;
> -       e->event.tv_usec = now.tv_usec;
> +       e->event.tv_usec = now.tv_nsec / NSEC_PER_SEC;
>         e->event.prop_id = property->prop_id;
>  

Unfortunately, this has two important bugs:

* e->event.tv_sec is defined as a '__u32' variable and is used in a public
  user space API, so the code is just as broken afterwards as it was before.
  Fixing this will require adding new ioctl commands.

* You have a typo above: I assume you mean NSEC_PER_USEC instead of
  NSEC_PER_SEC, the current code will always assign tv_usec to zero,
  because now.tv_nsec is by definition smaller than NSEC_PER_SEC.

	Arnd

  reply	other threads:[~2015-06-01 19:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01  3:39 [PATCH] drm/exynos/ipp: Replace struct timeval usage Tina Ruchandani
2015-06-01 19:26 ` Arnd Bergmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-06-01  3:13 Tina Ruchandani
2015-06-01  3:31 ` Baruch Siach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1520355.0EVvn96T68@wuerfel \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox