]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/block/zram/zram_drv.c
drivers/block/zram/zram_drv.c: convert to using memset_l
[mirror_ubuntu-bionic-kernel.git] / drivers / block / zram / zram_drv.c
index 4063f3f59f4f35ffde8f95dc162df35c754d93bd..2981c27d3aae316fedd267c6c79d76eb68a9395e 100644 (file)
@@ -175,20 +175,11 @@ static inline void update_used_max(struct zram *zram,
        } while (old_max != cur_max);
 }
 
-static inline void zram_fill_page(char *ptr, unsigned long len,
+static inline void zram_fill_page(void *ptr, unsigned long len,
                                        unsigned long value)
 {
-       int i;
-       unsigned long *page = (unsigned long *)ptr;
-
        WARN_ON_ONCE(!IS_ALIGNED(len, sizeof(unsigned long)));
-
-       if (likely(value == 0)) {
-               memset(ptr, 0, len);
-       } else {
-               for (i = 0; i < len / sizeof(*page); i++)
-                       page[i] = value;
-       }
+       memset_l(ptr, value, len / sizeof(unsigned long));
 }
 
 static bool page_same_filled(void *ptr, unsigned long *element)