All of lore.kernel.org
 help / color / mirror / Atom feed
* re: drm/amd/powerplay: add smu support for ellesmere/baffin
@ 2016-05-10 10:54 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2016-05-10 10:54 UTC (permalink / raw)
  To: Rex.Zhu; +Cc: dri-devel

Hello rezhu,

The patch c81726252ec9: "drm/amd/powerplay: add smu support for
ellesmere/baffin" from Nov 10, 2015, leads to the following static
checker warning:

	drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/polaris10_smumgr.c:978 polaris10_smum_init()
	warn: returning -1 instead of -ENOMEM is sloppy

drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/polaris10_smumgr.c
   971  int polaris10_smum_init(struct pp_smumgr *smumgr)
   972  {
   973          struct polaris10_smumgr *polaris10_smu = NULL;
                                         ^^^^^^^^^^^^^^^^^^^^
Please remove this.  GCC has a tool for warning about uninitialized
variables.  If we just turn it off by initializing it to a bogus value
then it can let bugs go undetected.

   974  
   975          polaris10_smu = kzalloc(sizeof(struct polaris10_smumgr), GFP_KERNEL);
   976  
   977          if (polaris10_smu == NULL)
   978                  return -1;

return -ENOMEM;

   979  
   980          smumgr->backend = polaris10_smu;
   981          smumgr->smumgr_funcs = &ellsemere_smu_funcs;
   982  
   983          return 0;
   984  }

regards,
dan carpenter
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-05-10 10:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-10 10:54 drm/amd/powerplay: add smu support for ellesmere/baffin Dan Carpenter

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.