lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1437919294-3833-1-git-send-email-geliangtang@163.com>
Date:	Sun, 26 Jul 2015 22:01:34 +0800
From:	Geliang Tang <geliangtang@....com>
To:	abbotti@....co.uk, hsweeten@...ionengravers.com,
	gregkh@...uxfoundation.org
Cc:	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
	Geliang Tang <geliangtang@....com>
Subject: [PATCH] staging: comedi: make "unsigned int __force *" shorter

Use macro "uip" instead of "unsigned int __force *", like "vuip" in
arch/alpha/include/asm/core_cia.h.

Signed-off-by: Geliang Tang <geliangtang@....com>
---
 drivers/staging/comedi/comedi_compat32.c | 3 +--
 drivers/staging/comedi/comedi_compat32.h | 2 ++
 drivers/staging/comedi/comedi_fops.c     | 4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/comedi_compat32.c b/drivers/staging/comedi/comedi_compat32.c
index f356386..adaef03 100644
--- a/drivers/staging/comedi/comedi_compat32.c
+++ b/drivers/staging/comedi/comedi_compat32.c
@@ -202,8 +202,7 @@ static int get_compat_cmd(struct comedi_cmd __user *cmd,
 	err |= __get_user(temp.uint, &cmd32->stop_arg);
 	err |= __put_user(temp.uint, &cmd->stop_arg);
 	err |= __get_user(temp.uptr, &cmd32->chanlist);
-	err |= __put_user((unsigned int __force *)compat_ptr(temp.uptr),
-			&cmd->chanlist);
+	err |= __put_user((uip)compat_ptr(temp.uptr), &cmd->chanlist);
 	err |= __get_user(temp.uint, &cmd32->chanlist_len);
 	err |= __put_user(temp.uint, &cmd->chanlist_len);
 	err |= __get_user(temp.uptr, &cmd32->data);
diff --git a/drivers/staging/comedi/comedi_compat32.h b/drivers/staging/comedi/comedi_compat32.h
index 5ce77f3..8446273 100644
--- a/drivers/staging/comedi/comedi_compat32.h
+++ b/drivers/staging/comedi/comedi_compat32.h
@@ -33,4 +33,6 @@ long comedi_compat_ioctl(struct file *, unsigned int cmd, unsigned long arg);
 
 #endif /* CONFIG_COMPAT */
 
+#define uip	unsigned int __force *
+
 #endif /* _COMEDI_COMPAT32_H */
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 2ba9cdb..d37f4c5 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -1714,7 +1714,7 @@ static int do_cmd_ioctl(struct comedi_device *dev,
 		dev_dbg(dev->class_dev, "test returned %d\n", ret);
 		cmd = async->cmd;
 		/* restore chanlist pointer before copying back */
-		cmd.chanlist = (unsigned int __force *)user_chanlist;
+		cmd.chanlist = (uip)user_chanlist;
 		cmd.data = NULL;
 		if (copy_to_user(arg, &cmd, sizeof(cmd))) {
 			dev_dbg(dev->class_dev, "fault writing cmd\n");
@@ -1800,7 +1800,7 @@ static int do_cmdtest_ioctl(struct comedi_device *dev,
 	kfree(cmd.chanlist);	/* free kernel copy of user chanlist */
 
 	/* restore chanlist pointer before copying back */
-	cmd.chanlist = (unsigned int __force *)user_chanlist;
+	cmd.chanlist = (uip)user_chanlist;
 
 	if (copy_to_user(arg, &cmd, sizeof(cmd))) {
 		dev_dbg(dev->class_dev, "bad cmd address\n");
-- 
2.3.4


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ