lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 30 Jun 2011 18:59:56 +0800
From:	Ike Panhc <ike.pan@...onical.com>
To:	Matthew Garrett <mjg59@...f.ucam.org>
CC:	linux-kernel@...r.kernel.org, platform-driver-x86@...r.kernel.org
Subject: Re: [PATCH 1/3] ideapad: define cfg bits and create sysfs node for
 cfg

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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ