Coverity CID 2355: Checking event for NULL is supefluous; restructure the
code to make this obvious.
This commit is contained in:
parent
347d6ce9be
commit
e90cb419e0
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: pmc.c,v 1.13 2006/04/09 18:54:28 christos Exp $ */
|
/* $NetBSD: pmc.c,v 1.14 2006/04/09 18:57:10 christos Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2000 Wasabi Systems, Inc.
|
* Copyright 2000 Wasabi Systems, Inc.
|
||||||
@ -37,7 +37,7 @@
|
|||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
__RCSID("$NetBSD: pmc.c,v 1.13 2006/04/09 18:54:28 christos Exp $");
|
__RCSID("$NetBSD: pmc.c,v 1.14 2006/04/09 18:57:10 christos Exp $");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -384,7 +384,7 @@ int
|
|||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int c, status, ret0, ret1, errn0, errn1;
|
int c, status, ret0, ret1, errn0, errn1;
|
||||||
char *event = NULL;
|
const char *event = "unknown";
|
||||||
const struct pmc_name2val_cpus *pncp;
|
const struct pmc_name2val_cpus *pncp;
|
||||||
const struct pmc_name2val *pnp;
|
const struct pmc_name2val *pnp;
|
||||||
struct i386_pmc_info_args pi;
|
struct i386_pmc_info_args pi;
|
||||||
@ -433,7 +433,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pnp == NULL || argc <= optind || event == NULL)
|
if (pnp == NULL || argc <= optind)
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
(void)memset(&pss0, 0, sizeof pss0);
|
(void)memset(&pss0, 0, sizeof pss0);
|
||||||
|
Loading…
Reference in New Issue
Block a user