x86/psr: remove useless check in free_socket_resources
PATCH 1/1 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 <[email protected]>
--- xen/arch/x86/psr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
xen/arch/x86/psr.c +1 -2
@@ -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,
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 11 lines
Quoted 1 line
Quoted 1 line · On 09.08.17 at 14:35, <[email protected]> wrote:
The check is useless because pointer arithmetic ensures "info" is always non-zero.
Replace it with an ASSERT for
socket_info. The only caller offree_socket_resourcesalready ensuressocket_infois not NULL before calling it.Coverity-ID: 1416344
Signed-off-by Wei Liu <[email protected]>
Acked-by Jan Beulich <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel