staging: sm750fb: replace custom MB(x) macro with appropriate SZ_xM
authorMike Rapoport <mike.rapoport@gmail.com>
Tue, 22 Sep 2015 09:01:17 +0000 (12:01 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 02:16:30 +0000 (04:16 +0200)
Use SZ_xM defined in linux/sizes.h instead of custom MB(x) macro

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/sm750fb/ddk750_chip.c
drivers/staging/sm750fb/sm750_hw.c

index 5e6798ea9468af13a15bdbf366a6b61387c9144e..c9adc387f574960a8b81b90656e700113cedfa9b 100644 (file)
@@ -1,3 +1,5 @@
+#include <linux/sizes.h>
+
 #include "ddk750_help.h"
 #include "ddk750_reg.h"
 #include "ddk750_chip.h"
@@ -226,7 +228,7 @@ unsigned int ddk750_getVMSize(void)
 
        /* sm750le only use 64 mb memory*/
        if (getChipType() == SM750LE)
-               return MB(64);
+               return SZ_64M;
 
        /* for 750,always use power mode0*/
        reg = PEEK32(MODE0_GATE);
@@ -237,13 +239,13 @@ unsigned int ddk750_getVMSize(void)
        reg = FIELD_GET(PEEK32(MISC_CTRL), MISC_CTRL, LOCALMEM_SIZE);
        switch (reg) {
        case MISC_CTRL_LOCALMEM_SIZE_8M:
-               data = MB(8);  break; /* 8  Mega byte */
+               data = SZ_8M;  break; /* 8  Mega byte */
        case MISC_CTRL_LOCALMEM_SIZE_16M:
-               data = MB(16); break; /* 16 Mega byte */
+               data = SZ_16M; break; /* 16 Mega byte */
        case MISC_CTRL_LOCALMEM_SIZE_32M:
-               data = MB(32); break; /* 32 Mega byte */
+               data = SZ_32M; break; /* 32 Mega byte */
        case MISC_CTRL_LOCALMEM_SIZE_64M:
-               data = MB(64); break; /* 64 Mega byte */
+               data = SZ_64M; break; /* 64 Mega byte */
        default:
                data = 0;
                break;
index 48b49440df37d2214a1c517a1ece7f8d67a8bae9..cdb7161dc72551a2baebe895fe11d1b115657229 100644 (file)
@@ -18,6 +18,7 @@
 #endif
 #include <linux/platform_device.h>
 #include <linux/screen_info.h>
+#include <linux/sizes.h>
 
 #include "sm750.h"
 #include "sm750_hw.h"
@@ -34,7 +35,7 @@ int hw_sm750_map(struct lynx_share *share, struct pci_dev *pdev)
        ret = 0;
 
        share->vidreg_start  = pci_resource_start(pdev, 1);
-       share->vidreg_size = MB(2);
+       share->vidreg_size = SZ_2M;
 
        pr_info("mmio phyAddr = %lx\n", share->vidreg_start);