提交 776ed179 编写于 作者: P Pascal COMBES 提交者: Greg Kroah-Hartman

Staging: crystalhd: Fix alignement in crystalhd_lnx.c

Signed-off-by: NPascal COMBES <pascom@orange.fr>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 f1552cbd
...@@ -112,7 +112,7 @@ static void chd_dec_free_iodata(struct crystalhd_adp *adp, ...@@ -112,7 +112,7 @@ static void chd_dec_free_iodata(struct crystalhd_adp *adp,
} }
static inline int crystalhd_user_data(void __user *ud, void *dr, static inline int crystalhd_user_data(void __user *ud, void *dr,
int size, int set) int size, int set)
{ {
int rc; int rc;
...@@ -135,7 +135,8 @@ static inline int crystalhd_user_data(void __user *ud, void *dr, ...@@ -135,7 +135,8 @@ static inline int crystalhd_user_data(void __user *ud, void *dr,
} }
static int chd_dec_fetch_cdata(struct crystalhd_adp *adp, static int chd_dec_fetch_cdata(struct crystalhd_adp *adp,
struct crystalhd_ioctl_data *io, uint32_t m_sz, unsigned long ua) struct crystalhd_ioctl_data *io, uint32_t m_sz,
unsigned long ua)
{ {
unsigned long ua_off; unsigned long ua_off;
int rc = 0; int rc = 0;
...@@ -154,7 +155,7 @@ static int chd_dec_fetch_cdata(struct crystalhd_adp *adp, ...@@ -154,7 +155,7 @@ static int chd_dec_fetch_cdata(struct crystalhd_adp *adp,
io->add_cdata_sz = m_sz; io->add_cdata_sz = m_sz;
ua_off = ua + sizeof(io->udata); ua_off = ua + sizeof(io->udata);
rc = crystalhd_user_data((void __user *)ua_off, io->add_cdata, rc = crystalhd_user_data((void __user *)ua_off, io->add_cdata,
io->add_cdata_sz, 0); io->add_cdata_sz, 0);
if (rc) { if (rc) {
BCMLOG_ERR("failed to pull add_cdata sz:%x ua_off:%x\n", BCMLOG_ERR("failed to pull add_cdata sz:%x ua_off:%x\n",
io->add_cdata_sz, (unsigned int)ua_off); io->add_cdata_sz, (unsigned int)ua_off);
...@@ -167,7 +168,8 @@ static int chd_dec_fetch_cdata(struct crystalhd_adp *adp, ...@@ -167,7 +168,8 @@ static int chd_dec_fetch_cdata(struct crystalhd_adp *adp,
} }
static int chd_dec_release_cdata(struct crystalhd_adp *adp, static int chd_dec_release_cdata(struct crystalhd_adp *adp,
struct crystalhd_ioctl_data *io, unsigned long ua) struct crystalhd_ioctl_data *io,
unsigned long ua)
{ {
unsigned long ua_off; unsigned long ua_off;
int rc; int rc;
...@@ -180,7 +182,7 @@ static int chd_dec_release_cdata(struct crystalhd_adp *adp, ...@@ -180,7 +182,7 @@ static int chd_dec_release_cdata(struct crystalhd_adp *adp,
if (io->cmd != BCM_IOC_FW_DOWNLOAD) { if (io->cmd != BCM_IOC_FW_DOWNLOAD) {
ua_off = ua + sizeof(io->udata); ua_off = ua + sizeof(io->udata);
rc = crystalhd_user_data((void __user *)ua_off, io->add_cdata, rc = crystalhd_user_data((void __user *)ua_off, io->add_cdata,
io->add_cdata_sz, 1); io->add_cdata_sz, 1);
if (rc) { if (rc) {
BCMLOG_ERR( BCMLOG_ERR(
"failed to push add_cdata sz:%x ua_off:%x\n", "failed to push add_cdata sz:%x ua_off:%x\n",
...@@ -210,7 +212,7 @@ static int chd_dec_proc_user_data(struct crystalhd_adp *adp, ...@@ -210,7 +212,7 @@ static int chd_dec_proc_user_data(struct crystalhd_adp *adp,
} }
rc = crystalhd_user_data((void __user *)ua, &io->udata, rc = crystalhd_user_data((void __user *)ua, &io->udata,
sizeof(io->udata), set); sizeof(io->udata), set);
if (rc) { if (rc) {
BCMLOG_ERR("failed to %s iodata\n", (set ? "set" : "get")); BCMLOG_ERR("failed to %s iodata\n", (set ? "set" : "get"));
return rc; return rc;
...@@ -382,7 +384,7 @@ static int chd_dec_init_chdev(struct crystalhd_adp *adp) ...@@ -382,7 +384,7 @@ static int chd_dec_init_chdev(struct crystalhd_adp *adp)
} }
dev = device_create(crystalhd_class, NULL, dev = device_create(crystalhd_class, NULL,
MKDEV(adp->chd_dec_major, 0), NULL, "crystalhd"); MKDEV(adp->chd_dec_major, 0), NULL, "crystalhd");
if (IS_ERR(dev)) { if (IS_ERR(dev)) {
rc = PTR_ERR(dev); rc = PTR_ERR(dev);
BCMLOG_ERR("failed to create device\n"); BCMLOG_ERR("failed to create device\n");
...@@ -398,7 +400,7 @@ static int chd_dec_init_chdev(struct crystalhd_adp *adp) ...@@ -398,7 +400,7 @@ static int chd_dec_init_chdev(struct crystalhd_adp *adp)
/* Allocate general purpose ioctl pool. */ /* Allocate general purpose ioctl pool. */
for (i = 0; i < CHD_IODATA_POOL_SZ; i++) { for (i = 0; i < CHD_IODATA_POOL_SZ; i++) {
temp = kzalloc(sizeof(struct crystalhd_ioctl_data), temp = kzalloc(sizeof(struct crystalhd_ioctl_data),
GFP_KERNEL); GFP_KERNEL);
if (!temp) { if (!temp) {
BCMLOG_ERR("ioctl data pool kzalloc failed\n"); BCMLOG_ERR("ioctl data pool kzalloc failed\n");
rc = -ENOMEM; rc = -ENOMEM;
...@@ -549,9 +551,9 @@ static int chd_dec_pci_probe(struct pci_dev *pdev, ...@@ -549,9 +551,9 @@ static int chd_dec_pci_probe(struct pci_dev *pdev,
enum BC_STATUS sts = BC_STS_SUCCESS; enum BC_STATUS sts = BC_STS_SUCCESS;
BCMLOG(BCMLOG_DBG, BCMLOG(BCMLOG_DBG,
"PCI_INFO: Vendor:0x%04x Device:0x%04x s_vendor:0x%04x s_device: 0x%04x\n", "PCI_INFO: Vendor:0x%04x Device:0x%04x s_vendor:0x%04x s_device: 0x%04x\n",
pdev->vendor, pdev->device, pdev->subsystem_vendor, pdev->vendor, pdev->device, pdev->subsystem_vendor,
pdev->subsystem_device); pdev->subsystem_device);
pinfo = kzalloc(sizeof(struct crystalhd_adp), GFP_KERNEL); pinfo = kzalloc(sizeof(struct crystalhd_adp), GFP_KERNEL);
if (!pinfo) { if (!pinfo) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册