]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/rds/info.c
Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
[karo-tx-linux.git] / net / rds / info.c
index c45c4173a44d44eb9ceee633e0cec271f2182411..4fdf1b6e84fff6fd25b2040544245921332b9f89 100644 (file)
@@ -76,7 +76,7 @@ void rds_info_register_func(int optname, rds_info_func func)
        BUG_ON(optname < RDS_INFO_FIRST || optname > RDS_INFO_LAST);
 
        spin_lock(&rds_info_lock);
-       BUG_ON(rds_info_funcs[offset] != NULL);
+       BUG_ON(rds_info_funcs[offset]);
        rds_info_funcs[offset] = func;
        spin_unlock(&rds_info_lock);
 }
@@ -102,7 +102,7 @@ EXPORT_SYMBOL_GPL(rds_info_deregister_func);
  */
 void rds_info_iter_unmap(struct rds_info_iterator *iter)
 {
-       if (iter->addr != NULL) {
+       if (iter->addr) {
                kunmap_atomic(iter->addr, KM_USER0);
                iter->addr = NULL;
        }
@@ -117,7 +117,7 @@ void rds_info_copy(struct rds_info_iterator *iter, void *data,
        unsigned long this;
 
        while (bytes) {
-               if (iter->addr == NULL)
+               if (!iter->addr)
                        iter->addr = kmap_atomic(*iter->pages, KM_USER0);
 
                this = min(bytes, PAGE_SIZE - iter->offset);
@@ -188,7 +188,7 @@ int rds_info_getsockopt(struct socket *sock, int optname, char __user *optval,
                        >> PAGE_SHIFT;
 
        pages = kmalloc(nr_pages * sizeof(struct page *), GFP_KERNEL);
-       if (pages == NULL) {
+       if (!pages) {
                ret = -ENOMEM;
                goto out;
        }
@@ -206,7 +206,7 @@ int rds_info_getsockopt(struct socket *sock, int optname, char __user *optval,
 
 call_func:
        func = rds_info_funcs[optname - RDS_INFO_FIRST];
-       if (func == NULL) {
+       if (!func) {
                ret = -ENOPROTOOPT;
                goto out;
        }
@@ -234,7 +234,7 @@ call_func:
                ret = -EFAULT;
 
 out:
-       for (i = 0; pages != NULL && i < nr_pages; i++)
+       for (i = 0; pages && i < nr_pages; i++)
                put_page(pages[i]);
        kfree(pages);