summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorKrishna Kumar <krkumar2@in.ibm.com>2009-10-14 21:55:07 +0200
committerDavid S. Miller <davem@davemloft.net>2009-10-18 08:57:26 +0200
commit988ade6b8e27e79311812f83a87b5cea11fabcd7 (patch)
tree864fccbc78ffa108cde15648440b543f8f7e6688 /drivers/cpufreq
parentgenetlink: Optimize genl_register_family() (diff)
downloadlinux-988ade6b8e27e79311812f83a87b5cea11fabcd7.tar.xz
linux-988ade6b8e27e79311812f83a87b5cea11fabcd7.zip
genetlink: Optimize and one bug fix in genl_generate_id()
1. GENL_MIN_ID is a valid id -> no need to start at GENL_MIN_ID + 1. 2. Avoid going through the ids two times: If we start at GENL_MIN_ID+1 (*or bigger*) and all ids are over!, the code iterates through the list twice (*or lesser*). 3. Simplify code - no need to start at idx=0 which gets reset to GENL_MIN_ID. Patch on net-next-2.6. Reboot test shows that first id passed to genl_register_family was 16, next two were GENL_ID_GENERATE and genl_generate_id returned 17 & 18 (user level testing of same code shows expected values across entire range of MIN/MAX). Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/cpufreq')
0 files changed, 0 insertions, 0 deletions