diff options
author | Peter Huewe <peterhuewe@gmx.de> | 2013-02-15 15:17:24 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-02-15 18:14:30 -0500 |
commit | dc7f5b3594fdb846890192fd75793a791d7ba83b (patch) | |
tree | 5725989529cf6ee493546dee94aff90fc930ef70 | |
parent | 89fe22b6acd394c2c4bcdcbc779ddf0e4730fbc9 (diff) |
staging/ozwpan: Mark read only parameters and structs as const
This patch marks function parameters that are used read only
as well as readonly structs (and corresponding pointers) as const.
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/ozwpan/ozcdev.c | 2 | ||||
-rw-r--r-- | drivers/staging/ozwpan/ozhcd.c | 9 | ||||
-rw-r--r-- | drivers/staging/ozwpan/ozpd.c | 16 | ||||
-rw-r--r-- | drivers/staging/ozwpan/ozpd.h | 4 | ||||
-rw-r--r-- | drivers/staging/ozwpan/ozproto.c | 6 | ||||
-rw-r--r-- | drivers/staging/ozwpan/ozproto.h | 2 | ||||
-rw-r--r-- | drivers/staging/ozwpan/ozusbif.h | 8 | ||||
-rw-r--r-- | drivers/staging/ozwpan/ozusbsvc1.c | 4 |
8 files changed, 26 insertions, 25 deletions
diff --git a/drivers/staging/ozwpan/ozcdev.c b/drivers/staging/ozwpan/ozcdev.c index 89d454e2b8a1..ba15aeb70672 100644 --- a/drivers/staging/ozwpan/ozcdev.c +++ b/drivers/staging/ozwpan/ozcdev.c | |||
@@ -200,7 +200,7 @@ out: | |||
200 | /*------------------------------------------------------------------------------ | 200 | /*------------------------------------------------------------------------------ |
201 | * Context: process | 201 | * Context: process |
202 | */ | 202 | */ |
203 | static int oz_set_active_pd(u8 *addr) | 203 | static int oz_set_active_pd(const u8 *addr) |
204 | { | 204 | { |
205 | int rc = 0; | 205 | int rc = 0; |
206 | struct oz_pd *pd; | 206 | struct oz_pd *pd; |
diff --git a/drivers/staging/ozwpan/ozhcd.c b/drivers/staging/ozwpan/ozhcd.c index ed2addb74f06..8ac26f584fd4 100644 --- a/drivers/staging/ozwpan/ozhcd.c +++ b/drivers/staging/ozwpan/ozhcd.c | |||
@@ -759,7 +759,7 @@ void oz_hcd_pd_reset(void *hpd, void *hport) | |||
759 | /*------------------------------------------------------------------------------ | 759 | /*------------------------------------------------------------------------------ |
760 | * Context: softirq | 760 | * Context: softirq |
761 | */ | 761 | */ |
762 | void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, u8 *desc, | 762 | void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, |
763 | int length, int offset, int total_size) | 763 | int length, int offset, int total_size) |
764 | { | 764 | { |
765 | struct oz_port *port = (struct oz_port *)hport; | 765 | struct oz_port *port = (struct oz_port *)hport; |
@@ -895,7 +895,7 @@ static void oz_hcd_complete_set_interface(struct oz_port *port, struct urb *urb, | |||
895 | /*------------------------------------------------------------------------------ | 895 | /*------------------------------------------------------------------------------ |
896 | * Context: softirq | 896 | * Context: softirq |
897 | */ | 897 | */ |
898 | void oz_hcd_control_cnf(void *hport, u8 req_id, u8 rcode, u8 *data, | 898 | void oz_hcd_control_cnf(void *hport, u8 req_id, u8 rcode, const u8 *data, |
899 | int data_len) | 899 | int data_len) |
900 | { | 900 | { |
901 | struct oz_port *port = (struct oz_port *)hport; | 901 | struct oz_port *port = (struct oz_port *)hport; |
@@ -948,7 +948,8 @@ void oz_hcd_control_cnf(void *hport, u8 req_id, u8 rcode, u8 *data, | |||
948 | /*------------------------------------------------------------------------------ | 948 | /*------------------------------------------------------------------------------ |
949 | * Context: softirq-serialized | 949 | * Context: softirq-serialized |
950 | */ | 950 | */ |
951 | static int oz_hcd_buffer_data(struct oz_endpoint *ep, u8 *data, int data_len) | 951 | static int oz_hcd_buffer_data(struct oz_endpoint *ep, const u8 *data, |
952 | int data_len) | ||
952 | { | 953 | { |
953 | int space; | 954 | int space; |
954 | int copy_len; | 955 | int copy_len; |
@@ -983,7 +984,7 @@ static int oz_hcd_buffer_data(struct oz_endpoint *ep, u8 *data, int data_len) | |||
983 | /*------------------------------------------------------------------------------ | 984 | /*------------------------------------------------------------------------------ |
984 | * Context: softirq-serialized | 985 | * Context: softirq-serialized |
985 | */ | 986 | */ |
986 | void oz_hcd_data_ind(void *hport, u8 endpoint, u8 *data, int data_len) | 987 | void oz_hcd_data_ind(void *hport, u8 endpoint, const u8 *data, int data_len) |
987 | { | 988 | { |
988 | struct oz_port *port = (struct oz_port *)hport; | 989 | struct oz_port *port = (struct oz_port *)hport; |
989 | struct oz_endpoint *ep; | 990 | struct oz_endpoint *ep; |
diff --git a/drivers/staging/ozwpan/ozpd.c b/drivers/staging/ozwpan/ozpd.c index a54f89c68b2e..f8b9da080c4b 100644 --- a/drivers/staging/ozwpan/ozpd.c +++ b/drivers/staging/ozwpan/ozpd.c | |||
@@ -46,7 +46,7 @@ static void oz_def_app_rx(struct oz_pd *pd, struct oz_elt *elt); | |||
46 | static atomic_t g_submitted_isoc = ATOMIC_INIT(0); | 46 | static atomic_t g_submitted_isoc = ATOMIC_INIT(0); |
47 | /* Application handler functions. | 47 | /* Application handler functions. |
48 | */ | 48 | */ |
49 | static struct oz_app_if g_app_if[OZ_APPID_MAX] = { | 49 | static const struct oz_app_if g_app_if[OZ_APPID_MAX] = { |
50 | {oz_usb_init, | 50 | {oz_usb_init, |
51 | oz_usb_term, | 51 | oz_usb_term, |
52 | oz_usb_start, | 52 | oz_usb_start, |
@@ -157,7 +157,7 @@ void oz_pd_put(struct oz_pd *pd) | |||
157 | /*------------------------------------------------------------------------------ | 157 | /*------------------------------------------------------------------------------ |
158 | * Context: softirq-serialized | 158 | * Context: softirq-serialized |
159 | */ | 159 | */ |
160 | struct oz_pd *oz_pd_alloc(u8 *mac_addr) | 160 | struct oz_pd *oz_pd_alloc(const u8 *mac_addr) |
161 | { | 161 | { |
162 | struct oz_pd *pd = kzalloc(sizeof(struct oz_pd), GFP_ATOMIC); | 162 | struct oz_pd *pd = kzalloc(sizeof(struct oz_pd), GFP_ATOMIC); |
163 | if (pd) { | 163 | if (pd) { |
@@ -235,7 +235,7 @@ void oz_pd_destroy(struct oz_pd *pd) | |||
235 | */ | 235 | */ |
236 | int oz_services_start(struct oz_pd *pd, u16 apps, int resume) | 236 | int oz_services_start(struct oz_pd *pd, u16 apps, int resume) |
237 | { | 237 | { |
238 | struct oz_app_if *ai; | 238 | const struct oz_app_if *ai; |
239 | int rc = 0; | 239 | int rc = 0; |
240 | oz_trace("oz_services_start(0x%x) resume(%d)\n", apps, resume); | 240 | oz_trace("oz_services_start(0x%x) resume(%d)\n", apps, resume); |
241 | for (ai = g_app_if; ai < &g_app_if[OZ_APPID_MAX]; ai++) { | 241 | for (ai = g_app_if; ai < &g_app_if[OZ_APPID_MAX]; ai++) { |
@@ -260,7 +260,7 @@ int oz_services_start(struct oz_pd *pd, u16 apps, int resume) | |||
260 | */ | 260 | */ |
261 | void oz_services_stop(struct oz_pd *pd, u16 apps, int pause) | 261 | void oz_services_stop(struct oz_pd *pd, u16 apps, int pause) |
262 | { | 262 | { |
263 | struct oz_app_if *ai; | 263 | const struct oz_app_if *ai; |
264 | oz_trace("oz_stop_services(0x%x) pause(%d)\n", apps, pause); | 264 | oz_trace("oz_stop_services(0x%x) pause(%d)\n", apps, pause); |
265 | for (ai = g_app_if; ai < &g_app_if[OZ_APPID_MAX]; ai++) { | 265 | for (ai = g_app_if; ai < &g_app_if[OZ_APPID_MAX]; ai++) { |
266 | if (apps & (1<<ai->app_id)) { | 266 | if (apps & (1<<ai->app_id)) { |
@@ -281,7 +281,7 @@ void oz_services_stop(struct oz_pd *pd, u16 apps, int pause) | |||
281 | */ | 281 | */ |
282 | void oz_pd_heartbeat(struct oz_pd *pd, u16 apps) | 282 | void oz_pd_heartbeat(struct oz_pd *pd, u16 apps) |
283 | { | 283 | { |
284 | struct oz_app_if *ai; | 284 | const struct oz_app_if *ai; |
285 | int more = 0; | 285 | int more = 0; |
286 | for (ai = g_app_if; ai < &g_app_if[OZ_APPID_MAX]; ai++) { | 286 | for (ai = g_app_if; ai < &g_app_if[OZ_APPID_MAX]; ai++) { |
287 | if (ai->heartbeat && (apps & (1<<ai->app_id))) { | 287 | if (ai->heartbeat && (apps & (1<<ai->app_id))) { |
@@ -774,7 +774,7 @@ static void oz_isoc_destructor(struct sk_buff *skb) | |||
774 | /*------------------------------------------------------------------------------ | 774 | /*------------------------------------------------------------------------------ |
775 | * Context: softirq | 775 | * Context: softirq |
776 | */ | 776 | */ |
777 | int oz_send_isoc_unit(struct oz_pd *pd, u8 ep_num, u8 *data, int len) | 777 | int oz_send_isoc_unit(struct oz_pd *pd, u8 ep_num, const u8 *data, int len) |
778 | { | 778 | { |
779 | struct net_device *dev = pd->net_dev; | 779 | struct net_device *dev = pd->net_dev; |
780 | struct oz_isoc_stream *st; | 780 | struct oz_isoc_stream *st; |
@@ -913,7 +913,7 @@ void oz_apps_term(void) | |||
913 | */ | 913 | */ |
914 | void oz_handle_app_elt(struct oz_pd *pd, u8 app_id, struct oz_elt *elt) | 914 | void oz_handle_app_elt(struct oz_pd *pd, u8 app_id, struct oz_elt *elt) |
915 | { | 915 | { |
916 | struct oz_app_if *ai; | 916 | const struct oz_app_if *ai; |
917 | if (app_id == 0 || app_id > OZ_APPID_MAX) | 917 | if (app_id == 0 || app_id > OZ_APPID_MAX) |
918 | return; | 918 | return; |
919 | ai = &g_app_if[app_id-1]; | 919 | ai = &g_app_if[app_id-1]; |
@@ -925,7 +925,7 @@ void oz_handle_app_elt(struct oz_pd *pd, u8 app_id, struct oz_elt *elt) | |||
925 | void oz_pd_indicate_farewells(struct oz_pd *pd) | 925 | void oz_pd_indicate_farewells(struct oz_pd *pd) |
926 | { | 926 | { |
927 | struct oz_farewell *f; | 927 | struct oz_farewell *f; |
928 | struct oz_app_if *ai = &g_app_if[OZ_APPID_USB-1]; | 928 | const struct oz_app_if *ai = &g_app_if[OZ_APPID_USB-1]; |
929 | while (1) { | 929 | while (1) { |
930 | oz_polling_lock_bh(); | 930 | oz_polling_lock_bh(); |
931 | if (list_empty(&pd->farewell_list)) { | 931 | if (list_empty(&pd->farewell_list)) { |
diff --git a/drivers/staging/ozwpan/ozpd.h b/drivers/staging/ozwpan/ozpd.h index d35b0ea44f67..fbf47cbab8a9 100644 --- a/drivers/staging/ozwpan/ozpd.h +++ b/drivers/staging/ozwpan/ozpd.h | |||
@@ -99,7 +99,7 @@ struct oz_pd { | |||
99 | 99 | ||
100 | #define OZ_MAX_QUEUED_FRAMES 4 | 100 | #define OZ_MAX_QUEUED_FRAMES 4 |
101 | 101 | ||
102 | struct oz_pd *oz_pd_alloc(u8 *mac_addr); | 102 | struct oz_pd *oz_pd_alloc(const u8 *mac_addr); |
103 | void oz_pd_destroy(struct oz_pd *pd); | 103 | void oz_pd_destroy(struct oz_pd *pd); |
104 | void oz_pd_get(struct oz_pd *pd); | 104 | void oz_pd_get(struct oz_pd *pd); |
105 | void oz_pd_put(struct oz_pd *pd); | 105 | void oz_pd_put(struct oz_pd *pd); |
@@ -115,7 +115,7 @@ void oz_send_queued_frames(struct oz_pd *pd, int backlog); | |||
115 | void oz_retire_tx_frames(struct oz_pd *pd, u8 lpn); | 115 | void oz_retire_tx_frames(struct oz_pd *pd, u8 lpn); |
116 | int oz_isoc_stream_create(struct oz_pd *pd, u8 ep_num); | 116 | int oz_isoc_stream_create(struct oz_pd *pd, u8 ep_num); |
117 | int oz_isoc_stream_delete(struct oz_pd *pd, u8 ep_num); | 117 | int oz_isoc_stream_delete(struct oz_pd *pd, u8 ep_num); |
118 | int oz_send_isoc_unit(struct oz_pd *pd, u8 ep_num, u8 *data, int len); | 118 | int oz_send_isoc_unit(struct oz_pd *pd, u8 ep_num, const u8 *data, int len); |
119 | void oz_handle_app_elt(struct oz_pd *pd, u8 app_id, struct oz_elt *elt); | 119 | void oz_handle_app_elt(struct oz_pd *pd, u8 app_id, struct oz_elt *elt); |
120 | void oz_apps_init(void); | 120 | void oz_apps_init(void); |
121 | void oz_apps_term(void); | 121 | void oz_apps_term(void); |
diff --git a/drivers/staging/ozwpan/ozproto.c b/drivers/staging/ozwpan/ozproto.c index 40c283c24d1d..3badf1537adb 100644 --- a/drivers/staging/ozwpan/ozproto.c +++ b/drivers/staging/ozwpan/ozproto.c | |||
@@ -171,7 +171,7 @@ static void pd_set_presleep(struct oz_pd *pd, u8 presleep) | |||
171 | * Context: softirq-serialized | 171 | * Context: softirq-serialized |
172 | */ | 172 | */ |
173 | static struct oz_pd *oz_connect_req(struct oz_pd *cur_pd, struct oz_elt *elt, | 173 | static struct oz_pd *oz_connect_req(struct oz_pd *cur_pd, struct oz_elt *elt, |
174 | u8 *pd_addr, struct net_device *net_dev) | 174 | const u8 *pd_addr, struct net_device *net_dev) |
175 | { | 175 | { |
176 | struct oz_pd *pd; | 176 | struct oz_pd *pd; |
177 | struct oz_elt_connect_req *body = | 177 | struct oz_elt_connect_req *body = |
@@ -306,7 +306,7 @@ done: | |||
306 | * Context: softirq-serialized | 306 | * Context: softirq-serialized |
307 | */ | 307 | */ |
308 | static void oz_add_farewell(struct oz_pd *pd, u8 ep_num, u8 index, | 308 | static void oz_add_farewell(struct oz_pd *pd, u8 ep_num, u8 index, |
309 | u8 *report, u8 len) | 309 | const u8 *report, u8 len) |
310 | { | 310 | { |
311 | struct oz_farewell *f; | 311 | struct oz_farewell *f; |
312 | struct oz_farewell *f2; | 312 | struct oz_farewell *f2; |
@@ -734,7 +734,7 @@ void oz_pd_request_heartbeat(struct oz_pd *pd) | |||
734 | /*------------------------------------------------------------------------------ | 734 | /*------------------------------------------------------------------------------ |
735 | * Context: softirq or process | 735 | * Context: softirq or process |
736 | */ | 736 | */ |
737 | struct oz_pd *oz_pd_find(u8 *mac_addr) | 737 | struct oz_pd *oz_pd_find(const u8 *mac_addr) |
738 | { | 738 | { |
739 | struct oz_pd *pd; | 739 | struct oz_pd *pd; |
740 | struct list_head *e; | 740 | struct list_head *e; |
diff --git a/drivers/staging/ozwpan/ozproto.h b/drivers/staging/ozwpan/ozproto.h index 755a08d0e1ca..93bb4c0172e0 100644 --- a/drivers/staging/ozwpan/ozproto.h +++ b/drivers/staging/ozwpan/ozproto.h | |||
@@ -62,7 +62,7 @@ int oz_protocol_init(char *devs); | |||
62 | void oz_protocol_term(void); | 62 | void oz_protocol_term(void); |
63 | int oz_get_pd_list(struct oz_mac_addr *addr, int max_count); | 63 | int oz_get_pd_list(struct oz_mac_addr *addr, int max_count); |
64 | void oz_app_enable(int app_id, int enable); | 64 | void oz_app_enable(int app_id, int enable); |
65 | struct oz_pd *oz_pd_find(u8 *mac_addr); | 65 | struct oz_pd *oz_pd_find(const u8 *mac_addr); |
66 | void oz_binding_add(char *net_dev); | 66 | void oz_binding_add(char *net_dev); |
67 | void oz_binding_remove(char *net_dev); | 67 | void oz_binding_remove(char *net_dev); |
68 | void oz_timer_add(struct oz_pd *pd, int type, unsigned long due_time, | 68 | void oz_timer_add(struct oz_pd *pd, int type, unsigned long due_time, |
diff --git a/drivers/staging/ozwpan/ozusbif.h b/drivers/staging/ozwpan/ozusbif.h index 3acf5980d7cc..8531438d7586 100644 --- a/drivers/staging/ozwpan/ozusbif.h +++ b/drivers/staging/ozwpan/ozusbif.h | |||
@@ -21,7 +21,7 @@ int oz_usb_stream_delete(void *hpd, u8 ep_num); | |||
21 | /* Request functions. | 21 | /* Request functions. |
22 | */ | 22 | */ |
23 | int oz_usb_control_req(void *hpd, u8 req_id, struct usb_ctrlrequest *setup, | 23 | int oz_usb_control_req(void *hpd, u8 req_id, struct usb_ctrlrequest *setup, |
24 | u8 *data, int data_len); | 24 | const u8 *data, int data_len); |
25 | int oz_usb_get_desc_req(void *hpd, u8 req_id, u8 req_type, u8 desc_type, | 25 | int oz_usb_get_desc_req(void *hpd, u8 req_id, u8 req_type, u8 desc_type, |
26 | u8 index, u16 windex, int offset, int len); | 26 | u8 index, u16 windex, int offset, int len); |
27 | int oz_usb_send_isoc(void *hpd, u8 ep_num, struct urb *urb); | 27 | int oz_usb_send_isoc(void *hpd, u8 ep_num, struct urb *urb); |
@@ -30,13 +30,13 @@ void oz_usb_request_heartbeat(void *hpd); | |||
30 | /* Confirmation functions. | 30 | /* Confirmation functions. |
31 | */ | 31 | */ |
32 | void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, | 32 | void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, |
33 | u8 *desc, int length, int offset, int total_size); | 33 | const u8 *desc, int length, int offset, int total_size); |
34 | void oz_hcd_control_cnf(void *hport, u8 req_id, u8 rcode, | 34 | void oz_hcd_control_cnf(void *hport, u8 req_id, u8 rcode, |
35 | u8 *data, int data_len); | 35 | const u8 *data, int data_len); |
36 | 36 | ||
37 | /* Indication functions. | 37 | /* Indication functions. |
38 | */ | 38 | */ |
39 | void oz_hcd_data_ind(void *hport, u8 endpoint, u8 *data, int data_len); | 39 | void oz_hcd_data_ind(void *hport, u8 endpoint, const u8 *data, int data_len); |
40 | 40 | ||
41 | int oz_hcd_heartbeat(void *hport); | 41 | int oz_hcd_heartbeat(void *hport); |
42 | 42 | ||
diff --git a/drivers/staging/ozwpan/ozusbsvc1.c b/drivers/staging/ozwpan/ozusbsvc1.c index c54614d78965..4e4b650fee3f 100644 --- a/drivers/staging/ozwpan/ozusbsvc1.c +++ b/drivers/staging/ozwpan/ozusbsvc1.c | |||
@@ -157,7 +157,7 @@ static int oz_usb_set_clear_feature_req(void *hpd, u8 req_id, u8 type, | |||
157 | * Context: tasklet | 157 | * Context: tasklet |
158 | */ | 158 | */ |
159 | static int oz_usb_vendor_class_req(void *hpd, u8 req_id, u8 req_type, | 159 | static int oz_usb_vendor_class_req(void *hpd, u8 req_id, u8 req_type, |
160 | u8 request, __le16 value, __le16 index, u8 *data, int data_len) | 160 | u8 request, __le16 value, __le16 index, const u8 *data, int data_len) |
161 | { | 161 | { |
162 | struct oz_usb_ctx *usb_ctx = (struct oz_usb_ctx *)hpd; | 162 | struct oz_usb_ctx *usb_ctx = (struct oz_usb_ctx *)hpd; |
163 | struct oz_pd *pd = usb_ctx->pd; | 163 | struct oz_pd *pd = usb_ctx->pd; |
@@ -184,7 +184,7 @@ static int oz_usb_vendor_class_req(void *hpd, u8 req_id, u8 req_type, | |||
184 | * Context: tasklet | 184 | * Context: tasklet |
185 | */ | 185 | */ |
186 | int oz_usb_control_req(void *hpd, u8 req_id, struct usb_ctrlrequest *setup, | 186 | int oz_usb_control_req(void *hpd, u8 req_id, struct usb_ctrlrequest *setup, |
187 | u8 *data, int data_len) | 187 | const u8 *data, int data_len) |
188 | { | 188 | { |
189 | unsigned wvalue = le16_to_cpu(setup->wValue); | 189 | unsigned wvalue = le16_to_cpu(setup->wValue); |
190 | unsigned windex = le16_to_cpu(setup->wIndex); | 190 | unsigned windex = le16_to_cpu(setup->wIndex); |