net/can/can_xxxsockopt.c: correct the code alignment

This commit is contained in:
raiden00pl 2022-10-21 09:08:30 +02:00 committed by Alan Carvalho de Assis
parent ec3805721c
commit 2b0ce033d7
2 changed files with 12 additions and 12 deletions

View File

@ -98,7 +98,7 @@ int can_getsockopt(FAR struct socket *psock, int option,
ret = -EINVAL;
}
else if (*value_len > CONFIG_NET_CAN_RAW_FILTER_MAX *
sizeof(struct can_filter))
sizeof(struct can_filter))
{
ret = -EINVAL;
}
@ -106,14 +106,14 @@ int can_getsockopt(FAR struct socket *psock, int option,
{
int count = conn->filter_count;
if (*value_len < count * sizeof(struct can_filter))
if (*value_len < count * sizeof(struct can_filter))
{
count = *value_len / sizeof(struct can_filter);
}
else
{
*value_len = count * sizeof(struct can_filter);
}
else
{
*value_len = count * sizeof(struct can_filter);
}
for (int i = 0; i < count; i++)
{

View File

@ -106,14 +106,14 @@ int can_setsockopt(FAR struct socket *psock, int option,
}
else
{
count = value_len / sizeof(struct can_filter);
count = value_len / sizeof(struct can_filter);
for (int i = 0; i < count; i++)
{
conn->filters[i] = ((struct can_filter *)value)[i];
}
for (int i = 0; i < count; i++)
{
conn->filters[i] = ((struct can_filter *)value)[i];
}
conn->filter_count = count;
conn->filter_count = count;
ret = OK;
}