clock_send_notification: msg_len is unused
message length is already included in the msg structure Signed-off-by: Rafaël Carré <funman@videolan.org>master
parent
6bc77ccf4b
commit
3c7fa5dd42
6
clock.c
6
clock.c
|
@ -232,7 +232,7 @@ static void clock_prune_subscriptions(struct clock *c)
|
|||
}
|
||||
|
||||
void clock_send_notification(struct clock *c, struct ptp_message *msg,
|
||||
int msglen, enum notification event)
|
||||
enum notification event)
|
||||
{
|
||||
unsigned int event_pos = event / 8;
|
||||
uint8_t mask = 1 << (event % 8);
|
||||
|
@ -1422,7 +1422,6 @@ void clock_notify_event(struct clock *c, enum notification event)
|
|||
struct port *uds = c->uds_port;
|
||||
struct PortIdentity pid = port_identity(uds);
|
||||
struct ptp_message *msg;
|
||||
UInteger16 msg_len;
|
||||
int id;
|
||||
|
||||
switch (event) {
|
||||
|
@ -1437,10 +1436,9 @@ void clock_notify_event(struct clock *c, enum notification event)
|
|||
return;
|
||||
if (!clock_management_fill_response(c, NULL, NULL, msg, id))
|
||||
goto err;
|
||||
msg_len = msg->header.messageLength;
|
||||
if (msg_pre_send(msg))
|
||||
goto err;
|
||||
clock_send_notification(c, msg, msg_len, event);
|
||||
clock_send_notification(c, msg, event);
|
||||
err:
|
||||
msg_put(msg);
|
||||
}
|
||||
|
|
3
clock.h
3
clock.h
|
@ -191,11 +191,10 @@ int clock_manage(struct clock *c, struct port *p, struct ptp_message *msg);
|
|||
* Send notification about an event to all subscribers.
|
||||
* @param c The clock instance.
|
||||
* @param msg The PTP message to send, in network byte order.
|
||||
* @param msglen The length of the message in bytes.
|
||||
* @param event The event that occured.
|
||||
*/
|
||||
void clock_send_notification(struct clock *c, struct ptp_message *msg,
|
||||
int msglen, enum notification event);
|
||||
enum notification event);
|
||||
|
||||
/**
|
||||
* Construct and send notification to subscribers about an event that
|
||||
|
|
4
port.c
4
port.c
|
@ -2735,7 +2735,6 @@ void port_notify_event(struct port *p, enum notification event)
|
|||
{
|
||||
struct PortIdentity pid = port_identity(p);
|
||||
struct ptp_message *msg;
|
||||
UInteger16 msg_len;
|
||||
int id;
|
||||
|
||||
switch (event) {
|
||||
|
@ -2752,10 +2751,9 @@ void port_notify_event(struct port *p, enum notification event)
|
|||
return;
|
||||
if (!port_management_fill_response(p, msg, id))
|
||||
goto err;
|
||||
msg_len = msg->header.messageLength;
|
||||
if (msg_pre_send(msg))
|
||||
goto err;
|
||||
clock_send_notification(p->clock, msg, msg_len, event);
|
||||
clock_send_notification(p->clock, msg, event);
|
||||
err:
|
||||
msg_put(msg);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue