[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86/psr: remove useless check in free_socket_resources



commit d73168728c49a21da88989e548f01c5947a5b538
Author:     Wei Liu <wei.liu2@xxxxxxxxxx>
AuthorDate: Wed Aug 9 13:35:19 2017 +0100
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Thu Aug 10 11:55:08 2017 +0100

    x86/psr: remove useless check in free_socket_resources
    
    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@xxxxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 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 9ce8f17..84f213c 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,
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.