Commit 93a3c47d authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by Greg Kroah-Hartman

perf intel-pt: Use __fallthrough

commit 7ea6856d upstream.

To address new warnings emmited by gcc 7, e.g.::

    CC       /tmp/build/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.o
    CC       /tmp/build/perf/tests/parse-events.o
  util/intel-pt-decoder/intel-pt-pkt-decoder.c: In function 'intel_pt_pkt_desc':
  util/intel-pt-decoder/intel-pt-pkt-decoder.c:499:6: error: this statement may fall through [-Werror=implicit-fallthrough=]
     if (!(packet->count))
        ^
  util/intel-pt-decoder/intel-pt-pkt-decoder.c:501:2: note: here
    case INTEL_PT_CYC:
    ^~~~
    CC       /tmp/build/perf/util/intel-pt-decoder/intel-pt-decoder.o
  cc1: all warnings being treated as errors
Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-mf0hw789pu9x855us5l32c83@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 05523785
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <errno.h> #include <errno.h>
#include <stdint.h> #include <stdint.h>
#include <inttypes.h> #include <inttypes.h>
#include <linux/compiler.h>
#include "../cache.h" #include "../cache.h"
#include "../util.h" #include "../util.h"
...@@ -1744,6 +1745,7 @@ static int intel_pt_walk_psb(struct intel_pt_decoder *decoder) ...@@ -1744,6 +1745,7 @@ static int intel_pt_walk_psb(struct intel_pt_decoder *decoder)
switch (decoder->packet.type) { switch (decoder->packet.type) {
case INTEL_PT_TIP_PGD: case INTEL_PT_TIP_PGD:
decoder->continuous_period = false; decoder->continuous_period = false;
__fallthrough;
case INTEL_PT_TIP_PGE: case INTEL_PT_TIP_PGE:
case INTEL_PT_TIP: case INTEL_PT_TIP:
intel_pt_log("ERROR: Unexpected packet\n"); intel_pt_log("ERROR: Unexpected packet\n");
...@@ -1797,6 +1799,8 @@ static int intel_pt_walk_psb(struct intel_pt_decoder *decoder) ...@@ -1797,6 +1799,8 @@ static int intel_pt_walk_psb(struct intel_pt_decoder *decoder)
decoder->pge = false; decoder->pge = false;
decoder->continuous_period = false; decoder->continuous_period = false;
intel_pt_clear_tx_flags(decoder); intel_pt_clear_tx_flags(decoder);
__fallthrough;
case INTEL_PT_TNT: case INTEL_PT_TNT:
decoder->have_tma = false; decoder->have_tma = false;
intel_pt_log("ERROR: Unexpected packet\n"); intel_pt_log("ERROR: Unexpected packet\n");
...@@ -1837,6 +1841,7 @@ static int intel_pt_walk_to_ip(struct intel_pt_decoder *decoder) ...@@ -1837,6 +1841,7 @@ static int intel_pt_walk_to_ip(struct intel_pt_decoder *decoder)
switch (decoder->packet.type) { switch (decoder->packet.type) {
case INTEL_PT_TIP_PGD: case INTEL_PT_TIP_PGD:
decoder->continuous_period = false; decoder->continuous_period = false;
__fallthrough;
case INTEL_PT_TIP_PGE: case INTEL_PT_TIP_PGE:
case INTEL_PT_TIP: case INTEL_PT_TIP:
decoder->pge = decoder->packet.type != INTEL_PT_TIP_PGD; decoder->pge = decoder->packet.type != INTEL_PT_TIP_PGD;
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <string.h> #include <string.h>
#include <endian.h> #include <endian.h>
#include <byteswap.h> #include <byteswap.h>
#include <linux/compiler.h>
#include "intel-pt-pkt-decoder.h" #include "intel-pt-pkt-decoder.h"
...@@ -498,6 +499,7 @@ int intel_pt_pkt_desc(const struct intel_pt_pkt *packet, char *buf, ...@@ -498,6 +499,7 @@ int intel_pt_pkt_desc(const struct intel_pt_pkt *packet, char *buf,
case INTEL_PT_FUP: case INTEL_PT_FUP:
if (!(packet->count)) if (!(packet->count))
return snprintf(buf, buf_len, "%s no ip", name); return snprintf(buf, buf_len, "%s no ip", name);
__fallthrough;
case INTEL_PT_CYC: case INTEL_PT_CYC:
case INTEL_PT_VMCS: case INTEL_PT_VMCS:
case INTEL_PT_MTC: case INTEL_PT_MTC:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment