diff mbox

[2/8] tools/xenalyze: Avoid redundant check

Message ID 1456411743-17741-3-git-send-email-george.dunlap@eu.citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

George Dunlap Feb. 25, 2016, 2:48 p.m. UTC
Coverity notices that if !head is true, that !N can never be true.

Don't bother checking N, since we know it has to be at least one.

CID 1354243

Signed-off-by: George Dunlap <george.dunlap@citrix.com>
---
CC: Ian Jackson <ian.jackson@citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
---
 tools/xentrace/xenalyze.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Ian Jackson Feb. 26, 2016, 12:23 p.m. UTC | #1
George Dunlap writes ("[PATCH 2/8] tools/xenalyze: Avoid redundant check"):
> Coverity notices that if !head is true, that !N can never be true.
> 
> Don't bother checking N, since we know it has to be at least one.
> 
> CID 1354243
> 
> Signed-off-by: George Dunlap <george.dunlap@citrix.com>

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Konrad Rzeszutek Wilk Feb. 29, 2016, 4:15 p.m. UTC | #2
On Fri, Feb 26, 2016 at 12:23:15PM +0000, Ian Jackson wrote:
> George Dunlap writes ("[PATCH 2/8] tools/xenalyze: Avoid redundant check"):
> > Coverity notices that if !head is true, that !N can never be true.
> > 
> > Don't bother checking N, since we know it has to be at least one.
> > 
> > CID 1354243
> > 
> > Signed-off-by: George Dunlap <george.dunlap@citrix.com>
> 
> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Applied.
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
diff mbox

Patch

diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
index 3c90a0f..33f8129 100644
--- a/tools/xentrace/xenalyze.c
+++ b/tools/xentrace/xenalyze.c
@@ -4146,9 +4146,6 @@  void cr3_dump_list(struct cr3_value_struct *head){
     for(p=head; p; p=p->next)
         N++;
 
-    if(!N)
-        return;
-
     /* Alloc a struct of the right size */
     qsort_array = malloc(N * sizeof(struct eip_list_struct *));