linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / ieee1394 / highlevel.c
index 24c1746..734b121 100644 (file)
@@ -101,12 +101,10 @@ void *hpsb_create_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host,
                return NULL;
        }
 
-       hi = kmalloc(sizeof(*hi) + data_size, GFP_ATOMIC);
+       hi = kzalloc(sizeof(*hi) + data_size, GFP_ATOMIC);
        if (!hi)
                return NULL;
 
-       memset(hi, 0, sizeof(*hi) + data_size);
-
        if (data_size) {
                data = hi->data = hi + 1;
                hi->size = data_size;
@@ -173,18 +171,6 @@ void hpsb_set_hostinfo_key(struct hpsb_highlevel *hl, struct hpsb_host *host, un
 }
 
 
-unsigned long hpsb_get_hostinfo_key(struct hpsb_highlevel *hl, struct hpsb_host *host)
-{
-       struct hl_host_info *hi;
-
-       hi = hl_get_hostinfo(hl, host);
-       if (hi)
-               return hi->key;
-
-       return 0;
-}
-
-
 void *hpsb_get_hostinfo_bykey(struct hpsb_highlevel *hl, unsigned long key)
 {
        struct hl_host_info *hi;
@@ -206,26 +192,6 @@ void *hpsb_get_hostinfo_bykey(struct hpsb_highlevel *hl, unsigned long key)
 }
 
 
-struct hpsb_host *hpsb_get_host_bykey(struct hpsb_highlevel *hl, unsigned long key)
-{
-       struct hl_host_info *hi;
-       struct hpsb_host *host = NULL;
-
-       if (!hl)
-               return NULL;
-
-       read_lock(&hl->host_info_lock);
-       list_for_each_entry(hi, &hl->host_info_list, list) {
-               if (hi->key == key) {
-                       host = hi->host;
-                       break;
-               }
-       }
-       read_unlock(&hl->host_info_lock);
-
-       return host;
-}
-
 static int highlevel_for_each_host_reg(struct hpsb_host *host, void *__data)
 {
        struct hpsb_highlevel *hl = __data;
@@ -358,11 +324,9 @@ u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl,
                return retval;
        }
 
-       as = (struct hpsb_address_serve *)
-               kmalloc(sizeof(struct hpsb_address_serve), GFP_KERNEL);
-       if (as == NULL) {
+       as = kmalloc(sizeof(*as), GFP_KERNEL);
+       if (!as)
                return retval;
-       }
 
        INIT_LIST_HEAD(&as->host_list);
        INIT_LIST_HEAD(&as->hl_list);
@@ -415,11 +379,9 @@ int hpsb_register_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host,
                 return 0;
         }
 
-        as = (struct hpsb_address_serve *)
-                kmalloc(sizeof(struct hpsb_address_serve), GFP_KERNEL);
-        if (as == NULL) {
-                return 0;
-        }
+       as = kmalloc(sizeof(*as), GFP_ATOMIC);
+       if (!as)
+               return 0;
 
         INIT_LIST_HEAD(&as->host_list);
         INIT_LIST_HEAD(&as->hl_list);