Commit cbb86718 authored by Kurt Kanzenbach's avatar Kurt Kanzenbach Committed by Greg Kroah-Hartman

staging: usbip: userspace: libsrc: fix indention

This patch fixes the following checkpatch warning:
-ERROR: code indent should use tabs where possible
-WARNING: suspect code indent for conditional statements
Signed-off-by: default avatarKurt Kanzenbach <ly80toro@cip.cs.fau.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d39625c4
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
*/ */
/* /*
* Copyright (C) 2005 Takahiro Hirofuchi * Copyright (C) 2005 Takahiro Hirofuchi
* - names_deinit() is added. * - names_deinit() is added.
*/ */
/*****************************************************************************/ /*****************************************************************************/
...@@ -82,9 +82,9 @@ struct audioterminal { ...@@ -82,9 +82,9 @@ struct audioterminal {
}; };
struct genericstrtable { struct genericstrtable {
struct genericstrtable *next; struct genericstrtable *next;
unsigned int num; unsigned int num;
char name[1]; char name[1];
}; };
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
...@@ -124,12 +124,12 @@ static struct genericstrtable *countrycodes[HASHSZ] = { NULL, }; ...@@ -124,12 +124,12 @@ static struct genericstrtable *countrycodes[HASHSZ] = { NULL, };
static const char *names_genericstrtable(struct genericstrtable *t[HASHSZ], unsigned int index) static const char *names_genericstrtable(struct genericstrtable *t[HASHSZ], unsigned int index)
{ {
struct genericstrtable *h; struct genericstrtable *h;
for (h = t[hashnum(index)]; h; h = h->next) for (h = t[hashnum(index)]; h; h = h->next)
if (h->num == index) if (h->num == index)
return h->name; return h->name;
return NULL; return NULL;
} }
const char *names_hid(u_int8_t hidd) const char *names_hid(u_int8_t hidd)
...@@ -409,20 +409,20 @@ static int new_audioterminal(const char *name, u_int16_t termt) ...@@ -409,20 +409,20 @@ static int new_audioterminal(const char *name, u_int16_t termt)
static int new_genericstrtable(struct genericstrtable *t[HASHSZ], const char *name, unsigned int index) static int new_genericstrtable(struct genericstrtable *t[HASHSZ], const char *name, unsigned int index)
{ {
struct genericstrtable *g; struct genericstrtable *g;
unsigned int h = hashnum(index); unsigned int h = hashnum(index);
for (g = t[h]; g; g = g->next) for (g = t[h]; g; g = g->next)
if (g->num == index) if (g->num == index)
return -1; return -1;
g = my_malloc(sizeof(struct genericstrtable) + strlen(name)); g = my_malloc(sizeof(struct genericstrtable) + strlen(name));
if (!g) if (!g)
return -1; return -1;
strcpy(g->name, name); strcpy(g->name, name);
g->num = index; g->num = index;
g->next = t[h]; g->next = t[h];
t[h] = g; t[h] = g;
return 0; return 0;
} }
static int new_hid(const char *name, u_int8_t hidd) static int new_hid(const char *name, u_int8_t hidd)
...@@ -485,92 +485,92 @@ static void parse(FILE *f) ...@@ -485,92 +485,92 @@ static void parse(FILE *f)
if (buf[0] == '#' || !buf[0]) if (buf[0] == '#' || !buf[0])
continue; continue;
cp = buf; cp = buf;
if (buf[0] == 'P' && buf[1] == 'H' && buf[2] == 'Y' && buf[3] == 'S' && buf[4] == 'D' && if (buf[0] == 'P' && buf[1] == 'H' && buf[2] == 'Y' && buf[3] == 'S' && buf[4] == 'D' &&
buf[5] == 'E' && buf[6] == 'S' && /*isspace(buf[7])*/ buf[7] == ' ') { buf[5] == 'E' && buf[6] == 'S' && /*isspace(buf[7])*/ buf[7] == ' ') {
cp = buf + 8; cp = buf + 8;
while (isspace(*cp)) while (isspace(*cp))
cp++; cp++;
if (!isxdigit(*cp)) { if (!isxdigit(*cp)) {
fprintf(stderr, "Invalid Physdes type at line %u\n", linectr); fprintf(stderr, "Invalid Physdes type at line %u\n", linectr);
continue; continue;
} }
u = strtoul(cp, &cp, 16); u = strtoul(cp, &cp, 16);
while (isspace(*cp)) while (isspace(*cp))
cp++; cp++;
if (!*cp) { if (!*cp) {
fprintf(stderr, "Invalid Physdes type at line %u\n", linectr); fprintf(stderr, "Invalid Physdes type at line %u\n", linectr);
continue; continue;
} }
if (new_physdes(cp, u)) if (new_physdes(cp, u))
fprintf(stderr, "Duplicate Physdes type spec at line %u terminal type %04x %s\n", linectr, u, cp); fprintf(stderr, "Duplicate Physdes type spec at line %u terminal type %04x %s\n", linectr, u, cp);
DBG(printf("line %5u physdes type %02x %s\n", linectr, u, cp)); DBG(printf("line %5u physdes type %02x %s\n", linectr, u, cp));
continue; continue;
} }
if (buf[0] == 'P' && buf[1] == 'H' && buf[2] == 'Y' && /*isspace(buf[3])*/ buf[3] == ' ') { if (buf[0] == 'P' && buf[1] == 'H' && buf[2] == 'Y' && /*isspace(buf[3])*/ buf[3] == ' ') {
cp = buf + 4; cp = buf + 4;
while (isspace(*cp)) while (isspace(*cp))
cp++; cp++;
if (!isxdigit(*cp)) { if (!isxdigit(*cp)) {
fprintf(stderr, "Invalid PHY type at line %u\n", linectr); fprintf(stderr, "Invalid PHY type at line %u\n", linectr);
continue; continue;
} }
u = strtoul(cp, &cp, 16); u = strtoul(cp, &cp, 16);
while (isspace(*cp)) while (isspace(*cp))
cp++; cp++;
if (!*cp) { if (!*cp) {
fprintf(stderr, "Invalid PHY type at line %u\n", linectr); fprintf(stderr, "Invalid PHY type at line %u\n", linectr);
continue; continue;
} }
if (new_physdes(cp, u)) if (new_physdes(cp, u))
fprintf(stderr, "Duplicate PHY type spec at line %u terminal type %04x %s\n", linectr, u, cp); fprintf(stderr, "Duplicate PHY type spec at line %u terminal type %04x %s\n", linectr, u, cp);
DBG(printf("line %5u PHY type %02x %s\n", linectr, u, cp)); DBG(printf("line %5u PHY type %02x %s\n", linectr, u, cp));
continue; continue;
} }
if (buf[0] == 'B' && buf[1] == 'I' && buf[2] == 'A' && buf[3] == 'S' && /*isspace(buf[4])*/ buf[4] == ' ') { if (buf[0] == 'B' && buf[1] == 'I' && buf[2] == 'A' && buf[3] == 'S' && /*isspace(buf[4])*/ buf[4] == ' ') {
cp = buf + 5; cp = buf + 5;
while (isspace(*cp)) while (isspace(*cp))
cp++; cp++;
if (!isxdigit(*cp)) { if (!isxdigit(*cp)) {
fprintf(stderr, "Invalid BIAS type at line %u\n", linectr); fprintf(stderr, "Invalid BIAS type at line %u\n", linectr);
continue; continue;
} }
u = strtoul(cp, &cp, 16); u = strtoul(cp, &cp, 16);
while (isspace(*cp)) while (isspace(*cp))
cp++; cp++;
if (!*cp) { if (!*cp) {
fprintf(stderr, "Invalid BIAS type at line %u\n", linectr); fprintf(stderr, "Invalid BIAS type at line %u\n", linectr);
continue; continue;
} }
if (new_bias(cp, u)) if (new_bias(cp, u))
fprintf(stderr, "Duplicate BIAS type spec at line %u terminal type %04x %s\n", linectr, u, cp); fprintf(stderr, "Duplicate BIAS type spec at line %u terminal type %04x %s\n", linectr, u, cp);
DBG(printf("line %5u BIAS type %02x %s\n", linectr, u, cp)); DBG(printf("line %5u BIAS type %02x %s\n", linectr, u, cp));
continue; continue;
} }
if (buf[0] == 'L' && /*isspace(buf[1])*/ buf[1] == ' ') { if (buf[0] == 'L' && /*isspace(buf[1])*/ buf[1] == ' ') {
cp = buf+2; cp = buf+2;
while (isspace(*cp)) while (isspace(*cp))
cp++; cp++;
if (!isxdigit(*cp)) { if (!isxdigit(*cp)) {
fprintf(stderr, "Invalid LANGID spec at line %u\n", linectr); fprintf(stderr, "Invalid LANGID spec at line %u\n", linectr);
continue; continue;
} }
u = strtoul(cp, &cp, 16); u = strtoul(cp, &cp, 16);
while (isspace(*cp)) while (isspace(*cp))
cp++; cp++;
if (!*cp) { if (!*cp) {
fprintf(stderr, "Invalid LANGID spec at line %u\n", linectr); fprintf(stderr, "Invalid LANGID spec at line %u\n", linectr);
continue; continue;
} }
if (new_langid(cp, u)) if (new_langid(cp, u))
fprintf(stderr, "Duplicate LANGID spec at line %u language-id %04x %s\n", linectr, u, cp); fprintf(stderr, "Duplicate LANGID spec at line %u language-id %04x %s\n", linectr, u, cp);
DBG(printf("line %5u LANGID %02x %s\n", linectr, u, cp)); DBG(printf("line %5u LANGID %02x %s\n", linectr, u, cp));
lasthut = lastclass = lastvendor = lastsubclass = -1; lasthut = lastclass = lastvendor = lastsubclass = -1;
lastlang = u; lastlang = u;
continue; continue;
} }
if (buf[0] == 'C' && /*isspace(buf[1])*/ buf[1] == ' ') { if (buf[0] == 'C' && /*isspace(buf[1])*/ buf[1] == ' ') {
/* class spec */ /* class spec */
cp = buf+2; cp = buf+2;
...@@ -617,24 +617,24 @@ static void parse(FILE *f) ...@@ -617,24 +617,24 @@ static void parse(FILE *f)
} }
if (buf[0] == 'H' && buf[1] == 'C' && buf[2] == 'C' && isspace(buf[3])) { if (buf[0] == 'H' && buf[1] == 'C' && buf[2] == 'C' && isspace(buf[3])) {
/* HID Descriptor bCountryCode */ /* HID Descriptor bCountryCode */
cp = buf+3; cp = buf+3;
while (isspace(*cp)) while (isspace(*cp))
cp++; cp++;
if (!isxdigit(*cp)) { if (!isxdigit(*cp)) {
fprintf(stderr, "Invalid HID country code at line %u\n", linectr); fprintf(stderr, "Invalid HID country code at line %u\n", linectr);
continue; continue;
} }
u = strtoul(cp, &cp, 10); u = strtoul(cp, &cp, 10);
while (isspace(*cp)) while (isspace(*cp))
cp++; cp++;
if (!*cp) { if (!*cp) {
fprintf(stderr, "Invalid HID country code at line %u\n", linectr); fprintf(stderr, "Invalid HID country code at line %u\n", linectr);
continue; continue;
} }
if (new_countrycode(cp, u)) if (new_countrycode(cp, u))
fprintf(stderr, "Duplicate HID country code at line %u country %02u %s\n", linectr, u, cp); fprintf(stderr, "Duplicate HID country code at line %u country %02u %s\n", linectr, u, cp);
DBG(printf("line %5u keyboard country code %02u %s\n", linectr, u, cp)); DBG(printf("line %5u keyboard country code %02u %s\n", linectr, u, cp));
continue; continue;
} }
if (isxdigit(*cp)) { if (isxdigit(*cp)) {
/* vendor */ /* vendor */
...@@ -680,10 +680,10 @@ static void parse(FILE *f) ...@@ -680,10 +680,10 @@ static void parse(FILE *f)
continue; continue;
} }
if (lastlang != -1) { if (lastlang != -1) {
if (new_langid(cp, lastlang+(u<<10))) if (new_langid(cp, lastlang+(u<<10)))
fprintf(stderr, "Duplicate LANGID Usage Spec at line %u\n", linectr); fprintf(stderr, "Duplicate LANGID Usage Spec at line %u\n", linectr);
continue; continue;
} }
fprintf(stderr, "Product/Subclass spec without prior Vendor/Class spec at line %u\n", linectr); fprintf(stderr, "Product/Subclass spec without prior Vendor/Class spec at line %u\n", linectr);
continue; continue;
} }
...@@ -707,70 +707,70 @@ static void parse(FILE *f) ...@@ -707,70 +707,70 @@ static void parse(FILE *f)
} }
if (buf[0] == 'H' && buf[1] == 'I' && buf[2] == 'D' && /*isspace(buf[3])*/ buf[3] == ' ') { if (buf[0] == 'H' && buf[1] == 'I' && buf[2] == 'D' && /*isspace(buf[3])*/ buf[3] == ' ') {
cp = buf + 4; cp = buf + 4;
while (isspace(*cp)) while (isspace(*cp))
cp++; cp++;
if (!isxdigit(*cp)) { if (!isxdigit(*cp)) {
fprintf(stderr, "Invalid HID type at line %u\n", linectr); fprintf(stderr, "Invalid HID type at line %u\n", linectr);
continue; continue;
} }
u = strtoul(cp, &cp, 16); u = strtoul(cp, &cp, 16);
while (isspace(*cp)) while (isspace(*cp))
cp++; cp++;
if (!*cp) { if (!*cp) {
fprintf(stderr, "Invalid HID type at line %u\n", linectr); fprintf(stderr, "Invalid HID type at line %u\n", linectr);
continue; continue;
} }
if (new_hid(cp, u)) if (new_hid(cp, u))
fprintf(stderr, "Duplicate HID type spec at line %u terminal type %04x %s\n", linectr, u, cp); fprintf(stderr, "Duplicate HID type spec at line %u terminal type %04x %s\n", linectr, u, cp);
DBG(printf("line %5u HID type %02x %s\n", linectr, u, cp)); DBG(printf("line %5u HID type %02x %s\n", linectr, u, cp));
continue; continue;
} }
if (buf[0] == 'H' && buf[1] == 'U' && buf[2] == 'T' && /*isspace(buf[3])*/ buf[3] == ' ') { if (buf[0] == 'H' && buf[1] == 'U' && buf[2] == 'T' && /*isspace(buf[3])*/ buf[3] == ' ') {
cp = buf + 4; cp = buf + 4;
while (isspace(*cp)) while (isspace(*cp))
cp++; cp++;
if (!isxdigit(*cp)) { if (!isxdigit(*cp)) {
fprintf(stderr, "Invalid HUT type at line %u\n", linectr); fprintf(stderr, "Invalid HUT type at line %u\n", linectr);
continue; continue;
} }
u = strtoul(cp, &cp, 16); u = strtoul(cp, &cp, 16);
while (isspace(*cp)) while (isspace(*cp))
cp++; cp++;
if (!*cp) { if (!*cp) {
fprintf(stderr, "Invalid HUT type at line %u\n", linectr); fprintf(stderr, "Invalid HUT type at line %u\n", linectr);
continue; continue;
} }
if (new_huts(cp, u)) if (new_huts(cp, u))
fprintf(stderr, "Duplicate HUT type spec at line %u terminal type %04x %s\n", linectr, u, cp); fprintf(stderr, "Duplicate HUT type spec at line %u terminal type %04x %s\n", linectr, u, cp);
lastlang = lastclass = lastvendor = lastsubclass = -1; lastlang = lastclass = lastvendor = lastsubclass = -1;
lasthut = u; lasthut = u;
DBG(printf("line %5u HUT type %02x %s\n", linectr, u, cp)); DBG(printf("line %5u HUT type %02x %s\n", linectr, u, cp));
continue; continue;
} }
if (buf[0] == 'R' && buf[1] == ' ') { if (buf[0] == 'R' && buf[1] == ' ') {
cp = buf + 2; cp = buf + 2;
while (isspace(*cp)) while (isspace(*cp))
cp++; cp++;
if (!isxdigit(*cp)) { if (!isxdigit(*cp)) {
fprintf(stderr, "Invalid Report type at line %u\n", linectr); fprintf(stderr, "Invalid Report type at line %u\n", linectr);
continue; continue;
} }
u = strtoul(cp, &cp, 16); u = strtoul(cp, &cp, 16);
while (isspace(*cp)) while (isspace(*cp))
cp++; cp++;
if (!*cp) { if (!*cp) {
fprintf(stderr, "Invalid Report type at line %u\n", linectr); fprintf(stderr, "Invalid Report type at line %u\n", linectr);
continue; continue;
} }
if (new_reporttag(cp, u)) if (new_reporttag(cp, u))
fprintf(stderr, "Duplicate Report type spec at line %u terminal type %04x %s\n", linectr, u, cp); fprintf(stderr, "Duplicate Report type spec at line %u terminal type %04x %s\n", linectr, u, cp);
DBG(printf("line %5u Report type %02x %s\n", linectr, u, cp)); DBG(printf("line %5u Report type %02x %s\n", linectr, u, cp));
continue; continue;
} }
if (buf[0] == 'V' && buf[1] == 'T') { if (buf[0] == 'V' && buf[1] == 'T') {
/* add here */ /* add here */
continue; continue;
} }
......
...@@ -289,25 +289,25 @@ static int get_nports(void) ...@@ -289,25 +289,25 @@ static int get_nports(void)
static int get_hc_busid(char *sysfs_mntpath, char *hc_busid) static int get_hc_busid(char *sysfs_mntpath, char *hc_busid)
{ {
struct sysfs_driver *sdriver; struct sysfs_driver *sdriver;
char sdriver_path[SYSFS_PATH_MAX]; char sdriver_path[SYSFS_PATH_MAX];
struct sysfs_device *hc_dev; struct sysfs_device *hc_dev;
struct dlist *hc_devs; struct dlist *hc_devs;
int found = 0; int found = 0;
snprintf(sdriver_path, SYSFS_PATH_MAX, "%s/%s/%s/%s/%s", sysfs_mntpath, snprintf(sdriver_path, SYSFS_PATH_MAX, "%s/%s/%s/%s/%s", sysfs_mntpath,
SYSFS_BUS_NAME, USBIP_VHCI_BUS_TYPE, SYSFS_DRIVERS_NAME, SYSFS_BUS_NAME, USBIP_VHCI_BUS_TYPE, SYSFS_DRIVERS_NAME,
USBIP_VHCI_DRV_NAME); USBIP_VHCI_DRV_NAME);
sdriver = sysfs_open_driver_path(sdriver_path); sdriver = sysfs_open_driver_path(sdriver_path);
if (!sdriver) { if (!sdriver) {
dbg("sysfs_open_driver_path failed: %s", sdriver_path); dbg("sysfs_open_driver_path failed: %s", sdriver_path);
dbg("make sure " USBIP_CORE_MOD_NAME ".ko and " dbg("make sure " USBIP_CORE_MOD_NAME ".ko and "
USBIP_VHCI_DRV_NAME ".ko are loaded!"); USBIP_VHCI_DRV_NAME ".ko are loaded!");
return -1; return -1;
} }
hc_devs = sysfs_get_driver_devices(sdriver); hc_devs = sysfs_get_driver_devices(sdriver);
if (!hc_devs) { if (!hc_devs) {
......
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