mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-04 22:09:57 +02:00
cansend: convert towards kernel coding style
This commit is contained in:
@@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
#include "lib.h"
|
#include "lib.h"
|
||||||
|
|
||||||
void print_usage(char *prg)
|
static void print_usage(char *prg)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s - send CAN-frames via CAN_RAW sockets.\n", prg);
|
fprintf(stderr, "%s - send CAN-frames via CAN_RAW sockets.\n", prg);
|
||||||
fprintf(stderr, "\nUsage: %s <device> <can_frame>.\n", prg);
|
fprintf(stderr, "\nUsage: %s <device> <can_frame>.\n", prg);
|
||||||
@@ -147,10 +147,12 @@ int main(int argc, char **argv)
|
|||||||
frame.len = can_fd_dlc2len(can_fd_len2dlc(frame.len));
|
frame.len = can_fd_dlc2len(can_fd_len2dlc(frame.len));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* disable default receive filter on this RAW socket */
|
/*
|
||||||
/* This is obsolete as we do not read from the socket at all, but for */
|
* disable default receive filter on this RAW socket This is
|
||||||
/* this reason we can remove the receive list in the Kernel to save a */
|
* obsolete as we do not read from the socket at all, but for
|
||||||
/* little (really a very little!) CPU usage. */
|
* this reason we can remove the receive list in the Kernel to
|
||||||
|
* save a little (really a very little!) CPU usage.
|
||||||
|
*/
|
||||||
setsockopt(s, SOL_CAN_RAW, CAN_RAW_FILTER, NULL, 0);
|
setsockopt(s, SOL_CAN_RAW, CAN_RAW_FILTER, NULL, 0);
|
||||||
|
|
||||||
if (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
|
if (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user