mini-jtag: code style clean up

This commit is contained in:
Xiangfu 2012-09-25 22:28:26 +08:00
parent aeddee61ff
commit ee6066e225

View File

@ -5,13 +5,10 @@
// For details see the UNLICENSE file at the root of the source tree. // For details see the UNLICENSE file at the root of the source tree.
// //
#include <ftdi.h>
#include <usb.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include "load-bits.h" #include "load-bits.h"
@ -69,21 +66,15 @@ int load_bits(FILE *bit_file, struct load_bits *bs)
if (memcmp(buf, header, sizeof (header)) != 0) if (memcmp(buf, header, sizeof (header)) != 0)
return -1; return -1;
/* printf("Valid bitfile header found.\n"); */ while (sid != 'e') {
while (sid != 'e')
{
if (read_section(bit_file, &sid, &sdata, &slen) != 0) if (read_section(bit_file, &sid, &sdata, &slen) != 0)
return -1; return -1;
/* printf("Read section id=%c len=%d.\n", sid, slen); */
/* make sure that strings are terminated */ /* make sure that strings are terminated */
if (sid != 'e') if (sid != 'e')
sdata[slen-1] = '\0'; sdata[slen-1] = '\0';
switch (sid) switch (sid) {
{
case 'a': bs->design = (char *)sdata; break; case 'a': bs->design = (char *)sdata; break;
case 'b': bs->part_name = (char *)sdata; break; case 'b': bs->part_name = (char *)sdata; break;
case 'c': bs->date = (char *)sdata; break; case 'c': bs->date = (char *)sdata; break;