Commit 54cc89e9 authored by Alessandro Rubini's avatar Alessandro Rubini

checkpatch fixes

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 01809d13
......@@ -23,16 +23,17 @@ static void fald_help()
printf("\nfald-simple-acq [OPTIONS] <DEVID>\n\n");
printf(" <DEVID>: hexadecimal identifier (e.g.: \"0x200\")\n");
printf(" --before|-b <num> number of pre samples\n");
printf(" --after|-a <num> number of post samples (default: 16)\n");
printf(" --after|-a <num> n. of post samples (default: 16)\n");
printf(" --nshots|-n <num> number of trigger shots\n");
printf(" --delay|-d <num> delay sample after trigger\n");
printf(" --under-sample|-U <num> pick 1 sample every <num>\n");
printf(" --threshold|-t <num> internal trigger threshold\n");
printf(" --channel|-c <num> internal channel to use as trigger (0..3)\n");
printf(" --channel|-c <num> channel used as trigger (0..3)\n");
printf(" --tiemout|-T <millisec> timeout for acquisition\n");
printf(" --negative-edge internal trigger is falling edge\n");
printf(" --binary|-B <file> save binary to <file>\n");
printf(" --multi-binary|-M <file> save two files per shot: <file>.0000.ctrl etc\n");
printf(" --multi-binary|-M <file> save two files per shot: "
"<file>.0000.ctrl etc\n");
printf(" --dont-read|-N config-only, use with zio-dump\n");
printf(" --help|-h show this help\n\n");
......@@ -61,7 +62,7 @@ static struct option options[] = {
{"post", required_argument, 0, 'P'},
{"decimation", required_argument, 0, 'D'},
{"help",no_argument, 0, 'h'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
......@@ -96,9 +97,9 @@ int main(int argc, char *argv[])
fmcadc_set_conf(&acq, FMCADC_CONF_ACQ_N_SHOTS, nshots);
/* Parse options */
while( (c = getopt_long(argc, argv, GETOPT_STRING,
options, &opt_index)) >=0 ){
switch(c){
while ((c = getopt_long(argc, argv, GETOPT_STRING,
options, &opt_index)) >=0) {
switch (c) {
case 'b': case 'p': /* before */
presamples = atoi(optarg);
fmcadc_set_conf(&acq, FMCADC_CONF_ACQ_PRE_SAMP,
......@@ -154,7 +155,7 @@ int main(int argc, char *argv[])
}
}
if (optind != argc - 1 ) {
if (optind != argc - 1) {
fprintf(stderr, "%s: DEVICE-ID is a mandatory argument\n",
argv[0]);
fald_help();
......
......@@ -30,7 +30,7 @@ int main(int argc, char *argv[])
struct fmcadc_dev *adc;
struct fmcadc_conf trg, acq, brd, chn;
static struct option options[] = {
{"help",no_argument, 0, 'h'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
int opt_index = 0, err = 0, i;
......@@ -47,9 +47,8 @@ int main(int argc, char *argv[])
acq.mask = 0;
/* Parse options */
while( (c = getopt_long(argc, argv, "h",
options, &opt_index)) >=0 ){
switch(c){
while((c = getopt_long(argc, argv, "h", options, &opt_index)) >= 0) {
switch (c) {
case 'h':
fald_help();
exit(1);
......@@ -57,7 +56,7 @@ int main(int argc, char *argv[])
}
}
if (optind != argc - 1 ) {
if (optind != argc - 1) {
fprintf(stderr, "%s: DEVICE-ID is a mandatory argument\n",
argv[0]);
fald_help();
......@@ -148,9 +147,9 @@ int main(int argc, char *argv[])
fmcadc_set_conf_mask(&chn, FMCADC_CONF_CHN_OFFSET);
err = fmcadc_retrieve_config(adc, &chn);
if (err) {
fprintf(stderr, "%s: cannot get channel config: %s\n",
argv[0], fmcadc_strerror(errno));
exit(1);
fprintf(stderr, "%s: cannot get channel config: %s\n",
argv[0], fmcadc_strerror(errno));
exit(1);
}
printf(" range: %d\n", chn.value[FMCADC_CONF_CHN_RANGE]);
printf(" 50Ohm Termination: %s\n",
......
......@@ -23,7 +23,7 @@ unsigned presamples = 10;
unsigned postsamples = 10;
int print_data = 1;
void print_buffer_content(struct fmcadc_buffer * buf);
void print_buffer_content(struct fmcadc_buffer *buf);
int read_with_one_buffer(struct fmcadc_dev *dev);
int read_with_n_buffer(struct fmcadc_dev *dev);
......@@ -113,7 +113,7 @@ int main(int argc, char *argv[])
exit(1);
}
switch(test) {
switch (test) {
case 0:
err = read_with_one_buffer(dev);
break;
......@@ -183,7 +183,7 @@ int read_with_n_buffer(struct fmcadc_dev *dev)
}
void print_buffer_content(struct fmcadc_buffer * buf)
void print_buffer_content(struct fmcadc_buffer *buf)
{
int16_t *data = buf->data; /* get data */
struct fmcadc_timestamp *ts;
......
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