Commit 06dcc4c9 authored by Takashi Sakamoto's avatar Takashi Sakamoto

firewire: core: move copy_port_status() helper function to TP_fast_assign() block

It would be possible to put any statement in TP_fast_assign().

This commit obsoletes the helper function and put its statements to
TP_fast_assign() for the code simplicity.

Link: https://lore.kernel.org/r/20240712003010.87341-1-o-takashi@sakamocchi.jpSigned-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
parent 9f349e8e
...@@ -10,17 +10,6 @@ ...@@ -10,17 +10,6 @@
#include <trace/events/firewire.h> #include <trace/events/firewire.h>
#ifdef TRACEPOINTS_ENABLED #ifdef TRACEPOINTS_ENABLED
void copy_port_status(u8 *port_status, unsigned int port_capacity,
const u32 *self_id_sequence, unsigned int quadlet_count)
{
unsigned int port_index;
for (port_index = 0; port_index < port_capacity; ++port_index) {
port_status[port_index] =
self_id_sequence_get_port_status(self_id_sequence, quadlet_count, port_index);
}
}
EXPORT_TRACEPOINT_SYMBOL_GPL(isoc_inbound_single_completions); EXPORT_TRACEPOINT_SYMBOL_GPL(isoc_inbound_single_completions);
EXPORT_TRACEPOINT_SYMBOL_GPL(isoc_inbound_multiple_completions); EXPORT_TRACEPOINT_SYMBOL_GPL(isoc_inbound_multiple_completions);
EXPORT_TRACEPOINT_SYMBOL_GPL(isoc_outbound_completions); EXPORT_TRACEPOINT_SYMBOL_GPL(isoc_outbound_completions);
......
...@@ -392,9 +392,6 @@ TRACE_EVENT(bus_reset_handle, ...@@ -392,9 +392,6 @@ TRACE_EVENT(bus_reset_handle,
#define PHY_PACKET_SELF_ID_GET_INITIATED_RESET(quads) \ #define PHY_PACKET_SELF_ID_GET_INITIATED_RESET(quads) \
((((const u32 *)quads)[0] & SELF_ID_ZERO_INITIATED_RESET_MASK) >> SELF_ID_ZERO_INITIATED_RESET_SHIFT) ((((const u32 *)quads)[0] & SELF_ID_ZERO_INITIATED_RESET_MASK) >> SELF_ID_ZERO_INITIATED_RESET_SHIFT)
void copy_port_status(u8 *port_status, unsigned int port_capacity, const u32 *self_id_sequence,
unsigned int quadlet_count);
TRACE_EVENT(self_id_sequence, TRACE_EVENT(self_id_sequence,
TP_PROTO(unsigned int card_index, const u32 *self_id_sequence, unsigned int quadlet_count, unsigned int generation), TP_PROTO(unsigned int card_index, const u32 *self_id_sequence, unsigned int quadlet_count, unsigned int generation),
TP_ARGS(card_index, self_id_sequence, quadlet_count, generation), TP_ARGS(card_index, self_id_sequence, quadlet_count, generation),
...@@ -407,8 +404,16 @@ TRACE_EVENT(self_id_sequence, ...@@ -407,8 +404,16 @@ TRACE_EVENT(self_id_sequence,
TP_fast_assign( TP_fast_assign(
__entry->card_index = card_index; __entry->card_index = card_index;
__entry->generation = generation; __entry->generation = generation;
copy_port_status(__get_dynamic_array(port_status), __get_dynamic_array_len(port_status), {
self_id_sequence, quadlet_count); u8 *port_status = __get_dynamic_array(port_status);
unsigned int port_index;
for (port_index = 0; port_index < __get_dynamic_array_len(port_status); ++port_index) {
port_status[port_index] =
self_id_sequence_get_port_status(self_id_sequence,
quadlet_count, port_index);
}
}
memcpy(__get_dynamic_array(self_id_sequence), self_id_sequence, memcpy(__get_dynamic_array(self_id_sequence), self_id_sequence,
__get_dynamic_array_len(self_id_sequence)); __get_dynamic_array_len(self_id_sequence));
), ),
......
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