removed unused variable warnings by removing the variables
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>pull/7/head
parent
f123d73d9a
commit
589fa16c27
|
|
@ -141,7 +141,7 @@ int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
|
||||||
int sl, sa, sc;
|
int sl, sa, sc;
|
||||||
int i, ret;
|
int i;
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
struct sockaddr_in saddr, clientaddr;
|
struct sockaddr_in saddr, clientaddr;
|
||||||
struct sockaddr_can caddr;
|
struct sockaddr_can caddr;
|
||||||
|
|
@ -228,11 +228,11 @@ int main(int argc, char **argv)
|
||||||
FD_SET(sc, &readfds);
|
FD_SET(sc, &readfds);
|
||||||
FD_SET(sa, &readfds);
|
FD_SET(sa, &readfds);
|
||||||
|
|
||||||
ret = select((sc > sa)?sc+1:sa+1, &readfds, NULL, NULL, NULL);
|
select((sc > sa)?sc+1:sa+1, &readfds, NULL, NULL, NULL);
|
||||||
|
|
||||||
if (FD_ISSET(sc, &readfds)) {
|
if (FD_ISSET(sc, &readfds)) {
|
||||||
|
|
||||||
ret = recvfrom(sc, &msg, sizeof(msg), 0,
|
recvfrom(sc, &msg, sizeof(msg), 0,
|
||||||
(struct sockaddr*)&caddr, &caddrlen);
|
(struct sockaddr*)&caddr, &caddrlen);
|
||||||
|
|
||||||
ifr.ifr_ifindex = caddr.can_ifindex;
|
ifr.ifr_ifindex = caddr.can_ifindex;
|
||||||
|
|
|
||||||
|
|
@ -391,7 +391,7 @@ static int can_calc_bittiming(struct net_device *dev, struct can_bittiming *bt)
|
||||||
{
|
{
|
||||||
struct can_priv *priv = netdev_priv(dev);
|
struct can_priv *priv = netdev_priv(dev);
|
||||||
const struct can_bittiming_const *btc = priv->bittiming_const;
|
const struct can_bittiming_const *btc = priv->bittiming_const;
|
||||||
long rate, best_rate = 0;
|
long rate = 0;
|
||||||
long best_error = 1000000000, error = 0;
|
long best_error = 1000000000, error = 0;
|
||||||
int best_tseg = 0, best_brp = 0, brp = 0;
|
int best_tseg = 0, best_brp = 0, brp = 0;
|
||||||
int tsegall, tseg = 0, tseg1 = 0, tseg2 = 0;
|
int tsegall, tseg = 0, tseg1 = 0, tseg2 = 0;
|
||||||
|
|
@ -443,7 +443,6 @@ static int can_calc_bittiming(struct net_device *dev, struct can_bittiming *bt)
|
||||||
}
|
}
|
||||||
best_tseg = tseg / 2;
|
best_tseg = tseg / 2;
|
||||||
best_brp = brp;
|
best_brp = brp;
|
||||||
best_rate = rate;
|
|
||||||
if (error == 0)
|
if (error == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -190,7 +190,7 @@ int main(int argc, char **argv)
|
||||||
const int canfd_on = 1;
|
const int canfd_on = 1;
|
||||||
int nbytes, i, j, maxdlen;
|
int nbytes, i, j, maxdlen;
|
||||||
struct ifreq ifr;
|
struct ifreq ifr;
|
||||||
struct timeval tv, last_tv;
|
struct timeval tv;
|
||||||
int port = DEFPORT;
|
int port = DEFPORT;
|
||||||
struct sockaddr_in inaddr;
|
struct sockaddr_in inaddr;
|
||||||
struct sockaddr_in clientaddr;
|
struct sockaddr_in clientaddr;
|
||||||
|
|
@ -208,10 +208,6 @@ int main(int argc, char **argv)
|
||||||
sigaction(SIGTERM, &signalaction, NULL); /* install Signal for termination */
|
sigaction(SIGTERM, &signalaction, NULL); /* install Signal for termination */
|
||||||
sigaction(SIGINT, &signalaction, NULL); /* install Signal for termination */
|
sigaction(SIGINT, &signalaction, NULL); /* install Signal for termination */
|
||||||
|
|
||||||
|
|
||||||
last_tv.tv_sec = 0;
|
|
||||||
last_tv.tv_usec = 0;
|
|
||||||
|
|
||||||
while ((opt = getopt(argc, argv, "m:v:i:e:p:?")) != -1) {
|
while ((opt = getopt(argc, argv, "m:v:i:e:p:?")) != -1) {
|
||||||
|
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
fd_set readfds;
|
fd_set readfds;
|
||||||
|
|
||||||
int i, ret;
|
int i;
|
||||||
int nbytes;
|
int nbytes;
|
||||||
|
|
||||||
int local_port = 0;
|
int local_port = 0;
|
||||||
|
|
@ -322,7 +322,7 @@ int main(int argc, char **argv)
|
||||||
FD_SET(sc, &readfds);
|
FD_SET(sc, &readfds);
|
||||||
FD_SET(sa, &readfds);
|
FD_SET(sa, &readfds);
|
||||||
|
|
||||||
ret = select((sc > sa)?sc+1:sa+1, &readfds, NULL, NULL, NULL);
|
select((sc > sa)?sc+1:sa+1, &readfds, NULL, NULL, NULL);
|
||||||
|
|
||||||
if (FD_ISSET(sc, &readfds)) {
|
if (FD_ISSET(sc, &readfds)) {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue