Re: [PATCH] drm: use ATOMIC64_INIT() for atomic64_t

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 11, 2024 at 11:56:20AM +0200, Jani Nikula wrote:
> On Thu, 11 Jan 2024, Jonathan Gray <jsg@xxxxxxxxx> wrote:
> > use ATOMIC64_INIT() not ATOMIC_INIT() for atomic64_t
> >
> > Fixes: 3f09a0cd4ea3 ("drm: Add common fdinfo helper")
> > Signed-off-by: Jonathan Gray <jsg@xxxxxxxxx>
> 
> Reviewed-by: Jani Nikula <jani.nikula@xxxxxxxxx>

This patch didn't get merged.  Should I resend it?

> 
> > ---
> >  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
> 



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux