removed unused variable warnings by removing the variables

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
pull/7/head
Oliver Hartkopp 2012-11-14 20:43:55 +01:00
parent f123d73d9a
commit 589fa16c27
4 changed files with 8 additions and 13 deletions

View File

@ -141,7 +141,7 @@ int main(int argc, char **argv)
{
int sl, sa, sc;
int i, ret;
int i;
int idx = 0;
struct sockaddr_in saddr, clientaddr;
struct sockaddr_can caddr;
@ -228,12 +228,12 @@ int main(int argc, char **argv)
FD_SET(sc, &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)) {
ret = recvfrom(sc, &msg, sizeof(msg), 0,
(struct sockaddr*)&caddr, &caddrlen);
recvfrom(sc, &msg, sizeof(msg), 0,
(struct sockaddr*)&caddr, &caddrlen);
ifr.ifr_ifindex = caddr.can_ifindex;
ioctl(sc, SIOCGIFNAME, &ifr);

View File

@ -391,7 +391,7 @@ static int can_calc_bittiming(struct net_device *dev, struct can_bittiming *bt)
{
struct can_priv *priv = netdev_priv(dev);
const struct can_bittiming_const *btc = priv->bittiming_const;
long rate, best_rate = 0;
long rate = 0;
long best_error = 1000000000, error = 0;
int best_tseg = 0, best_brp = 0, brp = 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_brp = brp;
best_rate = rate;
if (error == 0)
break;
}

View File

@ -190,7 +190,7 @@ int main(int argc, char **argv)
const int canfd_on = 1;
int nbytes, i, j, maxdlen;
struct ifreq ifr;
struct timeval tv, last_tv;
struct timeval tv;
int port = DEFPORT;
struct sockaddr_in inaddr;
struct sockaddr_in clientaddr;
@ -208,10 +208,6 @@ int main(int argc, char **argv)
sigaction(SIGTERM, &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) {
switch (opt) {

View File

@ -146,7 +146,7 @@ int main(int argc, char **argv)
fd_set readfds;
int i, ret;
int i;
int nbytes;
int local_port = 0;
@ -322,7 +322,7 @@ int main(int argc, char **argv)
FD_SET(sc, &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)) {