From: Uwe Hermann Date: Sun, 11 Nov 2012 08:30:42 +0000 (+0100) Subject: All drivers: Drop unneeded comments. X-Git-Tag: dsupstream~561 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=64d33dc28e0e815cade56feb65f26a3d36421a96;p=libsigrok.git All drivers: Drop unneeded comments. --- diff --git a/device.c b/device.c index 740ad507..0050e97e 100644 --- a/device.c +++ b/device.c @@ -268,7 +268,6 @@ SR_PRIV struct sr_usb_dev_inst *sr_usb_dev_inst_new(uint8_t bus, /** @private */ SR_PRIV void sr_usb_dev_inst_free(struct sr_usb_dev_inst *usb) { - /* Avoid compiler warnings. */ (void)usb; /* Nothing to do for this device instance type. */ diff --git a/hardware/alsa/alsa.c b/hardware/alsa/alsa.c index c0f4ccaa..2dca5c33 100644 --- a/hardware/alsa/alsa.c +++ b/hardware/alsa/alsa.c @@ -71,7 +71,6 @@ static int hw_init(const char *devinfo) struct sr_dev_inst *sdi; struct context *ctx; - /* Avoid compiler warnings. */ (void)devinfo; if (!(ctx = g_try_malloc0(sizeof(struct context)))) { @@ -389,7 +388,6 @@ static int hw_dev_acquisition_start(int dev_index, void *cb_data) /* TODO: This stops acquisition on ALL devices, ignoring dev_index. */ static int hw_dev_acquisition_stop(int dev_index, void *cb_data) { - /* Avoid compiler warnings. */ (void)dev_index; (void)cb_data; diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index c637d469..c014e3a1 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -458,6 +458,7 @@ static GSList *hw_scan(GSList *options) int ret, i; (void)options; + drvc = adi->priv; devices = NULL; clear_instances(); @@ -1419,7 +1420,6 @@ static int hw_dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data) struct dev_context *devc; uint8_t modestatus; - /* Avoid compiler warnings. */ (void)cb_data; sr_source_remove(0); diff --git a/hardware/demo/demo.c b/hardware/demo/demo.c index 7cde3308..8a8b2cf4 100644 --- a/hardware/demo/demo.c +++ b/hardware/demo/demo.c @@ -170,6 +170,7 @@ static GSList *hw_scan(GSList *options) int i; (void)options; + drvc = ddi->priv; devices = NULL; @@ -204,7 +205,6 @@ static GSList *hw_dev_list(void) static int hw_dev_open(struct sr_dev_inst *sdi) { - /* Avoid compiler warnings. */ (void)sdi; /* Nothing needed so far. */ @@ -214,7 +214,6 @@ static int hw_dev_open(struct sr_dev_inst *sdi) static int hw_dev_close(struct sr_dev_inst *sdi) { - /* Avoid compiler warnings. */ (void)sdi; /* Nothing needed so far. */ @@ -231,7 +230,6 @@ static int hw_cleanup(void) static int hw_info_get(int info_id, const void **data, const struct sr_dev_inst *sdi) { - (void)sdi; switch (info_id) { @@ -404,7 +402,6 @@ static int receive_data(int fd, int revents, void *cb_data) unsigned char c[BUFSIZE]; gsize z; - /* Avoid compiler warnings. */ (void)fd; (void)revents; @@ -522,7 +519,6 @@ static int hw_dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data) { struct dev_context *devc; - /* Avoid compiler warnings. */ (void)cb_data; devc = sdi->priv; diff --git a/hardware/fluke-dmm/fluke.c b/hardware/fluke-dmm/fluke.c index dadcc495..33f7bb65 100644 --- a/hardware/fluke-dmm/fluke.c +++ b/hardware/fluke-dmm/fluke.c @@ -36,6 +36,7 @@ static struct sr_datafeed_analog *handle_qm_v1(const struct sr_dev_inst *sdi, gboolean is_oor; (void)sdi; + if (strcmp(tokens[0], "QM")) return NULL; @@ -158,6 +159,7 @@ static struct sr_datafeed_analog *handle_qm_v2(const struct sr_dev_inst *sdi, char *eptr; (void)sdi; + fvalue = strtof(tokens[0], &eptr); if (fvalue == 0.0 && eptr == tokens[0]) { sr_err("Invalid float."); diff --git a/hardware/fx2lafw/command.c b/hardware/fx2lafw/command.c index 5a085bb6..a1c2109c 100644 --- a/hardware/fx2lafw/command.c +++ b/hardware/fx2lafw/command.c @@ -18,7 +18,6 @@ */ #include - #include "fx2lafw.h" #include "command.h" #include "libsigrok.h" diff --git a/hardware/fx2lafw/fx2lafw.c b/hardware/fx2lafw/fx2lafw.c index 89eb01ee..b3df9731 100644 --- a/hardware/fx2lafw/fx2lafw.c +++ b/hardware/fx2lafw/fx2lafw.c @@ -431,8 +431,8 @@ static GSList *hw_scan(GSList *options) libusb_device **devlist; int devcnt, num_logic_probes, ret, i, j; - /* Avoid compiler warnings. */ (void)options; + drvc = fdi->priv; /* This scan always invalidates any previous scans. */ @@ -686,7 +686,6 @@ static int receive_data(int fd, int revents, void *cb_data) { struct timeval tv; - /* Avoid compiler warnings. */ (void)fd; (void)revents; (void)cb_data; @@ -1028,8 +1027,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi, /* TODO: This stops acquisition on ALL devices, ignoring dev_index. */ static int hw_dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data) { - - /* Avoid compiler warnings. */ (void)cb_data; abort_acquisition(sdi->priv); diff --git a/hardware/genericdmm/api.c b/hardware/genericdmm/api.c index 67b23620..9a86ff01 100644 --- a/hardware/genericdmm/api.c +++ b/hardware/genericdmm/api.c @@ -559,7 +559,6 @@ static int hw_dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data) { struct sr_datafeed_packet packet; - /* Avoid compiler warnings. */ (void)sdi; sr_dbg("Stopping acquisition."); diff --git a/hardware/link-mso19/link-mso19.c b/hardware/link-mso19/link-mso19.c index 3da352f8..d1e2fb00 100644 --- a/hardware/link-mso19/link-mso19.c +++ b/hardware/link-mso19/link-mso19.c @@ -403,7 +403,6 @@ static int mso_parse_serial(const char *iSerial, const char *iProduct, static int hw_init(void) { - /* Nothing to do. */ return SR_OK; @@ -694,7 +693,6 @@ static int receive_data(int fd, int revents, void *cb_data) double analog_out[1024]; size_t i, s; - /* Avoid compiler warnings. */ (void)revents; s = serial_read(fd, in, sizeof(in)); @@ -830,7 +828,6 @@ static int hw_dev_acquisition_stop(int dev_index, void *cb_data) { struct sr_datafeed_packet packet; - /* Avoid compiler warnings. */ (void)dev_index; packet.type = SR_DF_END; diff --git a/hardware/zeroplus-logic-cube/zeroplus.c b/hardware/zeroplus-logic-cube/zeroplus.c index 3145d767..cb83d11d 100644 --- a/hardware/zeroplus-logic-cube/zeroplus.c +++ b/hardware/zeroplus-logic-cube/zeroplus.c @@ -334,6 +334,7 @@ static GSList *hw_scan(GSList *options) int ret, devcnt, i, j; (void)options; + drvc = zdi->priv; devices = NULL; diff --git a/input/binary.c b/input/binary.c index 8348ea82..2c747511 100644 --- a/input/binary.c +++ b/input/binary.c @@ -35,7 +35,6 @@ struct context { static int format_match(const char *filename) { - /* suppress compiler warning */ (void)filename; /* this module will handle anything you throw at it */ diff --git a/output/analog.c b/output/analog.c index 7090d0fe..5952613c 100644 --- a/output/analog.c +++ b/output/analog.c @@ -186,6 +186,7 @@ static GString *receive(struct sr_output *o, const struct sr_dev_inst *sdi, int i, j; (void)sdi; + if (!o || !o->sdi) return NULL; ctx = o->internal; diff --git a/output/binary.c b/output/binary.c index ef41dab4..003b6ce0 100644 --- a/output/binary.c +++ b/output/binary.c @@ -29,7 +29,6 @@ static int data(struct sr_output *o, const uint8_t *data_in, { uint8_t *outbuf; - /* Prevent compiler warnings. */ (void)o; if (!data_in) { diff --git a/session_driver.c b/session_driver.c index e73411d5..777a81a5 100644 --- a/session_driver.c +++ b/session_driver.c @@ -59,7 +59,6 @@ static int receive_data(int fd, int revents, void *cb_data) void *buf; int ret, got_data; - /* Avoid compiler warnings. */ (void)fd; (void)revents;