Re: [PATCH] semaphore: Resolve some shadow warnings
On Tue, Sep 02, 2014 at 09:16:23PM +, Rustad, Mark D wrote: > > It would, but then it would be unclear as to what units the timeout > was in. I have no other objection to timeout, I was just trying to > preserve the meaning in the existing overloaded name. The "n" to me > suggests a number and, if anything, number of jiffies conveys a more > precise meaning than simply jiffies did. Use a comment for the unit. If you look you'll find tons of 'timeout' variables that measure in jiffies (and others of course). -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] semaphore: Resolve some shadow warnings
On Tue, Sep 02, 2014 at 09:16:23PM +, Rustad, Mark D wrote: It would, but then it would be unclear as to what units the timeout was in. I have no other objection to timeout, I was just trying to preserve the meaning in the existing overloaded name. The n to me suggests a number and, if anything, number of jiffies conveys a more precise meaning than simply jiffies did. Use a comment for the unit. If you look you'll find tons of 'timeout' variables that measure in jiffies (and others of course). -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] semaphore: Resolve some shadow warnings
On Sep 1, 2014, at 4:41 PM, Jeff Kirsher wrote: > On Mon, 2014-09-01 at 14:02 +0200, Peter Zijlstra wrote: >> On Thu, Aug 28, 2014 at 05:19:26AM -0700, Jeff Kirsher wrote: >>> From: Mark Rustad >>> >>> Resolve some shadow warnings resulting from using the name >>> jiffies, which is a well-known global. This is not a problem >>> of course, but it could be a trap for someone copying and >>> pasting code, and it just makes W=2 a little cleaner. >>> >>> Signed-off-by: Mark Rustad >>> Signed-off-by: Jeff Kirsher >> >> Why isn't Mark sending this email? > > Mark sent me several patches like this, for me to push upstream. So, I > am making sure the appropriate owner is the receives the patch versus > blindly sending to LKML. > >> >>> --- >>> kernel/locking/semaphore.c | 12 ++-- >>> 1 file changed, 6 insertions(+), 6 deletions(-) >>> >>> diff --git a/kernel/locking/semaphore.c b/kernel/locking/semaphore.c >>> index 6815171..7782dbc 100644 >>> --- a/kernel/locking/semaphore.c >>> +++ b/kernel/locking/semaphore.c >>> @@ -36,7 +36,7 @@ >>> static noinline void __down(struct semaphore *sem); >>> static noinline int __down_interruptible(struct semaphore *sem); >>> static noinline int __down_killable(struct semaphore *sem); >>> -static noinline int __down_timeout(struct semaphore *sem, long jiffies); >>> +static noinline int __down_timeout(struct semaphore *sem, long njiffies); >>> static noinline void __up(struct semaphore *sem); >> >> So what's wrong with calling it "timeout" instead? That's what most >> other sites do. > > Timeout would work as well to resolve the shadow warnings. It would, but then it would be unclear as to what units the timeout was in. I have no other objection to timeout, I was just trying to preserve the meaning in the existing overloaded name. The "n" to me suggests a number and, if anything, number of jiffies conveys a more precise meaning than simply jiffies did. -- Mark Rustad, Networking Division, Intel Corporation signature.asc Description: Message signed with OpenPGP using GPGMail
Re: [PATCH] semaphore: Resolve some shadow warnings
On Sep 1, 2014, at 4:41 PM, Jeff Kirsher jeffrey.t.kirs...@intel.com wrote: On Mon, 2014-09-01 at 14:02 +0200, Peter Zijlstra wrote: On Thu, Aug 28, 2014 at 05:19:26AM -0700, Jeff Kirsher wrote: From: Mark Rustad mark.d.rus...@intel.com Resolve some shadow warnings resulting from using the name jiffies, which is a well-known global. This is not a problem of course, but it could be a trap for someone copying and pasting code, and it just makes W=2 a little cleaner. Signed-off-by: Mark Rustad mark.d.rus...@intel.com Signed-off-by: Jeff Kirsher jeffrey.t.kirs...@intel.com Why isn't Mark sending this email? Mark sent me several patches like this, for me to push upstream. So, I am making sure the appropriate owner is the receives the patch versus blindly sending to LKML. --- kernel/locking/semaphore.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/locking/semaphore.c b/kernel/locking/semaphore.c index 6815171..7782dbc 100644 --- a/kernel/locking/semaphore.c +++ b/kernel/locking/semaphore.c @@ -36,7 +36,7 @@ static noinline void __down(struct semaphore *sem); static noinline int __down_interruptible(struct semaphore *sem); static noinline int __down_killable(struct semaphore *sem); -static noinline int __down_timeout(struct semaphore *sem, long jiffies); +static noinline int __down_timeout(struct semaphore *sem, long njiffies); static noinline void __up(struct semaphore *sem); So what's wrong with calling it timeout instead? That's what most other sites do. Timeout would work as well to resolve the shadow warnings. It would, but then it would be unclear as to what units the timeout was in. I have no other objection to timeout, I was just trying to preserve the meaning in the existing overloaded name. The n to me suggests a number and, if anything, number of jiffies conveys a more precise meaning than simply jiffies did. -- Mark Rustad, Networking Division, Intel Corporation signature.asc Description: Message signed with OpenPGP using GPGMail
Re: [PATCH] semaphore: Resolve some shadow warnings
On Mon, 2014-09-01 at 14:02 +0200, Peter Zijlstra wrote: > On Thu, Aug 28, 2014 at 05:19:26AM -0700, Jeff Kirsher wrote: > > From: Mark Rustad > > > > Resolve some shadow warnings resulting from using the name > > jiffies, which is a well-known global. This is not a problem > > of course, but it could be a trap for someone copying and > > pasting code, and it just makes W=2 a little cleaner. > > > > Signed-off-by: Mark Rustad > > Signed-off-by: Jeff Kirsher > > Why isn't Mark sending this email? Mark sent me several patches like this, for me to push upstream. So, I am making sure the appropriate owner is the receives the patch versus blindly sending to LKML. > > > --- > > kernel/locking/semaphore.c | 12 ++-- > > 1 file changed, 6 insertions(+), 6 deletions(-) > > > > diff --git a/kernel/locking/semaphore.c b/kernel/locking/semaphore.c > > index 6815171..7782dbc 100644 > > --- a/kernel/locking/semaphore.c > > +++ b/kernel/locking/semaphore.c > > @@ -36,7 +36,7 @@ > > static noinline void __down(struct semaphore *sem); > > static noinline int __down_interruptible(struct semaphore *sem); > > static noinline int __down_killable(struct semaphore *sem); > > -static noinline int __down_timeout(struct semaphore *sem, long jiffies); > > +static noinline int __down_timeout(struct semaphore *sem, long njiffies); > > static noinline void __up(struct semaphore *sem); > > So what's wrong with calling it "timeout" instead? That's what most > other sites do. Timeout would work as well to resolve the shadow warnings. signature.asc Description: This is a digitally signed message part
Re: [PATCH] semaphore: Resolve some shadow warnings
On Thu, Aug 28, 2014 at 05:19:26AM -0700, Jeff Kirsher wrote: > From: Mark Rustad > > Resolve some shadow warnings resulting from using the name > jiffies, which is a well-known global. This is not a problem > of course, but it could be a trap for someone copying and > pasting code, and it just makes W=2 a little cleaner. > > Signed-off-by: Mark Rustad > Signed-off-by: Jeff Kirsher Why isn't Mark sending this email? > --- > kernel/locking/semaphore.c | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/kernel/locking/semaphore.c b/kernel/locking/semaphore.c > index 6815171..7782dbc 100644 > --- a/kernel/locking/semaphore.c > +++ b/kernel/locking/semaphore.c > @@ -36,7 +36,7 @@ > static noinline void __down(struct semaphore *sem); > static noinline int __down_interruptible(struct semaphore *sem); > static noinline int __down_killable(struct semaphore *sem); > -static noinline int __down_timeout(struct semaphore *sem, long jiffies); > +static noinline int __down_timeout(struct semaphore *sem, long njiffies); > static noinline void __up(struct semaphore *sem); So what's wrong with calling it "timeout" instead? That's what most other sites do. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] semaphore: Resolve some shadow warnings
On Thu, Aug 28, 2014 at 05:19:26AM -0700, Jeff Kirsher wrote: From: Mark Rustad mark.d.rus...@intel.com Resolve some shadow warnings resulting from using the name jiffies, which is a well-known global. This is not a problem of course, but it could be a trap for someone copying and pasting code, and it just makes W=2 a little cleaner. Signed-off-by: Mark Rustad mark.d.rus...@intel.com Signed-off-by: Jeff Kirsher jeffrey.t.kirs...@intel.com Why isn't Mark sending this email? --- kernel/locking/semaphore.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/locking/semaphore.c b/kernel/locking/semaphore.c index 6815171..7782dbc 100644 --- a/kernel/locking/semaphore.c +++ b/kernel/locking/semaphore.c @@ -36,7 +36,7 @@ static noinline void __down(struct semaphore *sem); static noinline int __down_interruptible(struct semaphore *sem); static noinline int __down_killable(struct semaphore *sem); -static noinline int __down_timeout(struct semaphore *sem, long jiffies); +static noinline int __down_timeout(struct semaphore *sem, long njiffies); static noinline void __up(struct semaphore *sem); So what's wrong with calling it timeout instead? That's what most other sites do. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] semaphore: Resolve some shadow warnings
On Mon, 2014-09-01 at 14:02 +0200, Peter Zijlstra wrote: On Thu, Aug 28, 2014 at 05:19:26AM -0700, Jeff Kirsher wrote: From: Mark Rustad mark.d.rus...@intel.com Resolve some shadow warnings resulting from using the name jiffies, which is a well-known global. This is not a problem of course, but it could be a trap for someone copying and pasting code, and it just makes W=2 a little cleaner. Signed-off-by: Mark Rustad mark.d.rus...@intel.com Signed-off-by: Jeff Kirsher jeffrey.t.kirs...@intel.com Why isn't Mark sending this email? Mark sent me several patches like this, for me to push upstream. So, I am making sure the appropriate owner is the receives the patch versus blindly sending to LKML. --- kernel/locking/semaphore.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/locking/semaphore.c b/kernel/locking/semaphore.c index 6815171..7782dbc 100644 --- a/kernel/locking/semaphore.c +++ b/kernel/locking/semaphore.c @@ -36,7 +36,7 @@ static noinline void __down(struct semaphore *sem); static noinline int __down_interruptible(struct semaphore *sem); static noinline int __down_killable(struct semaphore *sem); -static noinline int __down_timeout(struct semaphore *sem, long jiffies); +static noinline int __down_timeout(struct semaphore *sem, long njiffies); static noinline void __up(struct semaphore *sem); So what's wrong with calling it timeout instead? That's what most other sites do. Timeout would work as well to resolve the shadow warnings. signature.asc Description: This is a digitally signed message part