All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ike Panhc <ike.pan@canonical.com>
To: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH 1/3] ideapad: define cfg bits and create sysfs node for cfg
Date: Thu, 30 Jun 2011 18:59:56 +0800	[thread overview]
Message-ID: <4E0C572C.8000409@canonical.com> (raw)
In-Reply-To: <20110622193523.GA8861@srcf.ucam.org>

On 06/23/2011 03:35 AM, Matthew Garrett wrote:
> On Wed, Jun 22, 2011 at 04:05:43PM +0800, Ike Panhc wrote:
>>  static int __devinit ideapad_acpi_add(struct acpi_device *adevice)
>>  {
>> -	int ret, i, cfg;
>> +	int ret, i;
>> +	unsigned long cfg;
> 
> You change this to an unsigned long, but you cast it to an int in 
> several places. Is that just to avoid casting to a long here?
> 
>> -		if (test_bit(ideapad_rfk_data[i].cfgbit, (unsigned long *)&cfg))
>> +		if (test_bit(ideapad_rfk_data[i].cfgbit, &cfg))
> 
> I think it seems neater the other way around, but don't have terribly 
> strong opinions.
> 

I read again how cfg is used. They are 2 test_bit, one sprintf and
read_method_int.

test_bit is the major reason of changing from int to unsigned long. I will
change the format string in sprintf from %X to %lX. After the change there
will be only one cast left.

  reply	other threads:[~2011-06-30 11:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-22  8:03 [PATCH 0/3 v2] ideapad: add backlight driver and changes of sysfs nodes Ike Panhc
2011-06-22  8:05 ` [PATCH 1/3] ideapad: define cfg bits and create sysfs node for cfg Ike Panhc
2011-06-22 19:35   ` Matthew Garrett
2011-06-30 10:59     ` Ike Panhc [this message]
2011-06-22  8:06 ` [PATCH 2/3] ideapad: let camera_power node invisiable if no camera Ike Panhc
2011-06-22  8:07 ` [PATCH 3/3] ideapad: add backlight driver Ike Panhc
2011-06-22  9:20   ` Corentin Chary
2011-06-22 19:40   ` Matthew Garrett
2011-06-23  3:38     ` Ike Panhc
2011-06-23  5:52     ` Ike Panhc
2011-06-30 11:49 [PATCH 0/3 v3] ideapad: add backlight driver and changes of sysfs nodes Ike Panhc
2011-06-30 11:50 ` [PATCH 1/3] ideapad: define cfg bits and create sysfs node for cfg Ike Panhc

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=4E0C572C.8000409@canonical.com \
    --to=ike.pan@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=platform-driver-x86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.