From: Wei Liu <wei.liu2@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
yi.y.sun@linux.intel.com, Wei Liu <wei.liu2@citrix.com>,
Jan Beulich <JBeulich@suse.com>
Subject: [PATCH] x86/psr: remove useless check in free_socket_resources
Date: Wed, 9 Aug 2017 13:35:19 +0100 [thread overview]
Message-ID: <20170809123519.22605-1-wei.liu2@citrix.com> (raw)
The check is useless because pointer arithmetic ensures "info" is
always non-zero.
Replace it with an ASSERT for socket_info. The only caller of
free_socket_resources already ensures socket_info is not NULL before
calling it.
Coverity-ID: 1416344
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
xen/arch/x86/psr.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index 9ce8f17a18..84f213ccf6 100644
--- a/xen/arch/x86/psr.c
+++ b/xen/arch/x86/psr.c
@@ -195,8 +195,7 @@ static void free_socket_resources(unsigned int socket)
unsigned int i;
struct psr_socket_info *info = socket_info + socket;
- if ( !info )
- return;
+ ASSERT(socket_info);
/*
* Free resources of features. The global feature object, e.g. feat_l3,
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next reply other threads:[~2017-08-09 12:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-09 12:35 Wei Liu [this message]
2017-08-09 13:35 ` [PATCH] x86/psr: remove useless check in free_socket_resources Jan Beulich
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=20170809123519.22605-1-wei.liu2@citrix.com \
--to=wei.liu2@citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=xen-devel@lists.xenproject.org \
--cc=yi.y.sun@linux.intel.com \
/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.