public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Xiaotian Feng <dfeng@redhat.com>
Cc: axboe@kernel.dk, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2] block: sysfs fix mismatched queue_var_{store,show} in 64bit kernel
Date: Fri, 17 Jul 2009 15:48:50 +0900	[thread overview]
Message-ID: <4A601ED2.50800@kernel.org> (raw)
In-Reply-To: <1247580906-24762-1-git-send-email-dfeng@redhat.com>

Hello, Xiaotian.

Xiaotian Feng wrote:
>  static ssize_t queue_ra_show(struct request_queue *q, char *page)
>  {
> -	int ra_kb = q->backing_dev_info.ra_pages << (PAGE_CACHE_SHIFT - 10);
> +	unsigned long ra_kb = q->backing_dev_info.ra_pages <<
> +					(PAGE_CACHE_SHIFT - 10);
>  
>  	return queue_var_show(ra_kb, (page));
>  }

Nice.

> @@ -95,7 +96,7 @@ queue_ra_store(struct request_queue *q, const char *page, size_t count)
>  
>  static ssize_t queue_max_sectors_show(struct request_queue *q, char *page)
>  {
> -	int max_sectors_kb = queue_max_sectors(q) >> 1;
> +	unsigned long max_sectors_kb = queue_max_sectors(q) >> 1;
>  
>  	return queue_var_show(max_sectors_kb, (page));
>  }
> @@ -140,7 +141,7 @@ queue_max_sectors_store(struct request_queue *q, const char *page, size_t count)
>  
>  static ssize_t queue_max_hw_sectors_show(struct request_queue *q, char *page)
>  {
> -	int max_hw_sectors_kb = queue_max_hw_sectors(q) >> 1;
> +	unsigned long max_hw_sectors_kb = queue_max_hw_sectors(q) >> 1;
>  
>  	return queue_var_show(max_hw_sectors_kb, (page));
>  }

The above two aren't necessary but well why not.

> @@ -189,7 +190,7 @@ static ssize_t queue_nomerges_store(struct request_queue *q, const char *page,
>  
>  static ssize_t queue_rq_affinity_show(struct request_queue *q, char *page)
>  {
> -	unsigned int set = test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags);
> +	unsigned long set = test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags);
>  
>  	return queue_var_show(set != 0, page);
>  }

Wouldn't it be better to make it "bool set = " and then remove the
"!= 0"?

Thanks.

-- 
tejun

  reply	other threads:[~2009-07-17  6:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-14 11:56 [PATCH] block: sysfs fix mismatched queue_var_{store,show} in 64bit kernel Xiaotian Feng
2009-07-14 13:53 ` Américo Wang
2009-07-14 15:00   ` Danny Feng
2009-07-14 14:10 ` Johannes Weiner
2009-07-14 14:15 ` [PATCH V2] " Xiaotian Feng
2009-07-17  6:48   ` Tejun Heo [this message]
2009-07-17  7:39     ` Danny Feng
2009-07-17  7:53       ` Tejun Heo

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=4A601ED2.50800@kernel.org \
    --to=tj@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=dfeng@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /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