new-driver: Shorten dev_list().
authorUwe Hermann <uwe@hermann-uwe.de>
Tue, 6 Aug 2013 11:38:50 +0000 (13:38 +0200)
committerUwe Hermann <uwe@hermann-uwe.de>
Tue, 6 Aug 2013 11:38:50 +0000 (13:38 +0200)
source/drv-api.c
source/drv-protocol.c

index 0ef289d96be76a0841a8cb790f0d785500a8710e..ae594f17947ba6e2a21fdf4976360214dbf44a9e 100644 (file)
@@ -22,7 +22,6 @@
 SR_PRIV struct sr_dev_driver ${lib}_driver_info;
 static struct sr_dev_driver *di = &${lib}_driver_info;
 
-
 static int init(struct sr_context *sr_ctx)
 {
        return std_init(sr_ctx, di, LOG_PREFIX);
@@ -47,11 +46,7 @@ static GSList *scan(GSList *options)
 
 static GSList *dev_list(void)
 {
-       struct drv_context *drvc;
-
-       drvc = di->priv;
-
-       return drvc->instances;
+       return ((struct drv_context *)(di->priv))->instances;
 }
 
 static int dev_clear(void)
index 75ab353e3781ff5e636583acae9684e7000f0150..47ade0d45250e4721b683ba4454cd0c22f0e5d9b 100644 (file)
 
 SR_PRIV int ${lib}_receive_data(int fd, int revents, void *cb_data)
 {
-       (void)fd;
-
        const struct sr_dev_inst *sdi;
        struct dev_context *devc;
 
+       (void)fd;
+
        if (!(sdi = cb_data))
                return TRUE;