All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 2250/13159] drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c:255:36-43: WARNING opportunity for kmemdup
@ 2020-10-05 15:58 kernel test robot
  2020-10-05 15:58 ` [PATCH] drm/amd/pm: fix memdup.cocci warnings kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2020-10-05 15:58 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1043 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Alex Dewar <alex.dewar90@gmail.com>
CC: Alex Deucher <alexander.deucher@amd.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   2172e358cd1713c5b7c31361ac465edfe55e455c
commit: 4c319bbebef5491c1305d7b56e708f566f83d14a [2250/13159] drm/amd/pm: Remove unnecessary cast
:::::: branch date: 3 days ago
:::::: commit date: 6 weeks ago
config: x86_64-randconfig-c002-20201004 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>

	echo
	echo "coccinelle warnings: (new ones prefixed by >>)"
	echo
>> drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c:255:36-43: WARNING opportunity for kmemdup

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 32789 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] drm/amd/pm: fix memdup.cocci warnings
  2020-10-05 15:58 [linux-next:master 2250/13159] drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c:255:36-43: WARNING opportunity for kmemdup kernel test robot
@ 2020-10-05 15:58 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-10-05 15:58 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2298 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Alex Dewar <alex.dewar90@gmail.com>
CC: Alex Deucher <alexander.deucher@amd.com>
CC: "Christian König" <christian.koenig@amd.com>
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>
CC: Nirmoy Das <nirmoy.das@amd.com>
CC: Evan Quan <evan.quan@amd.com>
CC: amd-gfx(a)lists.freedesktop.org
CC: dri-devel(a)lists.freedesktop.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c:255:36-43: WARNING opportunity for kmemdup

 Use kmemdup rather than duplicating its implementation

Generated by: scripts/coccinelle/api/memdup.cocci

Fixes: 4c319bbebef5 ("drm/amd/pm: Remove unnecessary cast")
CC: Alex Dewar <alex.dewar90@gmail.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   2172e358cd1713c5b7c31361ac465edfe55e455c
commit: 4c319bbebef5491c1305d7b56e708f566f83d14a [2250/13159] drm/amd/pm: Remove unnecessary cast
:::::: branch date: 3 days ago
:::::: commit date: 6 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 vega12_processpptables.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c
@@ -252,12 +252,12 @@ static int init_powerplay_table_informat
 	phm_copy_clock_limits_array(hwmgr, &pptable_information->power_saving_clock_max, powerplay_table->PowerSavingClockMax, ATOM_VEGA12_PPCLOCK_COUNT);
 	phm_copy_clock_limits_array(hwmgr, &pptable_information->power_saving_clock_min, powerplay_table->PowerSavingClockMin, ATOM_VEGA12_PPCLOCK_COUNT);
 
-	pptable_information->smc_pptable = kmalloc(sizeof(PPTable_t), GFP_KERNEL);
+	pptable_information->smc_pptable = kmemdup(&(powerplay_table->smcPPTable),
+						   sizeof(PPTable_t),
+						   GFP_KERNEL);
 	if (pptable_information->smc_pptable == NULL)
 		return -ENOMEM;
 
-	memcpy(pptable_information->smc_pptable, &(powerplay_table->smcPPTable), sizeof(PPTable_t));
-
 	result = append_vbios_pptable(hwmgr, (pptable_information->smc_pptable));
 
 	return result;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-05 15:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-05 15:58 [linux-next:master 2250/13159] drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c:255:36-43: WARNING opportunity for kmemdup kernel test robot
2020-10-05 15:58 ` [PATCH] drm/amd/pm: fix memdup.cocci warnings kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.