Skip to content

Commit

Permalink
intel_pmc_ipc: Fix compiler casting warnings
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
qipeng.zha authored and Darren Hart committed Jul 6, 2015
1 parent d770e55 commit b78fb51
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions drivers/platform/x86/intel_pmc_ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand All @@ -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));
Expand All @@ -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));
Expand All @@ -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));
Expand Down

0 comments on commit b78fb51

Please sign in to comment.