bflsc only need one xlinkstr
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
diff --git a/driver-bflsc.c b/driver-bflsc.c
index 328d464..3eee5de 100644
--- a/driver-bflsc.c
+++ b/driver-bflsc.c
@@ -304,19 +304,24 @@ static const char *blank = "";
struct device_drv bflsc_drv;
-static void bflsc_applog(struct cgpu_info *bflsc, int dev, enum usb_cmds cmd, int amount, int err)
+static void xlinkstr(char *xlink, int dev, struct bflsc_info *sc_info)
{
- struct bflsc_info *sc_info = (struct bflsc_info *)(bflsc->device_file);
- char xlink[17];
-
if (dev > 0)
- sprintf(xlink, "x-%d", dev);
+ sprintf(xlink, " x-%d", dev);
else {
- if (sc_info->sc_count > 0)
+ if (sc_info->sc_count > 1)
strcpy(xlink, " master");
else
- xlink[0] = '\0';
+ *xlink = '\0';
}
+}
+
+static void bflsc_applog(struct cgpu_info *bflsc, int dev, enum usb_cmds cmd, int amount, int err)
+{
+ struct bflsc_info *sc_info = (struct bflsc_info *)(bflsc->device_file);
+ char xlink[17];
+
+ xlinkstr(xlink, dev, sc_info);
usb_applog(bflsc, cmd, xlink, amount, err);
}
@@ -450,18 +455,6 @@ static void freebreakdown(int *count, char **firstname, char ***fields)
*fields = NULL;
}
-static void xlinkstr(char *xlink, int dev, struct bflsc_info *sc_info)
-{
- if (dev > 0)
- sprintf(xlink, " x-%d", dev);
- else {
- if (sc_info->sc_count > 0)
- strcpy(xlink, " mast");
- else
- *xlink = '\0';
- }
-}
-
static int write_to_dev(struct cgpu_info *bflsc, int dev, char *buf, int buflen, int *amount, enum usb_cmds cmd)
{
struct DataForwardToChain data;