* set_cpus_allowed_ptr
@ 2010-03-26 10:03 Peter Zijlstra
2010-03-26 11:22 ` set_cpus_allowed_ptr Julia Lawall
2010-03-26 16:38 ` set_cpus_allowed_ptr Julia Lawall
0 siblings, 2 replies; 4+ messages in thread
From: Peter Zijlstra @ 2010-03-26 10:03 UTC (permalink / raw)
To: Ingo Molnar, tglx, Oleg Nesterov, Julia Lawall; +Cc: LKML
Hi,
Would it make sense to clean up the set_cpus_allowed() vs
set_cpus_allowed_ptr() mess using the semantic patch tool?
I guess it would be three patches:
1) converting the current remaining set_cpus_allowed() users into
set_cpus_allowed_ptr().
2) remove set_cpus_allowed().
3) rename set_cpus_allowed_ptr() to set_cpus_allowed()
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: set_cpus_allowed_ptr
2010-03-26 10:03 set_cpus_allowed_ptr Peter Zijlstra
@ 2010-03-26 11:22 ` Julia Lawall
2010-03-26 11:52 ` set_cpus_allowed_ptr Peter Zijlstra
2010-03-26 16:38 ` set_cpus_allowed_ptr Julia Lawall
1 sibling, 1 reply; 4+ messages in thread
From: Julia Lawall @ 2010-03-26 11:22 UTC (permalink / raw)
To: Peter Zijlstra; +Cc: Ingo Molnar, tglx, Oleg Nesterov, LKML
On Fri, 26 Mar 2010, Peter Zijlstra wrote:
> Hi,
>
> Would it make sense to clean up the set_cpus_allowed() vs
> set_cpus_allowed_ptr() mess using the semantic patch tool?
>
> I guess it would be three patches:
> 1) converting the current remaining set_cpus_allowed() users into
> set_cpus_allowed_ptr().
> 2) remove set_cpus_allowed().
> 3) rename set_cpus_allowed_ptr() to set_cpus_allowed()
Perhaps a subtlety is that set_cpus_allowed is creating a new variable,
whose address it sends to set_cpus_allowed_ptr?
julia
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: set_cpus_allowed_ptr
2010-03-26 11:22 ` set_cpus_allowed_ptr Julia Lawall
@ 2010-03-26 11:52 ` Peter Zijlstra
0 siblings, 0 replies; 4+ messages in thread
From: Peter Zijlstra @ 2010-03-26 11:52 UTC (permalink / raw)
To: Julia Lawall; +Cc: Ingo Molnar, tglx, Oleg Nesterov, LKML
On Fri, 2010-03-26 at 12:22 +0100, Julia Lawall wrote:
> On Fri, 26 Mar 2010, Peter Zijlstra wrote:
>
> > Hi,
> >
> > Would it make sense to clean up the set_cpus_allowed() vs
> > set_cpus_allowed_ptr() mess using the semantic patch tool?
> >
> > I guess it would be three patches:
> > 1) converting the current remaining set_cpus_allowed() users into
> > set_cpus_allowed_ptr().
> > 2) remove set_cpus_allowed().
> > 3) rename set_cpus_allowed_ptr() to set_cpus_allowed()
>
> Perhaps a subtlety is that set_cpus_allowed is creating a new variable,
> whose address it sends to set_cpus_allowed_ptr?
Yes it does that, but I don't think that actually matters,
set_cpus_allowed_ptr()'s arg is const, so making that temporary copy
shouldn't have any side effects.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: set_cpus_allowed_ptr
2010-03-26 10:03 set_cpus_allowed_ptr Peter Zijlstra
2010-03-26 11:22 ` set_cpus_allowed_ptr Julia Lawall
@ 2010-03-26 16:38 ` Julia Lawall
1 sibling, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2010-03-26 16:38 UTC (permalink / raw)
To: Peter Zijlstra; +Cc: Ingo Molnar, tglx, Oleg Nesterov, LKML
I tried the following semantic patch:
@@
expression E1,E2;
@@
- set_cpus_allowed(E1, cpumask_of_cpu(E2))
+ set_cpus_allowed_ptr(E1, cpumask_of(E2))
@@
expression E;
identifier I;
@@
- set_cpus_allowed(E, I)
+ set_cpus_allowed_ptr(E, &I)
@@
@@
+BAD(
set_cpus_allowed(...)
+ )
I didn't get any occurrences of BAD in the output, so there seem to be
only calls to cpumask_of_cpu and identifiers. Looking at the result of
grepping for set_cpus_allowed suggested the same. Am I missing anything?
julia
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-03-26 16:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-26 10:03 set_cpus_allowed_ptr Peter Zijlstra
2010-03-26 11:22 ` set_cpus_allowed_ptr Julia Lawall
2010-03-26 11:52 ` set_cpus_allowed_ptr Peter Zijlstra
2010-03-26 16:38 ` set_cpus_allowed_ptr Julia Lawall
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox