drm/amdgpu: remove h from printk format specifier
Subsystems (2)
PATCH 1/1 drm/amdgpu: remove h from printk format specifier
From: Tom Rix <[email protected]>
See Documentation/core-api/printk-formats.rst.
h should no longer be used in the format specifier for printk.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +2 -2
@@ -240,7 +240,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) version_major = (le32_to_cpu (hdr->ucode_version) >>24 ) &0xff ; version_minor = (le32_to_cpu (hdr->ucode_version) >>8 ) &0xff ; -DRM_INFO ("Found UVD firmware Version: %hu.%hu Family ID: %hu\n" , +DRM_INFO ("Found UVD firmware Version: %u.%u Family ID: %u\n" , version_major, version_minor, family_id);/*
@@ -267,7 +267,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) dec_minor = (le32_to_cpu (hdr->ucode_version) >>8 ) &0xff ; enc_minor = (le32_to_cpu (hdr->ucode_version) >>24 ) &0x3f ; enc_major = (le32_to_cpu (hdr->ucode_version) >>30 ) &0x3 ; -DRM_INFO ("Found UVD firmware ENC: %hu.%hu DEC: .%hu Family ID: %hu\n" , +DRM_INFO ("Found UVD firmware ENC: %u.%u DEC: .%u Family ID: %u\n" , enc_major, enc_minor, dec_minor, family_id); adev->uvd.max_handles =AMDGPU_MAX_UVD_HANDLES ;
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +1 -1
@@ -179,7 +179,7 @@ int amdgpu_vce_sw_init(struct amdgpu_device *adev, unsigned long size) version_major = (ucode_version >>20 ) &0xfff ; version_minor = (ucode_version >>8 ) &0xfff ; binary_id = ucode_version &0xff ; -DRM_INFO ("Found VCE firmware Version: %hhd.%hhd Binary ID: %hhd\n" , +DRM_INFO ("Found VCE firmware Version: %d.%d Binary ID: %d\n" , version_major, version_minor, binary_id); adev->vce.fw_version = ((version_major <<24 ) | (version_minor <<16 ) | (binary_id <<8 ));
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +2 -2
@@ -181,7 +181,7 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev) enc_major = fw_check; dec_ver = (le32_to_cpu (hdr->ucode_version) >>24 ) &0xf ; vep = (le32_to_cpu (hdr->ucode_version) >>28 ) &0xf ; -DRM_INFO ("Found VCN firmware Version ENC: %hu.%hu DEC: %hu VEP: %hu Revision: %hu\n" , +DRM_INFO ("Found VCN firmware Version ENC: %u.%u DEC: %u VEP: %u Revision: %u\n" , enc_major, enc_minor, dec_ver, vep, fw_rev); }else {unsigned int version_major, version_minor, family_id;
@@ -189,7 +189,7 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev) family_id =le32_to_cpu (hdr->ucode_version) &0xff ; version_major = (le32_to_cpu (hdr->ucode_version) >>24 ) &0xff ; version_minor = (le32_to_cpu (hdr->ucode_version) >>8 ) &0xff ; -DRM_INFO ("Found VCN firmware Version: %hu.%hu Family ID: %hu\n" , +DRM_INFO ("Found VCN firmware Version: %u.%u Family ID: %u\n" , version_major, version_minor, family_id); }
Signature · 6 lines
2.27.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Christian König
maintainerAm 15.12.20 um 15:38 schrieb [email protected]:
Quoted 4 lines
From: Tom Rix <[email protected]>
See
Documentation/core-api/printk-formats.rst.
h should no longer be used in the format specifier for printk.
In general looks valid to me, but my question is how does that work?
I mean we specify h here because it is a short int. Are ints always 32bit on the stack?
Thanks,
Christian.
Quoted 57 lines
Signed-off-by Tom Rix <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +2
-2@@ -240,7 +240,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) version_major = (le32_to_cpu (hdr->ucode_version) >>24 ) &0xff ; version_minor = (le32_to_cpu (hdr->ucode_version) >>8 ) &0xff ; -DRM_INFO ("Found UVD firmware Version: %hu.%hu Family ID: %hu\n" , +DRM_INFO ("Found UVD firmware Version: %u.%u Family ID: %u\n" , version_major, version_minor, family_id);/* @@ -267,7 +267,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) dec_minor = (le32_to_cpu (hdr->ucode_version) >>8 ) &0xff ; enc_minor = (le32_to_cpu (hdr->ucode_version) >>24 ) &0x3f ; enc_major = (le32_to_cpu (hdr->ucode_version) >>30 ) &0x3 ; -DRM_INFO ("Found UVD firmware ENC: %hu.%hu DEC: .%hu Family ID: %hu\n" , +DRM_INFO ("Found UVD firmware ENC: %u.%u DEC: .%u Family ID: %u\n" , enc_major, enc_minor, dec_minor, family_id); adev->uvd.max_handles =AMDGPU_MAX_UVD_HANDLES ;drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +1
-1@@ -179,7 +179,7 @@ int amdgpu_vce_sw_init(struct amdgpu_device *adev, unsigned long size) version_major = (ucode_version >>20 ) &0xfff ; version_minor = (ucode_version >>8 ) &0xfff ; binary_id = ucode_version &0xff ; -DRM_INFO ("Found VCE firmware Version: %hhd.%hhd Binary ID: %hhd\n" , +DRM_INFO ("Found VCE firmware Version: %d.%d Binary ID: %d\n" , version_major, version_minor, binary_id); adev->vce.fw_version = ((version_major <<24 ) | (version_minor <<16 ) | (binary_id <<8 ));drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +1
-1@@ -181,7 +181,7 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev) enc_major = fw_check; dec_ver = (le32_to_cpu (hdr->ucode_version) >>24 ) &0xf ; vep = (le32_to_cpu (hdr->ucode_version) >>28 ) &0xf ; -DRM_INFO ("Found VCN firmware Version ENC: %hu.%hu DEC: %hu VEP: %hu Revision: %hu\n" , +DRM_INFO ("Found VCN firmware Version ENC: %u.%u DEC: %u VEP: %u Revision: %u\n" , enc_major, enc_minor, dec_ver, vep, fw_rev); }else {unsigned int version_major, version_minor, family_id;
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c int amdgpu_vcn_sw_init(struct amdgpu_device *adev) · line 195
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +1
-1@@ -189,7 +189,7 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev) family_id =le32_to_cpu (hdr->ucode_version) &0xff ; version_major = (le32_to_cpu (hdr->ucode_version) >>24 ) &0xff ; version_minor = (le32_to_cpu (hdr->ucode_version) >>8 ) &0xff ; -DRM_INFO ("Found VCN firmware Version: %hu.%hu Family ID: %hu\n" , +DRM_INFO ("Found VCN firmware Version: %u.%u Family ID: %u\n" , version_major, version_minor, family_id); }
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 9 lines · Christian König
Am 15.12.20 um 15:38 schrieb [email protected]:
Quoted 4 lines
From: Tom Rix <[email protected]>
See
Documentation/core-api/printk-formats.rst.
h should no longer be used in the format specifier for printk.In general looks valid to me, but my question is how does that work?
I mean we specify h here because it is a short int. Are ints always 32bit on the stack?
The type of the argument is promoted to int. This was discussed earlier here
https://lore.kernel.org/lkml/[email protected]/
Tom
Quoted 58 lines
Thanks,
Christian.Quoted 54 lines
Signed-off-by Tom Rix <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +2
-2@@ -240,7 +240,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) version_major = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xff; version_minor = (le32_to_cpu(hdr->ucode_version) >> 8) & 0xff; - DRM_INFO("Found UVD firmware Version: %hu.%hu Family ID: %hu\n", + DRM_INFO("Found UVD firmware Version: %u.%u Family ID: %u\n", version_major, version_minor, family_id); /*@@ -267,7 +267,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) dec_minor = (le32_to_cpu(hdr->ucode_version) >> 8) & 0xff; enc_minor = (le32_to_cpu(hdr->ucode_version) >> 24) & 0x3f; enc_major = (le32_to_cpu(hdr->ucode_version) >> 30) & 0x3; - DRM_INFO("Found UVD firmware ENC: %hu.%hu DEC: .%hu Family ID: %hu\n", + DRM_INFO("Found UVD firmware ENC: %u.%u DEC: .%u Family ID: %u\n", enc_major, enc_minor, dec_minor, family_id); adev->uvd.max_handles = AMDGPU_MAX_UVD_HANDLES;drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +1
-1@@ -179,7 +179,7 @@ int amdgpu_vce_sw_init(struct amdgpu_device *adev, unsigned long size) version_major = (ucode_version >> 20) & 0xfff; version_minor = (ucode_version >> 8) & 0xfff; binary_id = ucode_version & 0xff; - DRM_INFO("Found VCE firmware Version: %hhd.%hhd Binary ID: %hhd\n", + DRM_INFO("Found VCE firmware Version: %d.%d Binary ID: %d\n", version_major, version_minor, binary_id);
adev->vce.fw_version= ((version_major<< 24) | (version_minor<< 16) | (binary_id<< 8));drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +1
-1@@ -181,7 +181,7 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev) enc_major = fw_check; dec_ver = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xf; vep = (le32_to_cpu(hdr->ucode_version) >> 28) & 0xf; - DRM_INFO("Found VCN firmware Version ENC: %hu.%hu DEC: %hu VEP: %hu Revision: %hu\n", + DRM_INFO("Found VCN firmware Version ENC: %u.%u DEC: %u VEP: %u Revision: %u\n", enc_major, enc_minor, dec_ver, vep, fw_rev); } else { unsigned int version_major, version_minor, family_id;@@ -189,7 +189,7 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
Quoted 9 lines
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +1
-1family_id = le32_to_cpu(hdr->ucode_version) & 0xff; version_major = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xff; version_minor = (le32_to_cpu(hdr->ucode_version) >> 8) & 0xff; - DRM_INFO("Found VCN firmware Version: %hu.%hu Family ID: %hu\n", + DRM_INFO("Found VCN firmware Version: %u.%u Family ID: %u\n", version_major, version_minor, family_id); }
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Christian König
maintainerAm 15.12.20 um 16:06 schrieb Tom Rix:
Quoted 12 lines · Christian König
Quoted 8 lines
Am 15.12.20 um 15:38 schrieb [email protected]:
Quoted 4 lines
From: Tom Rix <[email protected]>
See
Documentation/core-api/printk-formats.rst.
h should no longer be used in the format specifier for printk.In general looks valid to me, but my question is how does that work?
I mean we specify h here because it is a short int. Are ints always 32bit on the stack?
The type of the argument is promoted to int. This was discussed earlier here
Thanks, I expected this but just wanted to double check.
In this case this patch as well as the radeon one are Reviewed-by: Christian König <[email protected]>.
Regards,
Christian.
Quoted 59 lines
Tom
Quoted 56 lines
Thanks,
Christian.Quoted 53 lines
Signed-off-by Tom Rix <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +2
-2@@ -240,7 +240,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) version_major = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xff; version_minor = (le32_to_cpu(hdr->ucode_version) >> 8) & 0xff; - DRM_INFO("Found UVD firmware Version: %hu.%hu Family ID: %hu\n", + DRM_INFO("Found UVD firmware Version: %u.%u Family ID: %u\n", version_major, version_minor, family_id); /*@@ -267,7 +267,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) dec_minor = (le32_to_cpu(hdr->ucode_version) >> 8) & 0xff; enc_minor = (le32_to_cpu(hdr->ucode_version) >> 24) & 0x3f; enc_major = (le32_to_cpu(hdr->ucode_version) >> 30) & 0x3; - DRM_INFO("Found UVD firmware ENC: %hu.%hu DEC: .%hu Family ID: %hu\n", + DRM_INFO("Found UVD firmware ENC: %u.%u DEC: .%u Family ID: %u\n", enc_major, enc_minor, dec_minor, family_id); adev->uvd.max_handles = AMDGPU_MAX_UVD_HANDLES;drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +1
-1@@ -179,7 +179,7 @@ int amdgpu_vce_sw_init(struct amdgpu_device *adev, unsigned long size) version_major = (ucode_version >> 20) & 0xfff; version_minor = (ucode_version >> 8) & 0xfff; binary_id = ucode_version & 0xff; - DRM_INFO("Found VCE firmware Version: %hhd.%hhd Binary ID: %hhd\n", + DRM_INFO("Found VCE firmware Version: %d.%d Binary ID: %d\n", version_major, version_minor, binary_id); adev->vce.fw_version = ((version_major << 24) | (version_minor << 16) | (binary_id << 8));drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +1
-1@@ -181,7 +181,7 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev) enc_major = fw_check; dec_ver = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xf; vep = (le32_to_cpu(hdr->ucode_version) >> 28) & 0xf; - DRM_INFO("Found VCN firmware Version ENC: %hu.%hu DEC: %hu VEP: %hu Revision: %hu\n", + DRM_INFO("Found VCN firmware Version ENC: %u.%u DEC: %u VEP: %u Revision: %u\n", enc_major, enc_minor, dec_ver, vep, fw_rev); } else { unsigned int version_major, version_minor, family_id;@@ -189,7 +189,7 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c int amdgpu_vcn_sw_init(struct amdgpu_device *adev) · line 195
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +1
-1family_id = le32_to_cpu(hdr->ucode_version) & 0xff; version_major = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xff; version_minor = (le32_to_cpu(hdr->ucode_version) >> 8) & 0xff; - DRM_INFO("Found VCN firmware Version: %hu.%hu Family ID: %hu\n", + DRM_INFO("Found VCN firmware Version: %u.%u Family ID: %u\n", version_major, version_minor, family_id); }
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Alex Deucher
AppliedQuoted 11 lines · Christian König
Am 15.12.20 um 16:06 schrieb Tom Rix:
Quoted 9 lines · Christian König
Quoted 8 lines
Am 15.12.20 um 15:38 schrieb [email protected]:
Quoted 4 lines
From: Tom Rix <[email protected]>
See
Documentation/core-api/printk-formats.rst.
h should no longer be used in the format specifier for printk.In general looks valid to me, but my question is how does that work?
I mean we specify h here because it is a short int. Are ints always 32bit on the stack?
Quoted 9 lines
Quoted 3 lines
The type of the argument is promoted to int. This was discussed earlier here
Thanks, I expected this but just wanted to double check.
In this case this patch as well as the radeon one are Reviewed-by:
Christian König <[email protected]>.
Applied this and the radeon one. Thanks!
Alex
Quoted 67 lines
Regards,
Christian.Quoted 64 lines
Tom
Quoted 61 lines
Thanks,
Christian.Quoted 58 lines
Signed-off-by Tom Rix <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +2
-2@@ -240,7 +240,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) version_major = (le32_to_cpu (hdr->ucode_version) >>24 ) &0xff ; version_minor = (le32_to_cpu (hdr->ucode_version) >>8 ) &0xff ; -DRM_INFO ("Found UVD firmware Version: %hu.%hu Family ID: %hu\n" , +DRM_INFO ("Found UVD firmware Version: %u.%u Family ID: %u\n" , version_major, version_minor, family_id);/* @@ -267,7 +267,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) dec_minor = (le32_to_cpu (hdr->ucode_version) >>8 ) &0xff ; enc_minor = (le32_to_cpu (hdr->ucode_version) >>24 ) &0x3f ; enc_major = (le32_to_cpu (hdr->ucode_version) >>30 ) &0x3 ; -DRM_INFO ("Found UVD firmware ENC: %hu.%hu DEC: .%hu Family ID: %hu\n" , +DRM_INFO ("Found UVD firmware ENC: %u.%u DEC: .%u Family ID: %u\n" , enc_major, enc_minor, dec_minor, family_id); adev->uvd.max_handles =AMDGPU_MAX_UVD_HANDLES ;drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +1
-1@@ -179,7 +179,7 @@ int amdgpu_vce_sw_init(struct amdgpu_device *adev, unsigned long size) version_major = (ucode_version >>20 ) &0xfff ; version_minor = (ucode_version >>8 ) &0xfff ; binary_id = ucode_version &0xff ; -DRM_INFO ("Found VCE firmware Version: %hhd.%hhd Binary ID: %hhd\n" , +DRM_INFO ("Found VCE firmware Version: %d.%d Binary ID: %d\n" , version_major, version_minor, binary_id); adev->vce.fw_version = ((version_major <<24 ) | (version_minor <<16 ) | (binary_id <<8 ));drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +2
-2@@ -181,7 +181,7 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev) enc_major = fw_check; dec_ver = (le32_to_cpu (hdr->ucode_version) >>24 ) &0xf ; vep = (le32_to_cpu (hdr->ucode_version) >>28 ) &0xf ; -DRM_INFO ("Found VCN firmware Version ENC: %hu.%hu DEC: %hu VEP: %hu Revision: %hu\n" , +DRM_INFO ("Found VCN firmware Version ENC: %u.%u DEC: %u VEP: %u Revision: %u\n" , enc_major, enc_minor, dec_ver, vep, fw_rev); }else {unsigned int version_major, version_minor, family_id;@@ -189,7 +189,7 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev) family_id =le32_to_cpu (hdr->ucode_version) &0xff ; version_major = (le32_to_cpu (hdr->ucode_version) >>24 ) &0xff ; version_minor = (le32_to_cpu (hdr->ucode_version) >>8 ) &0xff ; - DRM_INFO("Found VCN firmware Version: %hu.%hu Family ID: %hu\n", + DRM_INFO("Found VCN firmware Version: %u.%u Family ID: %u\n",
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c int amdgpu_vcn_sw_init(struct amdgpu_device *adev) · line 195
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +0
-0version_major, version_minor, family_id); }_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx