]> git.ozlabs.org Git - petitboot/commitdiff
Make client ops constant
authorGeoff Levand <geoffrey.levand@am.sony.com>
Thu, 22 Jan 2009 00:27:01 +0000 (16:27 -0800)
committerJeremy Kerr <jk@ozlabs.org>
Sun, 1 Feb 2009 00:54:25 +0000 (11:54 +1100)
Make the discover_client_ops args read-only.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
ui/common/discover-client.c
ui/common/discover-client.h
ui/test/pb-test.c

index 112fa65782e88e910e2ba3c11a03e1bb637b6ed2..d30498cdf48b4e8007d4e24a9515c326d4e2d902 100644 (file)
@@ -30,7 +30,8 @@ static int discover_client_destructor(void *arg)
        return 0;
 }
 
        return 0;
 }
 
-struct discover_client* discover_client_init(struct discover_client_ops *ops)
+struct discover_client* discover_client_init(
+       const struct discover_client_ops *ops)
 {
        struct discover_client *client;
        struct sockaddr_un addr;
 {
        struct discover_client *client;
        struct sockaddr_un addr;
@@ -64,7 +65,7 @@ out_err:
        return NULL;
 }
 
        return NULL;
 }
 
-int discover_client_get_fd(struct discover_client *client)
+int discover_client_get_fd(const struct discover_client *client)
 {
        return client->fd;
 }
 {
        return client->fd;
 }
index bc2294aa20b84d557558a25335bca1a9abaf9eb7..132da02c30a3187fe65234a2a8fc485593a06e90 100644 (file)
@@ -13,14 +13,15 @@ struct discover_client;
  */
 
 struct discover_client_ops {
  */
 
 struct discover_client_ops {
-       int (*add_device)(struct device *device, void *arg);
-       void (*remove_device)(char *dev_id, void *arg);
+       int (*add_device)(const struct device *device, void *arg);
+       void (*remove_device)(const char *dev_id, void *arg);
        void *cb_arg;
 };
 
        void *cb_arg;
 };
 
-struct discover_client *discover_client_init(struct discover_client_ops *ops);
+struct discover_client *discover_client_init(
+       const struct discover_client_ops *ops);
 
 
-int discover_client_get_fd(struct discover_client *client);
+int discover_client_get_fd(const struct discover_client *client);
 
 void discover_client_destroy(struct discover_client *client);
 
 
 void discover_client_destroy(struct discover_client *client);
 
index b6ff627566b9ce59fa6ebf8d45071ba5fa10e5b2..551c9b070f8eaaa475eb6cd7b3be8bf23f07c0db 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "ui/common/discover-client.h"
 
 
 #include "ui/common/discover-client.h"
 
-static int print_device_add(struct device *device,
+static int print_device_add(const struct device *device,
        void __attribute__((unused)) *arg)
 {
        struct boot_option *opt;
        void __attribute__((unused)) *arg)
 {
        struct boot_option *opt;
@@ -28,7 +28,8 @@ static int print_device_add(struct device *device,
        return 0;
 }
 
        return 0;
 }
 
-static void print_device_remove(char *dev_id, void __attribute__((unused)) *arg)
+static void print_device_remove(const char *dev_id,
+       void __attribute__((unused)) *arg)
 {
        printf("removed device:\n");
        printf("\tid:   %s\n", dev_id);
 {
        printf("removed device:\n");
        printf("\tid:   %s\n", dev_id);