From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Daley Subject: [PATCH 11/29] libxc: remove null pointer checks in xc_pm_get_{c, p}xstat Date: Wed, 30 Oct 2013 20:51:47 +1300 Message-ID: <1383119525-26033-12-git-send-email-mattjd@gmail.com> References: <1383119525-26033-1-git-send-email-mattjd@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1383119525-26033-1-git-send-email-mattjd@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Matthew Daley , Ian Jackson , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org We don't check for null pointers in similar functions, and it's silly to do so for these arguments here anyway; they should fail noisily if null is passed. While at it, remove pointless brackets. Coverity-ID: 1055938 Coverity-ID: 1055939 Signed-off-by: Matthew Daley --- tools/libxc/xc_pm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libxc/xc_pm.c b/tools/libxc/xc_pm.c index ea1e251..0da2d89 100644 --- a/tools/libxc/xc_pm.c +++ b/tools/libxc/xc_pm.c @@ -51,7 +51,7 @@ int xc_pm_get_pxstat(xc_interface *xch, int cpuid, struct xc_px_stat *pxpt) int max_px, ret; - if ( !pxpt || !(pxpt->trans_pt) || !(pxpt->pt) ) + if ( !pxpt->trans_pt || !pxpt->pt ) return -EINVAL; if ( (ret = xc_pm_get_max_px(xch, cpuid, &max_px)) != 0) @@ -128,7 +128,7 @@ int xc_pm_get_cxstat(xc_interface *xch, int cpuid, struct xc_cx_stat *cxpt) DECLARE_NAMED_HYPERCALL_BOUNCE(residencies, cxpt->residencies, 0, XC_HYPERCALL_BUFFER_BOUNCE_BOTH); int max_cx, ret; - if( !cxpt || !(cxpt->triggers) || !(cxpt->residencies) ) + if( !cxpt->triggers || !cxpt->residencies ) return -EINVAL; if ( (ret = xc_pm_get_max_cx(xch, cpuid, &max_cx)) ) -- 1.7.10.4