From: Dan Carpenter <dan.carpenter@oracle.com>
To: Rex.Zhu@amd.com
Cc: dri-devel@lists.freedesktop.org
Subject: re: drm/amd/powerplay: add smu support for ellesmere/baffin
Date: Tue, 10 May 2016 13:54:26 +0300 [thread overview]
Message-ID: <20160510105425.GA15850@mwanda> (raw)
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
reply other threads:[~2016-05-10 10:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20160510105425.GA15850@mwanda \
--to=dan.carpenter@oracle.com \
--cc=Rex.Zhu@amd.com \
--cc=dri-devel@lists.freedesktop.org \
/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 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.