All of lore.kernel.org
 help / color / mirror / Atom feed
* [v2 PATCH 1/1] booke/wdt: some ioctls do not return values properly
@ 2012-08-07  1:59 ` Tiejun Chen
  0 siblings, 0 replies; 6+ messages in thread
From: Tiejun Chen @ 2012-08-07  1:59 UTC (permalink / raw)
  To: B04825; +Cc: galak, linuxppc-dev, linux-watchdog

Fix some booke wdt ioctls return value error.

Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
---
 drivers/watchdog/booke_wdt.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c
index 3fe82d0..5b06d31 100644
--- a/drivers/watchdog/booke_wdt.c
+++ b/drivers/watchdog/booke_wdt.c
@@ -166,18 +166,17 @@ static long booke_wdt_ioctl(struct file *file,
 
 	switch (cmd) {
 	case WDIOC_GETSUPPORT:
-		if (copy_to_user((void *)arg, &ident, sizeof(ident)))
-			return -EFAULT;
+		return copy_to_user(p, &ident, sizeof(ident)) ? -EFAULT : 0;
 	case WDIOC_GETSTATUS:
 		return put_user(0, p);
 	case WDIOC_GETBOOTSTATUS:
 		/* XXX: something is clearing TSR */
 		tmp = mfspr(SPRN_TSR) & TSR_WRS(3);
 		/* returns CARDRESET if last reset was caused by the WDT */
-		return (tmp ? WDIOF_CARDRESET : 0);
+		return put_user((tmp ? WDIOF_CARDRESET : 0), p);
 	case WDIOC_SETOPTIONS:
 		if (get_user(tmp, p))
-			return -EINVAL;
+			return -EFAULT;
 		if (tmp == WDIOS_ENABLECARD) {
 			booke_wdt_ping();
 			break;
-- 
1.5.6


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [v2 PATCH 1/1] booke/wdt: some ioctls do not return values properly
@ 2012-08-07  1:59 ` Tiejun Chen
  0 siblings, 0 replies; 6+ messages in thread
From: Tiejun Chen @ 2012-08-07  1:59 UTC (permalink / raw)
  To: B04825; +Cc: linuxppc-dev, linux-watchdog

Fix some booke wdt ioctls return value error.

Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
---
 drivers/watchdog/booke_wdt.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c
index 3fe82d0..5b06d31 100644
--- a/drivers/watchdog/booke_wdt.c
+++ b/drivers/watchdog/booke_wdt.c
@@ -166,18 +166,17 @@ static long booke_wdt_ioctl(struct file *file,
 
 	switch (cmd) {
 	case WDIOC_GETSUPPORT:
-		if (copy_to_user((void *)arg, &ident, sizeof(ident)))
-			return -EFAULT;
+		return copy_to_user(p, &ident, sizeof(ident)) ? -EFAULT : 0;
 	case WDIOC_GETSTATUS:
 		return put_user(0, p);
 	case WDIOC_GETBOOTSTATUS:
 		/* XXX: something is clearing TSR */
 		tmp = mfspr(SPRN_TSR) & TSR_WRS(3);
 		/* returns CARDRESET if last reset was caused by the WDT */
-		return (tmp ? WDIOF_CARDRESET : 0);
+		return put_user((tmp ? WDIOF_CARDRESET : 0), p);
 	case WDIOC_SETOPTIONS:
 		if (get_user(tmp, p))
-			return -EINVAL;
+			return -EFAULT;
 		if (tmp == WDIOS_ENABLECARD) {
 			booke_wdt_ping();
 			break;
-- 
1.5.6

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [v2 PATCH 1/1] booke/wdt: some ioctls do not return values properly
  2012-08-07  1:59 ` Tiejun Chen
@ 2012-08-07  2:20   ` Tabi Timur-B04825
  -1 siblings, 0 replies; 6+ messages in thread
From: Tabi Timur-B04825 @ 2012-08-07  2:20 UTC (permalink / raw)
  To: Tiejun Chen; +Cc: galak, linuxppc-dev, linux-watchdog

On Mon, Aug 6, 2012 at 8:59 PM, Tiejun Chen <tiejun.chen@windriver.com> wrote:
> Fix some booke wdt ioctls return value error.
>
> Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>

It's not the greatest patch description, but it'll do.

Acked-by: Timur Tabi <timur@freescale.com>

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [v2 PATCH 1/1] booke/wdt: some ioctls do not return values properly
@ 2012-08-07  2:20   ` Tabi Timur-B04825
  0 siblings, 0 replies; 6+ messages in thread
From: Tabi Timur-B04825 @ 2012-08-07  2:20 UTC (permalink / raw)
  To: Tiejun Chen; +Cc: linuxppc-dev, linux-watchdog

On Mon, Aug 6, 2012 at 8:59 PM, Tiejun Chen <tiejun.chen@windriver.com> wro=
te:
> Fix some booke wdt ioctls return value error.
>
> Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>

It's not the greatest patch description, but it'll do.

Acked-by: Timur Tabi <timur@freescale.com>

--=20
Timur Tabi
Linux kernel developer at Freescale=

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [v2 PATCH 1/1] booke/wdt: some ioctls do not return values properly
  2012-08-07  1:59 ` Tiejun Chen
@ 2012-08-17 14:07   ` Kumar Gala
  -1 siblings, 0 replies; 6+ messages in thread
From: Kumar Gala @ 2012-08-17 14:07 UTC (permalink / raw)
  To: Tiejun Chen; +Cc: B04825, linuxppc-dev, linux-watchdog


On Aug 6, 2012, at 8:59 PM, Tiejun Chen wrote:

> Fix some booke wdt ioctls return value error.
> 
> Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
> ---
> drivers/watchdog/booke_wdt.c |    7 +++----
> 1 files changed, 3 insertions(+), 4 deletions(-)

applied to merge

- k

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [v2 PATCH 1/1] booke/wdt: some ioctls do not return values properly
@ 2012-08-17 14:07   ` Kumar Gala
  0 siblings, 0 replies; 6+ messages in thread
From: Kumar Gala @ 2012-08-17 14:07 UTC (permalink / raw)
  To: Tiejun Chen; +Cc: linuxppc-dev, B04825, linux-watchdog


On Aug 6, 2012, at 8:59 PM, Tiejun Chen wrote:

> Fix some booke wdt ioctls return value error.
> 
> Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
> ---
> drivers/watchdog/booke_wdt.c |    7 +++----
> 1 files changed, 3 insertions(+), 4 deletions(-)

applied to merge

- k

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-08-17 14:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-07  1:59 [v2 PATCH 1/1] booke/wdt: some ioctls do not return values properly Tiejun Chen
2012-08-07  1:59 ` Tiejun Chen
2012-08-07  2:20 ` Tabi Timur-B04825
2012-08-07  2:20   ` Tabi Timur-B04825
2012-08-17 14:07 ` Kumar Gala
2012-08-17 14:07   ` Kumar Gala

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.