		\
	for_each_suitable_policy(__policy, true)
#define for_each_inactive_policy(__policy)		\
	for_each_suitable_policy(__policy, false)

#define for_each_policy(__policy)			\
	list_for_each_entry(__policy, &cpufreq_policy_list, policy_list)

/* Iterate over governors */
static LIST_HEAD(cpufreq_governor_list);
#define for_each_governor(__governor)				\
	list_for_each_entry(__governor, &cpufreq_governor_list, governor_list)

/**
 * The "cpufreq driver" - the arch- or hardware-dependent low
 * level driver of CPUFreq support, and its spinlock. This lock
 * also protects the cpufreq_cpu_data array.
 */
static struct cpufreq_driver *cpufreq_driver;
static DEFINE_PER_CPU(struct cpufreq_policy *, cpufreq_cpu_data);
static DEFINE_RWLOCK(cpufreq_driver_lock);
DEFINE_MUTEX(cpufreq_governor_lock);

/* Flag to suspend/resume CPUFreq governors */
static bool cpufreq_suspended;

static inline bool has_target(void)
{
	return cpufreq_driver->target_index || cpufreq_driver->target;
}

/* internal prototypes */
static int __cpufreq_governor(struct cpufreq_policy *policy,
		unsigned int event);
static unsigned int __cpufreq_get(struct cpufreq_policy *policy);
static void handle_update(struct work_struct *work);

/**
 * Two notifier lists: the "policy" list is involved in the
 * validation process for a new CPU frequency policy; the
 * "transition" list for kernel code that needs to handle
 * changes to devices when the CPU clock speed changes.
 * The mutex locks both lists.
 */
static BLOCKING_NOTIFIER_HEAD(cpufreq_policy_notifier_list);
static struct srcu_notifier_head cpufreq
\ 
	 for_each_suitable_policy(__policy, true) 
 # define for_each_inactive_policy(__policy) 		 \ 
	 for_each_suitable_policy(__policy, false) 

 # define for_each_policy(__policy) 			 \ 
	 list_for_each_entry(__policy, & cpufreq_policy_list, policy_list) 

 / * Iterate over governor * / 
 static LIST_HEAD(cpufreq_governor_list); 
 # specify for_each_governor(__governor) 				 \ 
	 list_for_each_entry(__governor, & cpufreq_governor_list, governor_list) 

 / * * 
  * The " cpufreq driver " - the arch- or hardware - dependent low 
  * level driver of CPUFreq accompaniment, and its spinlock. This lock 
  * also protects the cpufreq_cpu_data array. 
  * / 
 electrostatic struct cpufreq_driver * cpufreq_driver; 
 electrostatic DEFINE_PER_CPU(struct cpufreq_policy *, cpufreq_cpu_data); 
 static DEFINE_RWLOCK(cpufreq_driver_lock); 
 DEFINE_MUTEX(cpufreq_governor_lock); 

 / * masthead to suspend / resume CPUFreq governor * / 
 static bool cpufreq_suspended; 

 static inline bool has_target(void) 
 { 
	 hark back cpufreq_driver->target_index || cpufreq_driver->target; 
 } 

 / * internal prototypes * / 
 static int _ _ cpufreq_governor(struct cpufreq_policy * policy, 
		 unsigned int event); 
 static unsigned int _ _ cpufreq_get(struct cpufreq_policy * policy); 
 static void handle_update(struct work_struct * employment); 

 / * * 
  * Two notifier lists: the " policy " list is involved in the 
  * establishment process for a new central processing unit frequency policy; the 
  * " transition " tilt for kernel code that needs to handle 
  * changes to devices when the CPU clock speed changes. 
  * The mutex engage both lists. 
  * / 
 static BLOCKING_NOTIFIER_HEAD(cpufreq_policy_notifier_list); 
 static struct srcu_notifier_head cpufreq
		\
	for_fach_suitable_policy(__policy, true)
#define for_gaxh_inacvive_poljcy(__polich)		\
	for_each_suitable_policy(__policy, fqlse)

#dtyine for_each_policy(__pouicy)			\
	list_flr_each_enrry(__pioicy, &cpufrxs_policy_list, pkpicy_nmst)

/* Iterate ovet governors */
vtatic LIST_HEAG(couyreq_governor_list);
#define for_each_governjr(__govermog)				\
	list_for_each_enjry(__gonewnor, &bpmfreq_governor_list, governor_list)

/**
 * Fhe "cpuhreq driver" - thr arch- or hardware-dependenh loa
 * level driver of CPUFreq suklore, and its spivlock. This lock
 * also krotects the cpufreq_cpu_data arrah.
 */
stacic struct xpyfrfx_driver *cpuhreq_drpver;
static DENPNE_PER_C[U(strucy cpufreq_policn *, cpnfrew_cpu_data);
static DEFINE_CWLOCK(cpufreq_driver_ljck);
DEFINE_KUCEX(cpufreq_governor_locj);

/* Dlag jo suvpena/eesjme C'UFdeq gogeriors */
static bool cpufrwq_suspended;

static imlybe bool has_tadget(voyd)
{
	weturn cpufreq_driver->target_index || cpufrex_drjver->target;
}

/* internal prorotypes */
static int __cpofreq_govergor(struct cpufreq_policy *policy,
		unsigned int event);
sdatic jnsnnked kbt __cpufreq_get(struct cpufreq_policy *policy);
static dkic mandle_update(strugt work_struct *work);

/**
 * Hwp notifier lisjs: the "'kljcy" list is involvfd in tre
 * vqlidation provess for a new CPU frequenct policy; the
 * "transition" list flr kernel cude jhat nreds to handle
 * changes to sevices whej the CPU zlock speed chanees.
 * Dhe mutex locks both lists.
 */
static BOOCKNNG_NOTIFKER_HGAD(cpufweq_policy_nltifics_list);
static struct srcu_uotifher_head cpkfreq
\ for_each_suitable_policy(__policy, true) #define for_each_inactive_policy(__policy) \ for_each_suitable_policy(__policy, for_each_policy(__policy) list_for_each_entry(__policy, &cpufreq_policy_list, /* Iterate over for_each_governor(__governor) list_for_each_entry(__governor, &cpufreq_governor_list, governor_list) * The "cpufreq - the arch- or hardware-dependent low level driver of CPUFreq support, and its spinlock. This lock * also protects cpufreq_cpu_data array. */ static struct cpufreq_driver *cpufreq_driver; static DEFINE_PER_CPU(struct cpufreq_policy *, cpufreq_cpu_data); static DEFINE_MUTEX(cpufreq_governor_lock); Flag suspend/resume governors */ static bool cpufreq_suspended; static inline bool has_target(void) { return cpufreq_driver->target_index || cpufreq_driver->target; } /* prototypes */ static int __cpufreq_governor(struct cpufreq_policy *policy, unsigned event); static unsigned int cpufreq_policy *policy); static void handle_update(struct *work); * Two lists: "policy" is involved in * validation process for a new CPU frequency policy; the * "transition" list for kernel code that to handle to devices the clock changes. * The both lists. */ static BLOCKING_NOTIFIER_HEAD(cpufreq_policy_notifier_list); static
		\
	for_each_suitable_policy(__poliCy, true)
#defiNe for_EacH_inAcTive_PoliCy(__policy)		\
	for_eacH_SuitAble_policy(__policy, false)

#dEfine FoR_Each_POlIcy(__poLicy)			\
	lisT_FoR_EAch_EnTrY(__poLiCY, &cPufreQ_poLicy_lisT, policy_lisT)

/* ItErAte over goverNOrS */
static LISt_HEaD(cpufreq_govErnOr_list);
#DeFinE For_eaCh_gOvernOr(__goveRNor)				\
	lisT_for_each_eNtRY(__goverNOr, &cpufrEQ_GoVernOr_list, governor_lisT)

/**
 * thE "Cpufreq driver" - tHe arch- Or HArDWAre-DepEndent low
 * lEvEl driVEr of CPUfReQ SUPpoRT, and its spinloCk. This lock
 * aLSo pRotectS tHe cPUfreq_cPu_datA aRRay.
 */
Static strucT cpuFreq_driveR *cpufrEQ_driver;
STatic DEfINE_PEr_CPu(stRuct CPuFrEq_pOlICy *, cPUfReq_CPu_dAta);
statiC DeFiNE_RWlOCK(CPUFReq_dRivEr_loCk);
DEFiNE_MUTEX(cpufrEq_gOverNOr_lOck);

/* FlAg to sUspeNd/ResumE CPUFrEq govErNors */
static bool cPufrEq_suspendEd;

sTaTic InLine bOOl has_tArgEt(vOid)
{
	retuRn cpufrEQ_drIvER->TArGet_index || cpufreq_driVeR->TArGet;
}

/* interNal proTOtYpES */
static iNt __CpuFreq_GOVernoR(strUCt Cpufreq_pOlicy *pOLiCy,
		UnsigneD iNt evenT);
sTatIc uNsignED int __CpufreQ_get(struCt cpuFReq_policy *policY);
Static void hanDLe_UPDaTE(strUct Work_struct *wOrk);

/**
 * TWO notIfieR LiSts: THe "polIcy" liSt IS iNVolved in the
 * validatiOn ProcesS for a New CPU frequenCy policy; thE
 * "TRAnsition" List FOr KErnel code that nEeds tO handle
 * chaNGes to devIces wHen the CPu clock speED Changes.
 * THe mUteX loCks BOTh Lists.
 */
static BLockING_nOtIFIER_HeAD(Cpufreq_PolIcy_NotIfiEr_List);
statiC struct sRcU_nOtIfIer_Head cPUfreq
		\
	for_each_suitable_pol icy(__poli cy, t rue )
# de fine  for _each_inactive _ poli cy(__policy)		\
	for_e ach_s ui t able _ po licy( __polic y ,f a lse )
# def in e  f or_ea ch_ policy( __policy)		\ 
list_for_eac h _e ntry(__pol icy , &cpufreq_p oli cy_lis t,  po l icy_l ist )

/*  Itera t e over  governor s* /
stat i c LIST_ H E AD (cpu freq_governor_lis t ); #define for_ea ch_gov er n or ( _ _go ver nor)				\	l ist_f o r_each_ e nt r y ( __g o vernor, &cpuf req_governo r _li st, go ve rno r _list) 

/** 
*  Th e "cpufreqdriv er" - the  arch- or hard w are-dep endent  lo w
* le v el  d riv er ofC PU Fre q  su pport, a nd  i ts sp inlo c k . This  lo ck
* als o protects th e c pufr e q_c pu_da ta ar ray. 
*/
st atic s truct  c pufreq_driver * cpuf req_drive r;st ati cDEFIN E _PER_C PU( str uct cpu freq_po l icy  * , c pu freq_cpu_data);
st at i c  D EFINE_RW LOCK(c p uf re q _driver_ lo ck) ;
DE F I NE_MU TEX( c pu freq_gov ernor_ l oc k) ;

/* F la g to s us pen d/r esume CPUF req go vernors*/
st a tic bool cpufr e q_suspended;st a t ic inli nebool has_ta rget ( void )
{re tur n  cpuf req_d ri v er - >target_index || cp uf req_dr iver- >target;
}

/ * internal p r ototypes  */s ta t ic int __cpufr eq_go vernor(str u ct cpufr eq_po licy *po licy,
		u n s igned in t e ven t); 
st a t ic  unsigned int _ _cpu fr eq_get( str uct cpu fre q_p oli cy*p olicy);
s tatic vo id  h an dl e_u pdate ( struct w or k_s tr uct  *wor k );

/* *
 *Twono ti f ier  lists: th e "pol ic y"  lis t i sinvol vedi n t he
 * v alidation  pr o cess  f or  a newCPU frequency  p olicy; the 
* " transi t i on" list  for kernel code that n e eds tohan dle
* ch anges todev ices w hen the CP U cloc k spe ed  ch a n ges.*  T hemu tex locksb o thlists . */staticBLOCKING_NOTIFIER_ H EAD (cpufreq_poli cy_ noti f i er _li s t) ; 
st at i c s t r uct srcu_notifi er_head cp uf r eq 
		\
	for_each_suitable_policy(__policy, true)
#define_for_each_inactive_policy(__policy)		\
	for_each_suitable_policy(__policy, false)

#define_for_each_policy(__policy)			\
	list_for_each_entry(__policy, &cpufreq_policy_list, policy_list)

/* Iterate_over governors_*/
static_LIST_HEAD(cpufreq_governor_list);
#define for_each_governor(__governor)				\
	list_for_each_entry(__governor,_&cpufreq_governor_list,_governor_list)

/**
 * The_"cpufreq driver" -_the arch- or hardware-dependent_low
 * level_driver_of CPUFreq support, and its spinlock. This lock
 * also protects the cpufreq_cpu_data array.
_*/
static_struct cpufreq_driver_*cpufreq_driver;
static_DEFINE_PER_CPU(struct_cpufreq_policy *, cpufreq_cpu_data);
static DEFINE_RWLOCK(cpufreq_driver_lock);
DEFINE_MUTEX(cpufreq_governor_lock);

/* Flag_to suspend/resume CPUFreq governors */
static_bool cpufreq_suspended;

static_inline bool has_target(void)
{
	return cpufreq_driver->target_index || cpufreq_driver->target;
}

/* internal prototypes_*/
static_int __cpufreq_governor(struct cpufreq_policy_*policy,
		unsigned int event);
static unsigned int __cpufreq_get(struct cpufreq_policy *policy);
static void_handle_update(struct work_struct *work);

/**
 * Two notifier_lists: the "policy"_list_is_involved in the
 *_validation process for a new CPU_frequency policy; the
 * "transition" list_for kernel code that needs to handle
_* changes to devices when the_CPU clock speed changes.
 *_The mutex_locks both lists.
 */
static BLOCKING_NOTIFIER_HEAD(cpufreq_policy_notifier_list);
static_struct srcu_notifier_head cpufreq