futex: fixup get_futex_key() for private futexes
[sfrench/cifs-2.6.git] / net / ipv4 / cipso_ipv4.c
index 8cd357f41283504f98e55d7a3ffe2d9090dbcd38..2c0e4572cc9042e76fca92f5c08303d1489f513c 100644 (file)
@@ -338,7 +338,7 @@ static int cipso_v4_cache_check(const unsigned char *key,
                return -ENOENT;
 
        hash = cipso_v4_map_cache_hash(key, key_len);
-       bkt = hash & (CIPSO_V4_CACHE_BUCKETBITS - 1);
+       bkt = hash & (CIPSO_V4_CACHE_BUCKETS - 1);
        spin_lock_bh(&cipso_v4_cache[bkt].lock);
        list_for_each_entry(entry, &cipso_v4_cache[bkt].list, list) {
                if (entry->hash == hash &&
@@ -417,7 +417,7 @@ int cipso_v4_cache_add(const struct sk_buff *skb,
        atomic_inc(&secattr->cache->refcount);
        entry->lsm_data = secattr->cache;
 
-       bkt = entry->hash & (CIPSO_V4_CACHE_BUCKETBITS - 1);
+       bkt = entry->hash & (CIPSO_V4_CACHE_BUCKETS - 1);
        spin_lock_bh(&cipso_v4_cache[bkt].lock);
        if (cipso_v4_cache[bkt].size < cipso_v4_cache_bucketsize) {
                list_add(&entry->list, &cipso_v4_cache[bkt].list);
@@ -983,7 +983,7 @@ static int cipso_v4_map_cat_enum_valid(const struct cipso_v4_doi *doi_def,
                return -EFAULT;
 
        for (iter = 0; iter < enumcat_len; iter += 2) {
-               cat = ntohs(get_unaligned((__be16 *)&enumcat[iter]));
+               cat = get_unaligned_be16(&enumcat[iter]);
                if (cat <= cat_prev)
                        return -EFAULT;
                cat_prev = cat;
@@ -1052,7 +1052,7 @@ static int cipso_v4_map_cat_enum_ntoh(const struct cipso_v4_doi *doi_def,
 
        for (iter = 0; iter < net_cat_len; iter += 2) {
                ret_val = netlbl_secattr_catmap_setbit(secattr->attr.mls.cat,
-                               ntohs(get_unaligned((__be16 *)&net_cat[iter])),
+                               get_unaligned_be16(&net_cat[iter]),
                                GFP_ATOMIC);
                if (ret_val != 0)
                        return ret_val;
@@ -1086,10 +1086,9 @@ static int cipso_v4_map_cat_rng_valid(const struct cipso_v4_doi *doi_def,
                return -EFAULT;
 
        for (iter = 0; iter < rngcat_len; iter += 4) {
-               cat_high = ntohs(get_unaligned((__be16 *)&rngcat[iter]));
+               cat_high = get_unaligned_be16(&rngcat[iter]);
                if ((iter + 4) <= rngcat_len)
-                       cat_low = ntohs(
-                               get_unaligned((__be16 *)&rngcat[iter + 2]));
+                       cat_low = get_unaligned_be16(&rngcat[iter + 2]);
                else
                        cat_low = 0;
 
@@ -1188,10 +1187,9 @@ static int cipso_v4_map_cat_rng_ntoh(const struct cipso_v4_doi *doi_def,
        u16 cat_high;
 
        for (net_iter = 0; net_iter < net_cat_len; net_iter += 4) {
-               cat_high = ntohs(get_unaligned((__be16 *)&net_cat[net_iter]));
+               cat_high = get_unaligned_be16(&net_cat[net_iter]);
                if ((net_iter + 4) <= net_cat_len)
-                       cat_low = ntohs(
-                             get_unaligned((__be16 *)&net_cat[net_iter + 2]));
+                       cat_low = get_unaligned_be16(&net_cat[net_iter + 2]);
                else
                        cat_low = 0;
 
@@ -1562,7 +1560,7 @@ int cipso_v4_validate(unsigned char **option)
        }
 
        rcu_read_lock();
-       doi_def = cipso_v4_doi_search(ntohl(get_unaligned((__be32 *)&opt[2])));
+       doi_def = cipso_v4_doi_search(get_unaligned_be32(&opt[2]));
        if (doi_def == NULL) {
                err_offset = 2;
                goto validate_return_locked;
@@ -1800,7 +1798,6 @@ int cipso_v4_sock_setattr(struct sock *sk,
        }
        memcpy(opt->__data, buf, buf_len);
        opt->optlen = opt_len;
-       opt->is_data = 1;
        opt->cipso = sizeof(struct iphdr);
        kfree(buf);
        buf = NULL;
@@ -1844,7 +1841,7 @@ static int cipso_v4_getattr(const unsigned char *cipso,
        if (cipso_v4_cache_check(cipso, cipso[1], secattr) == 0)
                return 0;
 
-       doi = ntohl(get_unaligned((__be32 *)&cipso[2]));
+       doi = get_unaligned_be32(&cipso[2]);
        rcu_read_lock();
        doi_def = cipso_v4_doi_search(doi);
        if (doi_def == NULL)