Internal CoreSight components are rendering trace data in little-endian format. As such there is no need to convert the data once more, hence removing the extra step.
Signed-off-by: Mathieu Poirier mathieu.poirier@linaro.org --- drivers/hwtracing/coresight/coresight-etb10.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/hwtracing/coresight/coresight-etb10.c b/drivers/hwtracing/coresight/coresight-etb10.c index d9c233135d6d..5a653b95fde1 100644 --- a/drivers/hwtracing/coresight/coresight-etb10.c +++ b/drivers/hwtracing/coresight/coresight-etb10.c @@ -202,8 +202,7 @@ static void etb_dump_hw(struct etb_drvdata *drvdata) { int i; u8 *buf_ptr; - u32 read_data, depth; - u32 read_ptr, write_ptr; + u32 depth, read_ptr, write_ptr; u32 frame_off, frame_endoff;
CS_UNLOCK(drvdata->base); @@ -231,12 +230,9 @@ static void etb_dump_hw(struct etb_drvdata *drvdata) depth = drvdata->buffer_depth; buf_ptr = drvdata->buf; for (i = 0; i < depth; i++) { - read_data = readl_relaxed(drvdata->base + - ETB_RAM_READ_DATA_REG); - *buf_ptr++ = read_data >> 0; - *buf_ptr++ = read_data >> 8; - *buf_ptr++ = read_data >> 16; - *buf_ptr++ = read_data >> 24; + *(u32*)buf_ptr = readl_relaxed(drvdata->base + + ETB_RAM_READ_DATA_REG); + buf_ptr += 4; }
if (frame_off) { @@ -444,10 +440,8 @@ static void etb_update_buffer(struct coresight_device *csdev, buf_ptr = buf->data_pages[cur] + offset; read_data = readl_relaxed(drvdata->base + ETB_RAM_READ_DATA_REG); - *buf_ptr++ = read_data >> 0; - *buf_ptr++ = read_data >> 8; - *buf_ptr++ = read_data >> 16; - *buf_ptr++ = read_data >> 24; + *(u32*)buf_ptr = read_data; + buf_ptr += 4;
offset += 4; if (offset >= PAGE_SIZE) {