Skip to contentSkip to conversation

drm/amdgpu: fix missing endian-safe guard

PATCH In review Evan Quan 2 participants 2 messages Aug 10, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Evan Quan

author
#0 lore raw

PATCH 1/1 drm/amdgpu: fix missing endian-safe guard

Change-Id I84a838d2d14318c1514f5146ae81ab58560b767b
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +1 -1
index 92b925e..d450a96 100644
@@ -659,7 +659,7 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,
 		info->version = (uint16_t)le32_to_cpu(header->header.ucode_version);
 
 		if (CGS_UCODE_ID_CP_MEC == type)
-			info->image_size = (header->jt_offset) << 2;
+			info->image_size = le32_to_cpu(header->jt_offset) << 2;
 
 		info->fw_version = amdgpu_get_firmware_version(cgs_device, type);
 		info->feature_version = (uint16_t)le32_to_cpu(header->ucode_feature_version);
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1502349618-757-1-git-send-email-evan.quan-5C7GfCeVMHo@public.gmane.org

Reviewed-by Alex Deucher
#2 lore raw
Quoted 10 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Evan Quan
Sent: Thursday, August 10, 2017 3:20 AM
To: [email protected]
Cc: Quan, Evan
Subject: [PATCH] drm/amdgpu: fix missing endian-safe guard

Change-Id I84a838d2d14318c1514f5146ae81ab58560b767b
Quoted 22 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +1 -1
index 92b925e..d450a96 100644
@@ -659,7 +659,7 @@ static int amdgpu_cgs_get_firmware_info(struct
 cgs_device *cgs_device,
 		info->version = (uint16_t)le32_to_cpu(header-
 >header.ucode_version);
 
 		if (CGS_UCODE_ID_CP_MEC == type)
-			info->image_size = (header->jt_offset) << 2;
+			info->image_size = le32_to_cpu(header->jt_offset)
 << 2;

info->fw_version =
amdgpu_get_firmware_version(cgs_device, type);
info->feature_version = (uint16_t)le32_to_cpu(header-

Quoted 8 lines
Quoted 1 line

ucode_feature_version);

--
2.7.4

_______________________________________________
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