From: Jani Nikula <jani.nikula@linux.intel.com>
To: Jonathan Gray <jsg@jsg.id.au>, dri-devel@lists.freedesktop.org
Cc: robdclark@chromium.org, mripard@kernel.org, tzimmermann@suse.de
Subject: Re: [PATCH] drm: use ATOMIC64_INIT() for atomic64_t
Date: Thu, 11 Jan 2024 11:56:20 +0200 [thread overview]
Message-ID: <87bk9suraz.fsf@intel.com> (raw)
In-Reply-To: <20240111023045.50013-1-jsg@jsg.id.au>
On Thu, 11 Jan 2024, Jonathan Gray <jsg@jsg.id.au> wrote:
> use ATOMIC64_INIT() not ATOMIC_INIT() for atomic64_t
>
> Fixes: 3f09a0cd4ea3 ("drm: Add common fdinfo helper")
> Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/drm_file.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c
> index 446458aca8e9..d3b10dd91584 100644
> --- a/drivers/gpu/drm/drm_file.c
> +++ b/drivers/gpu/drm/drm_file.c
> @@ -149,7 +149,7 @@ bool drm_dev_needs_global_mutex(struct drm_device *dev)
> */
> struct drm_file *drm_file_alloc(struct drm_minor *minor)
> {
> - static atomic64_t ident = ATOMIC_INIT(0);
> + static atomic64_t ident = ATOMIC64_INIT(0);
I think we should probably redefine both ATOMIC_INIT and ATOMIC64_INIT
to cast the result to the correct type to avoid this problem once and
for all.
If we had
#define ATOMIC_INIT(i) (atomic_t){ (i) }
and
#define ATOMIC64_INIT(i) (atomic64_t){ (i) }
we'd get a build failure using them incorrectly.
BR,
Jani.
> struct drm_device *dev = minor->dev;
> struct drm_file *file;
> int ret;
--
Jani Nikula, Intel
next prev parent reply other threads:[~2024-01-11 9:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-11 2:30 [PATCH] drm: use ATOMIC64_INIT() for atomic64_t Jonathan Gray
2024-01-11 9:56 ` Jani Nikula [this message]
2024-11-05 11:17 ` Jonathan Gray
2024-11-05 12:14 ` Jani Nikula
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=87bk9suraz.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jsg@jsg.id.au \
--cc=mripard@kernel.org \
--cc=robdclark@chromium.org \
--cc=tzimmermann@suse.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.