Skip to contentSkip to conversation

drm/amd/display: fix the coding style issue of integrated_info

PATCH In review Huang Rui 3 participants 3 messages Jan 15, 2021

Subsystems (3)
lore
Share & tools
lore

Huang Rui

author
#0 lore raw

PATCH 1/1 drm/amd/display: fix the coding style issue of integrated_info

Follow the coding style of size of a struct, changing to:

p = kmalloc(sizeof(*p), ...);

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +2 -2
index 73178978ae74..9885ef21cc05 100644
@@ -1380,7 +1380,7 @@ static bool dc_link_construct(struct dc_link *link,
 
 	DC_LOGGER_INIT(dc_ctx->logger);
 
-	info = kzalloc(sizeof(struct integrated_info), GFP_KERNEL);
+	info = kzalloc(sizeof(*info), GFP_KERNEL);
 	if (!info)
 		goto create_fail;
 
@@ -1545,7 +1545,7 @@ static bool dc_link_construct(struct dc_link *link,
 	}
 
 	if (bios->integrated_info)
-		memcpy(info, bios->integrated_info, sizeof(struct integrated_info));
+		memcpy(info, bios->integrated_info, sizeof(*info));
 
 	/* Look for channel mapping corresponding to connector and device tag */
 	for (i = 0; i < MAX_NUMBER_OF_EXT_DISPLAY_PATH; i++) {
Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
maintainer Reviewed-by on v1 1/1
#1 lore raw

Am 15.01.21 um 22:54 schrieb Huang Rui:

Quoted 5 lines

Follow the coding style of size of a struct, changing to:

p = kmalloc(sizeof(*p), ...);

Quoted 18 lines
---
  drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 -1
index 73178978ae74..9885ef21cc05 100644
@@ -1380,7 +1380,7 @@ static bool dc_link_construct(struct dc_link *link,
 
  	DC_LOGGER_INIT(dc_ctx->logger);
 
-	info = kzalloc(sizeof(struct integrated_info), GFP_KERNEL);
+	info = kzalloc(sizeof(*info), GFP_KERNEL);
  	if (!info)
  		goto create_fail;
 

drivers/gpu/drm/amd/display/dc/core/dc_link.c static bool dc_link_construct(struct dc_link *link, · line 1551

Quoted 8 lines
drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 -1
@@ -1545,7 +1545,7 @@ static bool dc_link_construct(struct dc_link *link,
  	}
 
  	if (bios->integrated_info)
-		memcpy(info, bios->integrated_info, sizeof(struct integrated_info));
+		memcpy(info, bios->integrated_info, sizeof(*info));
 
  	/* Look for channel mapping corresponding to connector and device tag */
  	for (i = 0; i < MAX_NUMBER_OF_EXT_DISPLAY_PATH; i++) {

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

Reviewed-by on v1 1/1
#2 lore raw
In reply to Huang Rui
Quoted 8 lines · Huang Rui

Follow the coding style of size of a struct, changing to:

p = kmalloc(sizeof(*p), ...);

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 8 lines
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx