Commit 6e24c95b authored by Dimitris Lampridis's avatar Dimitris Lampridis

sw:tools: allow building of tools with more recent versions of gcc

Signed-off-by: Dimitris Lampridis's avatarDimitris Lampridis <dimitris.lampridis@cern.ch>
parent 6017e37d
......@@ -18,7 +18,6 @@
#include <fmc-adc-100m14b4cha.h>
static const char program_name[] = "fau-calibration";
static char options[] = "hf:o:D:b";
static const char help_msg[] =
"Usage: fau-calibration [options]\n"
......@@ -116,9 +115,9 @@ static void fau_calibration_dump_human(struct fa_calib *calib)
* Print binary calibration data on stdout
* @calib: calibration data
*/
static void fau_calibration_dump_machine(struct fa_calib *calib)
static int fau_calibration_dump_machine(struct fa_calib *calib)
{
write(fileno(stdout), calib, sizeof(*calib));
return write(fileno(stdout), calib, sizeof(*calib));
}
/**
......
......@@ -53,7 +53,7 @@ const char *attribute[] = {
/* Write a sysfs attribute */
int fau_write_attribute(enum fau_attribute attr, uint32_t val)
{
int fd;
int ret, fd;
char buf[buf_len], fullpath[200];
/* convert val to string */
......@@ -66,9 +66,9 @@ int fau_write_attribute(enum fau_attribute attr, uint32_t val)
fd = open(fullpath, O_WRONLY);
if (fd < 0)
return -ENOENT;
write(fd, buf, strlen(buf));
ret = write(fd, buf, strlen(buf));
close(fd);
return 0;
return ret;
}
static void fau_help()
......
......@@ -41,7 +41,7 @@ static void print_version(char *pname)
int main(int argc, char **argv)
{
int fd, addr, count, usec;
int fd, addr, count, usec, ret;
int64_t tics;
if ((argc == 2) &&
......@@ -83,15 +83,15 @@ int main(int argc, char **argv)
char b[]={0x00, 0xff};
lseek(fd, addr, SEEK_SET);
write(fd, b + 1, 1);
ret = write(fd, b + 1, 1);
lseek(fd, addr, SEEK_SET);
write(fd, b + 0, 1);
ret = write(fd, b + 0, 1);
if (count > 1) {
tics += usec;
delay_to(tics);
}
} while (--count);
return 0;
return ret;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment