Skip to content

Commit a50cc8d

Browse files
andy-shevaegl
authored andcommitted
EDAC, pnd2: Replace custom definition by one from sizes.h
The sizes.h provides a set of common size definitions, use it. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
1 parent 6807434 commit a50cc8d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/edac/pnd2_edac.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <linux/delay.h>
2525
#include <linux/edac.h>
2626
#include <linux/mmzone.h>
27+
#include <linux/sizes.h>
2728
#include <linux/smp.h>
2829
#include <linux/bitmap.h>
2930
#include <linux/math64.h>
@@ -109,7 +110,6 @@ static struct mem_ctl_info *pnd2_mci;
109110
#define MOT_CHAN_INTLV_BIT_1SLC_2CH 12
110111
#define MOT_CHAN_INTLV_BIT_2SLC_2CH 13
111112
#define SELECTOR_DISABLED (-1)
112-
#define _4GB (1ul << 32)
113113

114114
#define PMI_ADDRESS_WIDTH 31
115115
#define PND_MAX_PHYS_BIT 39
@@ -587,7 +587,7 @@ static int get_registers(void)
587587
/* Get a contiguous memory address (remove the MMIO gap) */
588588
static u64 remove_mmio_gap(u64 sys)
589589
{
590-
return (sys < _4GB) ? sys : sys - (_4GB - top_lm);
590+
return (sys < SZ_4G) ? sys : sys - (SZ_4G - top_lm);
591591
}
592592

593593
/* Squeeze out one address bit, shift upper part down to fill gap */
@@ -643,7 +643,7 @@ static int sys2pmi(const u64 addr, u32 *pmiidx, u64 *pmiaddr, char *msg)
643643

644644
/* Give up if address is out of range, or in MMIO gap */
645645
if (addr >= (1ul << PND_MAX_PHYS_BIT) ||
646-
(addr >= top_lm && addr < _4GB) || addr >= top_hm) {
646+
(addr >= top_lm && addr < SZ_4G) || addr >= top_hm) {
647647
snprintf(msg, PND2_MSG_SIZE, "Error address 0x%llx is not DRAM", addr);
648648
return -EINVAL;
649649
}

0 commit comments

Comments
 (0)