aboutsummaryrefslogtreecommitdiff
path: root/gprofng
diff options
context:
space:
mode:
authorVladimir Mezentsev <vladimir.mezentsev@oracle.com>2022-09-29 13:30:42 -0700
committerVladimir Mezentsev <vladimir.mezentsev@oracle.com>2022-09-29 22:00:02 -0700
commit0d94a8735055432029237612a6eb9165db1ec9dd (patch)
tree8cb9c443e2653039b0d05c14169b7fe65a41c154 /gprofng
parent1d4c108cec2b50bde92d269c34b79d0d19949630 (diff)
downloadgdb-0d94a8735055432029237612a6eb9165db1ec9dd.zip
gdb-0d94a8735055432029237612a6eb9165db1ec9dd.tar.gz
gdb-0d94a8735055432029237612a6eb9165db1ec9dd.tar.bz2
gprofng: fix cppcheck warnings
gprofng/ChangeLog 2022-09-29 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> * common/hwcdrv.c: Fix cppcheck warning. * src/ABS.h: Likewise. * src/CompCom.cc: Likewise.
Diffstat (limited to 'gprofng')
-rw-r--r--gprofng/common/hwcdrv.c2
-rw-r--r--gprofng/src/ABS.h2
-rw-r--r--gprofng/src/CompCom.cc2
3 files changed, 3 insertions, 3 deletions
diff --git a/gprofng/common/hwcdrv.c b/gprofng/common/hwcdrv.c
index 05390e2..03c3a71 100644
--- a/gprofng/common/hwcdrv.c
+++ b/gprofng/common/hwcdrv.c
@@ -696,7 +696,7 @@ init_perf_event (struct perf_event_attr *hw, uint64_t event, uint64_t period)
#endif
hw->sample_period = period;
- hw->sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_READ |
+ hw->sample_type = PERF_SAMPLE_IP |
// PERF_SAMPLE_TID |
// PERF_SAMPLE_TIME | // possibly interesting
// PERF_SAMPLE_ADDR |
diff --git a/gprofng/src/ABS.h b/gprofng/src/ABS.h
index a5bcbea..c4552d8 100644
--- a/gprofng/src/ABS.h
+++ b/gprofng/src/ABS.h
@@ -53,7 +53,7 @@ extern char *ABS_PP_CODES[NUM_ABS_PP_CODES];
/* dbe should check HWC values for errors */
#define HWCVAL_ERR_FLAG (1ULL<<63)
#define HWCVAL_SET_ERR(ctr) ((ctr) | HWCVAL_ERR_FLAG)
-#define HWCVAL_HAS_ERR(ctr) ((ctr) & HWCVAL_ERR_FLAG ? 1 : 0)
+#define HWCVAL_HAS_ERR(ctr) (((ctr) & HWCVAL_ERR_FLAG) != 0)
#define HWCVAL_CLR_ERR(ctr) ((ctr) & ~HWCVAL_ERR_FLAG)
#define ABS_GET_RT_CODE(EA) ((EA) & 0x0FLL)
diff --git a/gprofng/src/CompCom.cc b/gprofng/src/CompCom.cc
index 3a035a9..14d6fc3 100644
--- a/gprofng/src/CompCom.cc
+++ b/gprofng/src/CompCom.cc
@@ -305,7 +305,7 @@ CompComment::compcom_format (int index, compmsg *msg, int &visible)
for (int i = 0; i < plist_idx - 1; i++)
{
prim_ty = ccm_param_primtype (msg->msg_type, i + 1);
- if (prim_ty == CCM_PRIMTYPE_STRING || prim_ty == CCM_PRIMTYPE_STRING)
+ if (prim_ty == CCM_PRIMTYPE_STRING)
free (parms[i]);
}
}