mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tom Rix <trix@redhat.com>
To: "Christian König" <christian.koenig@amd.com>,
	alexander.deucher@amd.com, airlied@linux.ie, daniel@ffwll.ch,
	lee.jones@linaro.org, Felix.Kuehling@amd.com, nirmoy.das@amd.com,
	sonny.jiang@amd.com, xinhui.pan@amd.com,
	colin.king@canonical.com, James.Zhu@amd.com, leo.liu@amd.com,
	thong.thai@amd.com, vegopala@amd.com, boyuan.zhang@amd.com,
	Monk.Liu@amd.com, mh12gx2825@gmail.com
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/amdgpu: remove h from printk format specifier
Date: Tue, 15 Dec 2020 07:06:06 -0800	[thread overview]
Message-ID: <a741836e-7f33-dcbb-d2bd-603091b9a2ad@redhat.com> (raw)
In-Reply-To: <e71eb9ef-d5f9-0829-670f-d5c2c644a493@amd.com>


On 12/15/20 6:47 AM, Christian König wrote:
> Am 15.12.20 um 15:38 schrieb trix@redhat.com:
>> From: Tom Rix <trix@redhat.com>
>>
>> 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/a68114afb134b8633905f5a25ae7c4e6799ce8f1.camel@perches.com/

Tom

>
> Thanks,
> Christian.
>
>>
>> Signed-off-by: Tom Rix <trix@redhat.com>
>> ---
>>   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(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
>> index 7c5b60e53482..8b989670ed66 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
>> @@ -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;
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
>> index 4861f8ddc1b5..ea6a62f67e38 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
>> @@ -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));
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
>> index 1e756186e3f8..99b82f3c2617 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
>> @@ -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);
>>       }
>>   
>


  reply	other threads:[~2020-12-15 15:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-15 14:38 trix
2020-12-15 14:47 ` Christian König
2020-12-15 15:06   ` Tom Rix [this message]
2020-12-15 15:11     ` Christian König
2020-12-15 15:32       ` Alex Deucher

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=a741836e-7f33-dcbb-d2bd-603091b9a2ad@redhat.com \
    --to=trix@redhat.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=James.Zhu@amd.com \
    --cc=Monk.Liu@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=boyuan.zhang@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=colin.king@canonical.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lee.jones@linaro.org \
    --cc=leo.liu@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mh12gx2825@gmail.com \
    --cc=nirmoy.das@amd.com \
    --cc=sonny.jiang@amd.com \
    --cc=thong.thai@amd.com \
    --cc=vegopala@amd.com \
    --cc=xinhui.pan@amd.com \
    /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

all inboxes | Powered by JetHome®