Skip to content

Commit

Permalink
afk/dptx: Convert noisy/misleading printf to dprintf
Browse files Browse the repository at this point in the history
Signed-off-by: Janne Grunau <j@jannau.net>
  • Loading branch information
jannau committed Oct 6, 2023
1 parent 595ecb4 commit 7ed5b55
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
26 changes: 13 additions & 13 deletions src/afk.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ int afk_epic_work(afk_epic_t *afk, int endpoint)
if (ret < 0) {
return ret;
}
printf("EPIC[0x%02x]: ignoring message type %d\n", cur->ep, rmsg->type);
dprintf("EPIC[0x%02x]: ignoring message type %d\n", cur->ep, rmsg->type);
afk_epic_rx_ack(cur);
}
}
Expand Down Expand Up @@ -488,7 +488,7 @@ static int afk_epic_handle_std_service(afk_epic_ep_t *epic, int channel, u8 cate
return 0;
}

printf("AFK: channel %d received unhandled standard service message: %x\n", channel, category);
dprintf("AFK: channel %d received unhandled standard service message: %x\n", channel, category);

return -1;
}
Expand Down Expand Up @@ -597,8 +597,8 @@ static void afk_epic_notify_handler(afk_epic_ep_t *epic)
return;

if (rmsg->type != TYPE_NOTIFY) {
printf("EPIC[0x%02x]: got unexpected message type %d in %s\n", epic->ep, rmsg->type,
__func__);
dprintf("EPIC[0x%02x]: got unexpected message type %d in %s\n", epic->ep, rmsg->type,
__func__);
afk_epic_rx_ack(epic);
return;
}
Expand All @@ -612,8 +612,8 @@ static void afk_epic_notify_handler(afk_epic_ep_t *epic)
afk_epic_handle_std_service(epic, rmsg->channel, sub->category, sub->seq, payload,
payload_size);
} else {
printf("EPIC[0x%02x]: %s: rx: Ch %u, Type:0x%02x sub cat:%x type:%x \n", epic->ep, __func__,
rmsg->channel, rmsg->type, sub->category, sub->type);
dprintf("EPIC[0x%02x]: %s: rx: Ch %u, Type:0x%02x sub cat:%x type:%x \n", epic->ep,
__func__, rmsg->channel, rmsg->type, sub->category, sub->type);
}

afk_epic_rx_ack(epic);
Expand Down Expand Up @@ -738,8 +738,8 @@ int afk_epic_start_interface(afk_epic_ep_t *epic, void *intf, size_t txsize, siz
return ret;

if (msg->type != TYPE_NOTIFY && msg->type != TYPE_REPLY) {
printf("AFK[ep:%02x]: got unexpected message type %d during iface start\n", epic->ep,
msg->type);
dprintf("AFK[ep:%02x]: got unexpected message type %d during iface start\n", epic->ep,
msg->type);
afk_epic_rx_ack(epic);
continue;
}
Expand All @@ -748,8 +748,8 @@ int afk_epic_start_interface(afk_epic_ep_t *epic, void *intf, size_t txsize, siz
struct epic_sub_hdr *sub = (void *)(hdr + 1);

if (sub->category != CAT_REPORT || sub->type != SUBTYPE_ANNOUNCE) {
printf("AFK[ep:%02x]: got unexpected message %02x:%04x during iface start\n", epic->ep,
sub->category, sub->type);
dprintf("AFK[ep:%02x]: got unexpected message %02x:%04x during iface start\n", epic->ep,
sub->category, sub->type);
afk_epic_rx_ack(epic);
continue;
}
Expand Down Expand Up @@ -805,8 +805,8 @@ int afk_epic_start_interface(afk_epic_ep_t *epic, void *intf, size_t txsize, siz
service->seq = 0;

ops->init(service, epic_name, service_name, epic_unit);
printf("AFK[ep:%02x]: new service %s on channel %d\n", epic->ep, service_name,
msg->channel);
dprintf("AFK[ep:%02x]: new service %s on channel %d\n", epic->ep, service_name,
msg->channel);
free(epic_name);
free(epic_class);

Expand All @@ -829,7 +829,7 @@ int afk_epic_start_interface(afk_epic_ep_t *epic, void *intf, size_t txsize, siz
return -1;
}

printf("AFK[ep:%02x]: started interface with %d services\n", epic->ep, channels);
dprintf("AFK[ep:%02x]: started interface with %d services\n", epic->ep, channels);

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/dcp/dpav_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static void dpav_init(afk_epic_service_t *service, const char *name, const char
UNUSED(name);
UNUSED(eclass);
UNUSED(unit);
// printf("DPAV: init(name='%s', class='%s' unit=%ld:\n", name, eclass, unit);
dprintf("DPAV: init(name='%s', class='%s' unit=%ld:\n", name, eclass, unit);
}

static const afk_epic_service_ops_t dcp_dpav_ops[] = {
Expand Down
4 changes: 2 additions & 2 deletions src/dcp/dptx_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ int dptx_phy_set_active_lane_count(dptx_phy_t *phy, u32 num_lanes)
{
u32 l;

printf("DPTX-PHY: set_active_lane_count(%u) phy_regs = {0x%lx, 0x%lx}\n", num_lanes,
phy->regs[0], phy->regs[1]);
dprintf("DPTX-PHY: set_active_lane_count(%u) phy_regs = {0x%lx, 0x%lx}\n", num_lanes,
phy->regs[0], phy->regs[1]);

if (num_lanes == 3 || num_lanes > DPTX_MAX_LANES)
return -1;
Expand Down
2 changes: 1 addition & 1 deletion src/dcp/dptx_port_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ static int dptxport_call(afk_epic_service_t *service, u32 idx, const void *data,
return 0;
default:
/* just try to ACK and hope for the best... */
printf("DPTXPort: unhandled call %d\n", idx);
dprintf("DPTXPort: unhandled call %d\n", idx);
// fallthrough
/* we can silently ignore and just ACK these calls */
case DPTX_APCALL_DEACTIVATE:
Expand Down

0 comments on commit 7ed5b55

Please sign in to comment.