intel_pmc_ipc: Fix compiler casting warnings

Avoid casting variables to different sizes due to different
compilers and settings.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: qipeng.zha <qipeng.zha@intel.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
This commit is contained in:
qipeng.zha 2015-07-07 00:04:45 +08:00 committed by Darren Hart
parent d770e558e2
commit b78fb51b68

View File

@ -96,18 +96,18 @@ static struct intel_pmc_ipc_dev {
struct completion cmd_complete;
/* The following PMC BARs share the same ACPI device with the IPC */
void *acpi_io_base;
resource_size_t acpi_io_base;
int acpi_io_size;
struct platform_device *tco_dev;
/* gcr */
void *gcr_base;
resource_size_t gcr_base;
int gcr_size;
/* punit */
void *punit_base;
resource_size_t punit_base;
int punit_size;
void *punit_base2;
resource_size_t punit_base2;
int punit_size2;
struct platform_device *punit_dev;
} ipcdev;
@ -480,11 +480,11 @@ static int ipc_create_punit_device(void)
pdev->dev.parent = ipcdev.dev;
res = punit_res;
res->start = (resource_size_t)ipcdev.punit_base;
res->start = ipcdev.punit_base;
res->end = res->start + ipcdev.punit_size - 1;
res = punit_res + PUNIT_RESOURCE_INTER;
res->start = (resource_size_t)ipcdev.punit_base2;
res->start = ipcdev.punit_base2;
res->end = res->start + ipcdev.punit_size2 - 1;
ret = platform_device_add_resources(pdev, punit_res,
@ -522,15 +522,15 @@ static int ipc_create_tco_device(void)
pdev->dev.parent = ipcdev.dev;
res = tco_res + TCO_RESOURCE_ACPI_IO;
res->start = (resource_size_t)ipcdev.acpi_io_base + TCO_BASE_OFFSET;
res->start = ipcdev.acpi_io_base + TCO_BASE_OFFSET;
res->end = res->start + TCO_REGS_SIZE - 1;
res = tco_res + TCO_RESOURCE_SMI_EN_IO;
res->start = (resource_size_t)ipcdev.acpi_io_base + SMI_EN_OFFSET;
res->start = ipcdev.acpi_io_base + SMI_EN_OFFSET;
res->end = res->start + SMI_EN_SIZE - 1;
res = tco_res + TCO_RESOURCE_GCR_MEM;
res->start = (resource_size_t)ipcdev.gcr_base;
res->start = ipcdev.gcr_base;
res->end = res->start + ipcdev.gcr_size - 1;
ret = platform_device_add_resources(pdev, tco_res, ARRAY_SIZE(tco_res));
@ -589,7 +589,7 @@ static int ipc_plat_get_res(struct platform_device *pdev)
return -ENXIO;
}
size = resource_size(res);
ipcdev.acpi_io_base = (void *)res->start;
ipcdev.acpi_io_base = res->start;
ipcdev.acpi_io_size = size;
dev_info(&pdev->dev, "io res: %llx %x\n",
(long long)res->start, (int)resource_size(res));
@ -601,7 +601,7 @@ static int ipc_plat_get_res(struct platform_device *pdev)
return -ENXIO;
}
size = resource_size(res);
ipcdev.punit_base = (void *)res->start;
ipcdev.punit_base = res->start;
ipcdev.punit_size = size;
dev_info(&pdev->dev, "punit data res: %llx %x\n",
(long long)res->start, (int)resource_size(res));
@ -613,7 +613,7 @@ static int ipc_plat_get_res(struct platform_device *pdev)
return -ENXIO;
}
size = resource_size(res);
ipcdev.punit_base2 = (void *)res->start;
ipcdev.punit_base2 = res->start;
ipcdev.punit_size2 = size;
dev_info(&pdev->dev, "punit interface res: %llx %x\n",
(long long)res->start, (int)resource_size(res));
@ -637,7 +637,7 @@ static int ipc_plat_get_res(struct platform_device *pdev)
}
ipcdev.ipc_base = addr;
ipcdev.gcr_base = (void *)(res->start + size);
ipcdev.gcr_base = res->start + size;
ipcdev.gcr_size = PLAT_RESOURCE_GCR_SIZE;
dev_info(&pdev->dev, "ipc res: %llx %x\n",
(long long)res->start, (int)resource_size(res));