From mboxrd@z Thu Jan 1 00:00:00 1970 From: mulyadi.santosa@gmail.com (Mulyadi Santosa) Date: Tue, 22 Jul 2014 17:54:19 +0700 Subject: Confused by function names cpuidle_install_idle_handler/cpuidle_uninstall_idle_handler In-Reply-To: References: Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Fri, Jul 18, 2014 at 11:07 PM, Mohammad Merajul Islam Molla wrote: > Hello, > > In drivers/cpuidle/cpuidle.c, there are two functions > cpuidle_install_idle_handler & cpuidle_uninstall_idle_handler. The > names seem confusing to me as they don't install any handler, rather > set 'initialized' variable to 1/0. > > In v3.0 kernel, these functions used to look as below where they > installed and uninstalled some handler function - > > void cpuidle_install_idle_handler(void) > 123 { > 124 if (enabled_devices && (pm_idle != cpuidle_idle_call)) { > 125 /* Make sure all changes finished before we switch > to new idle */ > 126 smp_wmb(); > 127 pm_idle = cpuidle_idle_call; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pm_idle is the callback handler, and it is assigned to cpuidle_idle_call. I think this what it means by "install" -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com