linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Shi <alex.shi@intel.com>
To: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Cc: rusty@rustcorp.com.au, akpm@linux-foundation.org,
	paul.gortmaker@windriver.com, kosaki.motohiro@jp.fujitsu.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cpumask: add a few comments of cpumask functions
Date: Wed, 30 May 2012 18:40:12 +0800	[thread overview]
Message-ID: <4FC5F90C.9070308@intel.com> (raw)
In-Reply-To: <4FC4236F.309@intel.com>

On 05/29/2012 09:16 AM, Alex Shi wrote:

> 
>>>> s/return/Returns
>>>>
>>>> What do you mean by "old" cpumask?
>>>
>>> Thanks for comments!
>>> Should be "the old bitmap of cpumask"?
>>>
>>
>>
>> No, there is no "old" or "new" cpumask here because this function doesn't
>> change the cpumask. It just checks if that bit is set.
>> So something like:
>> Returns 1 if 'cpu' is set in 'cpumask', else returns 0.
>>
> 
> 
> 
> Sure, thanks! and comments changed again following your style.
> Is the following new update patch ok?


Any further comments for this patch? :)

> 
> 
> From 1daa52caf1ba83eea0975a9250becd85dd5a5315 Mon Sep 17 00:00:00 2001
> From: Alex Shi <alex.shi@intel.com>
> Date: Mon, 28 May 2012 22:23:51 +0800
> Subject: [PATCH] cpumask: add a few comments of cpumask functions
> 
> Current few cpumask functions' purposes are not quite clear. Stupid
> user like myself needs to dig into details for clear function
> purpose and return value.
> Add few explanation for them is helpful.
> 
> Thanks for Srivatsa's comments and correction!
> 
> Signed-off-by: Alex Shi <alex.shi@intel.com>
> ---
>  include/linux/cpumask.h |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
> index a2c819d..170c5af 100644
> --- a/include/linux/cpumask.h
> +++ b/include/linux/cpumask.h
> @@ -271,6 +271,7 @@ static inline void cpumask_clear_cpu(int cpu, struct cpumask *dstp)
>   * cpumask_test_cpu - test for a cpu in a cpumask
>   * @cpu: cpu number (< nr_cpu_ids)
>   * @cpumask: the cpumask pointer
> + * Returns 1 if 'cpu' is set in 'cpumask', else returns 0
>   *
>   * No static inline type checking - see Subtlety (1) above.
>   */
> @@ -281,6 +282,7 @@ static inline void cpumask_clear_cpu(int cpu, struct cpumask *dstp)
>   * cpumask_test_and_set_cpu - atomically test and set a cpu in a cpumask
>   * @cpu: cpu number (< nr_cpu_ids)
>   * @cpumask: the cpumask pointer
> + * Returns 1 if 'cpu' is set in old bitmap of 'cpumask', else returns 0
>   *
>   * test_and_set_bit wrapper for cpumasks.
>   */
> @@ -293,6 +295,7 @@ static inline int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask)
>   * cpumask_test_and_clear_cpu - atomically test and clear a cpu in a cpumask
>   * @cpu: cpu number (< nr_cpu_ids)
>   * @cpumask: the cpumask pointer
> + * Returns 1 if 'cpu' is set in old bitmap of 'cpumask', else returns 0
>   *
>   * test_and_clear_bit wrapper for cpumasks.
>   */
> @@ -324,6 +327,7 @@ static inline void cpumask_clear(struct cpumask *dstp)
>   * @dstp: the cpumask result
>   * @src1p: the first input
>   * @src2p: the second input
> + * If *dstp is empty, returns 0, else returns 1
>   */
>  static inline int cpumask_and(struct cpumask *dstp,
>  			       const struct cpumask *src1p,
> @@ -365,6 +369,7 @@ static inline void cpumask_xor(struct cpumask *dstp,
>   * @dstp: the cpumask result
>   * @src1p: the first input
>   * @src2p: the second input
> + * If *dstp is empty, returns 0, else returns 1
>   */
>  static inline int cpumask_andnot(struct cpumask *dstp,
>  				  const struct cpumask *src1p,
> @@ -414,6 +419,7 @@ static inline bool cpumask_intersects(const struct cpumask *src1p,
>   * cpumask_subset - (*src1p & ~*src2p) == 0
>   * @src1p: the first input
>   * @src2p: the second input
> + * Returns 1 if *src1p is a subset of *src2p, else returns 0
>   */
>  static inline int cpumask_subset(const struct cpumask *src1p,
>  				 const struct cpumask *src2p)



  reply	other threads:[~2012-05-30 10:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-28  9:02 [PATCH] cpumask: add a few comments of cpumask functions Alex Shi
2012-05-28 12:47 ` Srivatsa S. Bhat
2012-05-28 13:49   ` Alex Shi
2012-05-28 14:23     ` Alex Shi
2012-07-13 22:37       ` Andrew Morton
2012-07-16  2:34         ` Alex Shi
2012-07-16  7:35           ` Rusty Russell
2012-07-16  8:01             ` Alex Shi
2012-05-28 15:25     ` Srivatsa S. Bhat
2012-05-29  1:16       ` Alex Shi
2012-05-30 10:40         ` Alex Shi [this message]
2012-05-30 10:49           ` KOSAKI Motohiro
2012-05-31  8:15             ` Alex Shi
2012-06-04  1:37               ` Rusty Russell
2012-06-04  1:36     ` Rusty Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FC5F90C.9070308@intel.com \
    --to=alex.shi@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=rusty@rustcorp.com.au \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).