drm: use ATOMIC64_INIT() for atomic64_t
Subsystems (2)
PATCH 1/1 drm: use ATOMIC64_INIT() for atomic64_t
use ATOMIC64_INIT() not ATOMIC_INIT() for atomic64_t
--- drivers/gpu/drm/drm_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_file.c +1 -1
@@ -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 );struct drm_device *dev = minor->dev;struct drm_file *file;int ret;
Signature · 1 line
2.43.0
Quoted 4 lines · Jonathan Gray
use
ATOMIC64_INIT()notATOMIC_INIT()foratomic64_tFixes 3f09a0cd4ea3 ("drm: Add common fdinfo helper")Signed-off-by Jonathan Gray <[email protected]>
Quoted 9 lines
--- drivers/gpu/drm/drm_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/drm_file.c +0
-0
drivers/gpu/drm/drm_file.c bool drm_dev_needs_global_mutex(struct drm_device *dev) · line 152
Quoted 5 lines
drivers/gpu/drm/drm_file.c +1
-1@@ -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.
Quoted 3 lines
drivers/gpu/drm/drm_file.c +0
-0struct drm_device *dev = minor->dev;struct drm_file *file;int ret;
Signature · 1 line
Jani Nikula, Intel
Quoted 7 lines · Jani Nikula
Quoted 4 lines · Jonathan Gray
use
ATOMIC64_INIT()notATOMIC_INIT()foratomic64_tFixes 3f09a0cd4ea3 ("drm: Add common fdinfo helper")Signed-off-by Jonathan Gray <[email protected]>Reviewed-by Jani Nikula <[email protected]>
This patch didn't get merged. Should I resend it?
Quoted 41 lines
Quoted 10 lines
--- drivers/gpu/drm/drm_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/drm_file.c +0
-0drivers/gpu/drm/drm_file.c bool drm_dev_needs_global_mutex(struct drm_device *dev) · line 152
Quoted 5 lines
drivers/gpu/drm/drm_file.c +1
-1@@ -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_INITandATOMIC64_INITto 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.Quoted 3 lines
drivers/gpu/drm/drm_file.c +0
-0struct drm_device *dev = minor->dev;struct drm_file *file;int ret;Signature · 1 line
Jani Nikula, Intel
Quoted 10 lines · Jonathan Gray
Quoted 7 lines · Jani Nikula
Quoted 4 lines · Jonathan Gray
use
ATOMIC64_INIT()notATOMIC_INIT()foratomic64_tFixes 3f09a0cd4ea3 ("drm: Add common fdinfo helper")Signed-off-by Jonathan Gray <[email protected]>Reviewed-by Jani Nikula <[email protected]>This patch didn't get merged. Should I resend it?
Apologies, it fell between the cracks. Pushed to drm-misc-next now, thanks for the patch.
BR,
Jani.
Signature · 1 line
Jani Nikula, Intel