* [LTP] [PATCH 19/21] nfs/nfsstress/make_tree: Fix erroneous cast to void pointer
@ 2012-01-03 13:24 Markos Chandras
2012-01-03 19:31 ` Garrett Cooper
2012-01-03 20:35 ` Mike Frysinger
0 siblings, 2 replies; 4+ messages in thread
From: Markos Chandras @ 2012-01-03 13:24 UTC (permalink / raw)
To: ltp-list
[-- Attachment #1: Type: text/plain, Size: 49 bytes --]
Hi, please review the attached patch
--
markos
[-- Attachment #2: 0019-nfs-nfsstress-make_tree-Fix-erroneous-cast-to-void-p.patch --]
[-- Type: text/plain, Size: 1099 bytes --]
From 3c4f375b923af0ddc64257afbecf1dd2c8efef17 Mon Sep 17 00:00:00 2001
From: Markos Chandras <markos.chandras@imgtec.com>
Date: Thu, 22 Dec 2011 15:17:34 +0000
Subject: [PATCH 19/21] nfs/nfsstress/make_tree: Fix erroneous cast to void pointer
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
---
testcases/network/nfs/nfsstress/make_tree.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/testcases/network/nfs/nfsstress/make_tree.c b/testcases/network/nfs/nfsstress/make_tree.c
index 02d0304..c51e75e 100644
--- a/testcases/network/nfs/nfsstress/make_tree.c
+++ b/testcases/network/nfs/nfsstress/make_tree.c
@@ -202,7 +202,7 @@
#define PTHREAD_EXIT(val) do {\
exit_val = val; \
dprt("pid[%d]: exiting with %d\n", gettid(),exit_val); \
- pthread_exit((void *)exit_val); \
+ pthread_exit((void *)&exit_val); \
} while (0)
#define OPT_MISSING(prog, opt) do{\
@@ -846,4 +846,4 @@ main(int argc, /* number of input parameters */
}
}
return(0);
-}
\ No newline at end of file
+}
--
1.7.1
[-- Attachment #3: Type: text/plain, Size: 355 bytes --]
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
[-- Attachment #4: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH 19/21] nfs/nfsstress/make_tree: Fix erroneous cast to void pointer
2012-01-03 13:24 [LTP] [PATCH 19/21] nfs/nfsstress/make_tree: Fix erroneous cast to void pointer Markos Chandras
@ 2012-01-03 19:31 ` Garrett Cooper
2012-01-03 20:35 ` Mike Frysinger
1 sibling, 0 replies; 4+ messages in thread
From: Garrett Cooper @ 2012-01-03 19:31 UTC (permalink / raw)
To: Markos Chandras; +Cc: ltp-list
On Tue, Jan 3, 2012 at 5:24 AM, Markos Chandras
<Markos.Chandras@imgtec.com> wrote:
> Hi, please review the attached patch
Reviewed-by: Garrett Cooper <yanegomi@gmail.com>
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH 19/21] nfs/nfsstress/make_tree: Fix erroneous cast to void pointer
2012-01-03 13:24 [LTP] [PATCH 19/21] nfs/nfsstress/make_tree: Fix erroneous cast to void pointer Markos Chandras
2012-01-03 19:31 ` Garrett Cooper
@ 2012-01-03 20:35 ` Mike Frysinger
2012-01-04 15:08 ` Cyril Hrubis
1 sibling, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2012-01-03 20:35 UTC (permalink / raw)
To: ltp-list; +Cc: Markos Chandras
[-- Attachment #1.1: Type: Text/Plain, Size: 410 bytes --]
On Tuesday 03 January 2012 08:24:34 Markos Chandras wrote:
> Hi, please review the attached patch
NAK: this is how the pthread API works. you aren't passing a value by
reference. they used a pointer rather than "long" or something as it's harder
to fit a pointer into an integer rather than the other way around.
if you're getting a build time warning, try casting it to uintptr_t instead
-mike
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 355 bytes --]
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
[-- Attachment #3: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH 19/21] nfs/nfsstress/make_tree: Fix erroneous cast to void pointer
2012-01-03 20:35 ` Mike Frysinger
@ 2012-01-04 15:08 ` Cyril Hrubis
0 siblings, 0 replies; 4+ messages in thread
From: Cyril Hrubis @ 2012-01-04 15:08 UTC (permalink / raw)
To: Mike Frysinger; +Cc: ltp-list, Markos Chandras
Hi!
> NAK: this is how the pthread API works. you aren't passing a value by
> reference. they used a pointer rather than "long" or something as it's harder
> to fit a pointer into an integer rather than the other way around.
>
> if you're getting a build time warning, try casting it to uintptr_t instead
Pretty much, you would pass a pointer to thread stack as a return value
with this patch which is wrong for several reasons (and the stackframe
woudn't most likely there when somebody else would touch this value).
The whole macro actually seems to be broken. It assigns local variable
thread_exit which is defined as volatile and it looks to me like
somebody had no clue how volatie works (at least at first sight).
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-01-04 14:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-03 13:24 [LTP] [PATCH 19/21] nfs/nfsstress/make_tree: Fix erroneous cast to void pointer Markos Chandras
2012-01-03 19:31 ` Garrett Cooper
2012-01-03 20:35 ` Mike Frysinger
2012-01-04 15:08 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox