Re: [PATCH] cpuidle: Fix Coding style reported by checkpatch.pl

2014-07-14 Thread pramod gurav
On Mon, Jul 14, 2014 at 11:38 PM, Rafael J. Wysocki  wrote:
> On Monday, July 14, 2014 12:40:24 PM pramod gurav wrote:
>> Hi Rafael,
>>
>> Can we consider these changes if there are  no issues with this?
>
> Well, are you "fixing" checkpatch.pl warnings just for the sake of
> this or is there a deeper reason?
>

I was browsing through the source code and found couple of them. Then
ran checkpatch.pl to see if there are more. And thought the error
"Fixed: ERROR: do not use assignment in if condition" must be fixed.
Otherwise there is no reason.

> Rafael
>
>
>> On Fri, Jun 20, 2014 at 4:28 PM, pramod gurav
>>  wrote:
>> > +linux-pm
>> >
>> > On Fri, Jun 20, 2014 at 4:27 PM, Pramod Gurav
>> >  wrote:
>> >> Fixed: ERROR: do not use assignment in if condition
>> >> Fixed: WARNING: EXPORT_SYMBOL should immediately follow its function
>> >> Fixed: WARNING: line over 80 characters in a comment
>> >>
>> >> CC: Rafael J. Wysocki 
>> >> CC: Daniel Lezcano 
>> >>
>> >> Signed-off-by: Pramod Gurav 
>> >> ---
>> >>  drivers/cpuidle/cpuidle.c |   18 --
>> >>  1 file changed, 8 insertions(+), 10 deletions(-)
>> >>
>> >> diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
>> >> index 8236746..2c8752e 100644
>> >> --- a/drivers/cpuidle/cpuidle.c
>> >> +++ b/drivers/cpuidle/cpuidle.c
>> >> @@ -179,7 +179,9 @@ void cpuidle_reflect(struct cpuidle_device *dev, int 
>> >> index)
>> >>  void cpuidle_install_idle_handler(void)
>> >>  {
>> >> if (enabled_devices) {
>> >> -   /* Make sure all changes finished before we switch to new 
>> >> idle */
>> >> +   /*
>> >> +* Make sure all changes finished before we switch to new 
>> >> idle
>> >> +*/
>> >> smp_wmb();
>> >> initialized = 1;
>> >> }
>> >> @@ -204,7 +206,6 @@ void cpuidle_pause_and_lock(void)
>> >> mutex_lock(_lock);
>> >> cpuidle_uninstall_idle_handler();
>> >>  }
>> >> -
>> >>  EXPORT_SYMBOL_GPL(cpuidle_pause_and_lock);
>> >>
>> >>  /**
>> >> @@ -215,7 +216,6 @@ void cpuidle_resume_and_unlock(void)
>> >> cpuidle_install_idle_handler();
>> >> mutex_unlock(_lock);
>> >>  }
>> >> -
>> >>  EXPORT_SYMBOL_GPL(cpuidle_resume_and_unlock);
>> >>
>> >>  /* Currently used in suspend/resume path to suspend cpuidle */
>> >> @@ -267,9 +267,11 @@ int cpuidle_enable_device(struct cpuidle_device *dev)
>> >> if (ret)
>> >> return ret;
>> >>
>> >> -   if (cpuidle_curr_governor->enable &&
>> >> -   (ret = cpuidle_curr_governor->enable(drv, dev)))
>> >> -   goto fail_sysfs;
>> >> +   if (cpuidle_curr_governor->enable) {
>> >> +   ret = cpuidle_curr_governor->enable(drv, dev);
>> >> +   if (ret)
>> >> +   goto fail_sysfs;
>> >> +   }
>> >>
>> >> smp_wmb();
>> >>
>> >> @@ -283,7 +285,6 @@ fail_sysfs:
>> >>
>> >> return ret;
>> >>  }
>> >> -
>> >>  EXPORT_SYMBOL_GPL(cpuidle_enable_device);
>> >>
>> >>  /**
>> >> @@ -311,7 +312,6 @@ void cpuidle_disable_device(struct cpuidle_device 
>> >> *dev)
>> >> cpuidle_remove_device_sysfs(dev);
>> >> enabled_devices--;
>> >>  }
>> >> -
>> >>  EXPORT_SYMBOL_GPL(cpuidle_disable_device);
>> >>
>> >>  static void __cpuidle_unregister_device(struct cpuidle_device *dev)
>> >> @@ -399,7 +399,6 @@ out_unregister:
>> >> __cpuidle_unregister_device(dev);
>> >> goto out_unlock;
>> >>  }
>> >> -
>> >>  EXPORT_SYMBOL_GPL(cpuidle_register_device);
>> >>
>> >>  /**
>> >> @@ -423,7 +422,6 @@ void cpuidle_unregister_device(struct cpuidle_device 
>> >> *dev)
>> >>
>> >> cpuidle_resume_and_unlock();
>> >>  }
>> >> -
>> >>  EXPORT_SYMBOL_GPL(cpuidle_unregister_device);
>> >>
>> >>  /**
>> >> --
>> >> 1.7.9.5
>> >>
>> >
>> >
>> >
>> > --
>> > Thanks and Regards
>> > Pramod
>>
>>
>>
>>
>
> --
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.



-- 
Thanks and Regards
Pramod
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] cpuidle: Fix Coding style reported by checkpatch.pl

2014-07-14 Thread Rafael J. Wysocki
On Monday, July 14, 2014 12:40:24 PM pramod gurav wrote:
> Hi Rafael,
> 
> Can we consider these changes if there are  no issues with this?

Well, are you "fixing" checkpatch.pl warnings just for the sake of
this or is there a deeper reason?

Rafael


> On Fri, Jun 20, 2014 at 4:28 PM, pramod gurav
>  wrote:
> > +linux-pm
> >
> > On Fri, Jun 20, 2014 at 4:27 PM, Pramod Gurav
> >  wrote:
> >> Fixed: ERROR: do not use assignment in if condition
> >> Fixed: WARNING: EXPORT_SYMBOL should immediately follow its function
> >> Fixed: WARNING: line over 80 characters in a comment
> >>
> >> CC: Rafael J. Wysocki 
> >> CC: Daniel Lezcano 
> >>
> >> Signed-off-by: Pramod Gurav 
> >> ---
> >>  drivers/cpuidle/cpuidle.c |   18 --
> >>  1 file changed, 8 insertions(+), 10 deletions(-)
> >>
> >> diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
> >> index 8236746..2c8752e 100644
> >> --- a/drivers/cpuidle/cpuidle.c
> >> +++ b/drivers/cpuidle/cpuidle.c
> >> @@ -179,7 +179,9 @@ void cpuidle_reflect(struct cpuidle_device *dev, int 
> >> index)
> >>  void cpuidle_install_idle_handler(void)
> >>  {
> >> if (enabled_devices) {
> >> -   /* Make sure all changes finished before we switch to new 
> >> idle */
> >> +   /*
> >> +* Make sure all changes finished before we switch to new 
> >> idle
> >> +*/
> >> smp_wmb();
> >> initialized = 1;
> >> }
> >> @@ -204,7 +206,6 @@ void cpuidle_pause_and_lock(void)
> >> mutex_lock(_lock);
> >> cpuidle_uninstall_idle_handler();
> >>  }
> >> -
> >>  EXPORT_SYMBOL_GPL(cpuidle_pause_and_lock);
> >>
> >>  /**
> >> @@ -215,7 +216,6 @@ void cpuidle_resume_and_unlock(void)
> >> cpuidle_install_idle_handler();
> >> mutex_unlock(_lock);
> >>  }
> >> -
> >>  EXPORT_SYMBOL_GPL(cpuidle_resume_and_unlock);
> >>
> >>  /* Currently used in suspend/resume path to suspend cpuidle */
> >> @@ -267,9 +267,11 @@ int cpuidle_enable_device(struct cpuidle_device *dev)
> >> if (ret)
> >> return ret;
> >>
> >> -   if (cpuidle_curr_governor->enable &&
> >> -   (ret = cpuidle_curr_governor->enable(drv, dev)))
> >> -   goto fail_sysfs;
> >> +   if (cpuidle_curr_governor->enable) {
> >> +   ret = cpuidle_curr_governor->enable(drv, dev);
> >> +   if (ret)
> >> +   goto fail_sysfs;
> >> +   }
> >>
> >> smp_wmb();
> >>
> >> @@ -283,7 +285,6 @@ fail_sysfs:
> >>
> >> return ret;
> >>  }
> >> -
> >>  EXPORT_SYMBOL_GPL(cpuidle_enable_device);
> >>
> >>  /**
> >> @@ -311,7 +312,6 @@ void cpuidle_disable_device(struct cpuidle_device *dev)
> >> cpuidle_remove_device_sysfs(dev);
> >> enabled_devices--;
> >>  }
> >> -
> >>  EXPORT_SYMBOL_GPL(cpuidle_disable_device);
> >>
> >>  static void __cpuidle_unregister_device(struct cpuidle_device *dev)
> >> @@ -399,7 +399,6 @@ out_unregister:
> >> __cpuidle_unregister_device(dev);
> >> goto out_unlock;
> >>  }
> >> -
> >>  EXPORT_SYMBOL_GPL(cpuidle_register_device);
> >>
> >>  /**
> >> @@ -423,7 +422,6 @@ void cpuidle_unregister_device(struct cpuidle_device 
> >> *dev)
> >>
> >> cpuidle_resume_and_unlock();
> >>  }
> >> -
> >>  EXPORT_SYMBOL_GPL(cpuidle_unregister_device);
> >>
> >>  /**
> >> --
> >> 1.7.9.5
> >>
> >
> >
> >
> > --
> > Thanks and Regards
> > Pramod
> 
> 
> 
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] cpuidle: Fix Coding style reported by checkpatch.pl

2014-07-14 Thread pramod gurav
Hi Rafael,

Can we consider these changes if there are  no issues with this?

On Fri, Jun 20, 2014 at 4:28 PM, pramod gurav
 wrote:
> +linux-pm
>
> On Fri, Jun 20, 2014 at 4:27 PM, Pramod Gurav
>  wrote:
>> Fixed: ERROR: do not use assignment in if condition
>> Fixed: WARNING: EXPORT_SYMBOL should immediately follow its function
>> Fixed: WARNING: line over 80 characters in a comment
>>
>> CC: Rafael J. Wysocki 
>> CC: Daniel Lezcano 
>>
>> Signed-off-by: Pramod Gurav 
>> ---
>>  drivers/cpuidle/cpuidle.c |   18 --
>>  1 file changed, 8 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
>> index 8236746..2c8752e 100644
>> --- a/drivers/cpuidle/cpuidle.c
>> +++ b/drivers/cpuidle/cpuidle.c
>> @@ -179,7 +179,9 @@ void cpuidle_reflect(struct cpuidle_device *dev, int 
>> index)
>>  void cpuidle_install_idle_handler(void)
>>  {
>> if (enabled_devices) {
>> -   /* Make sure all changes finished before we switch to new 
>> idle */
>> +   /*
>> +* Make sure all changes finished before we switch to new 
>> idle
>> +*/
>> smp_wmb();
>> initialized = 1;
>> }
>> @@ -204,7 +206,6 @@ void cpuidle_pause_and_lock(void)
>> mutex_lock(_lock);
>> cpuidle_uninstall_idle_handler();
>>  }
>> -
>>  EXPORT_SYMBOL_GPL(cpuidle_pause_and_lock);
>>
>>  /**
>> @@ -215,7 +216,6 @@ void cpuidle_resume_and_unlock(void)
>> cpuidle_install_idle_handler();
>> mutex_unlock(_lock);
>>  }
>> -
>>  EXPORT_SYMBOL_GPL(cpuidle_resume_and_unlock);
>>
>>  /* Currently used in suspend/resume path to suspend cpuidle */
>> @@ -267,9 +267,11 @@ int cpuidle_enable_device(struct cpuidle_device *dev)
>> if (ret)
>> return ret;
>>
>> -   if (cpuidle_curr_governor->enable &&
>> -   (ret = cpuidle_curr_governor->enable(drv, dev)))
>> -   goto fail_sysfs;
>> +   if (cpuidle_curr_governor->enable) {
>> +   ret = cpuidle_curr_governor->enable(drv, dev);
>> +   if (ret)
>> +   goto fail_sysfs;
>> +   }
>>
>> smp_wmb();
>>
>> @@ -283,7 +285,6 @@ fail_sysfs:
>>
>> return ret;
>>  }
>> -
>>  EXPORT_SYMBOL_GPL(cpuidle_enable_device);
>>
>>  /**
>> @@ -311,7 +312,6 @@ void cpuidle_disable_device(struct cpuidle_device *dev)
>> cpuidle_remove_device_sysfs(dev);
>> enabled_devices--;
>>  }
>> -
>>  EXPORT_SYMBOL_GPL(cpuidle_disable_device);
>>
>>  static void __cpuidle_unregister_device(struct cpuidle_device *dev)
>> @@ -399,7 +399,6 @@ out_unregister:
>> __cpuidle_unregister_device(dev);
>> goto out_unlock;
>>  }
>> -
>>  EXPORT_SYMBOL_GPL(cpuidle_register_device);
>>
>>  /**
>> @@ -423,7 +422,6 @@ void cpuidle_unregister_device(struct cpuidle_device 
>> *dev)
>>
>> cpuidle_resume_and_unlock();
>>  }
>> -
>>  EXPORT_SYMBOL_GPL(cpuidle_unregister_device);
>>
>>  /**
>> --
>> 1.7.9.5
>>
>
>
>
> --
> Thanks and Regards
> Pramod



-- 
Thanks and Regards
Pramod
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] cpuidle: Fix Coding style reported by checkpatch.pl

2014-07-14 Thread pramod gurav
Hi Rafael,

Can we consider these changes if there are  no issues with this?

On Fri, Jun 20, 2014 at 4:28 PM, pramod gurav
pramod.gurav@gmail.com wrote:
 +linux-pm

 On Fri, Jun 20, 2014 at 4:27 PM, Pramod Gurav
 pramod.gurav@gmail.com wrote:
 Fixed: ERROR: do not use assignment in if condition
 Fixed: WARNING: EXPORT_SYMBOL should immediately follow its function
 Fixed: WARNING: line over 80 characters in a comment

 CC: Rafael J. Wysocki r...@rjwysocki.net
 CC: Daniel Lezcano daniel.lezc...@linaro.org

 Signed-off-by: Pramod Gurav pramod.gurav@gmail.com
 ---
  drivers/cpuidle/cpuidle.c |   18 --
  1 file changed, 8 insertions(+), 10 deletions(-)

 diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
 index 8236746..2c8752e 100644
 --- a/drivers/cpuidle/cpuidle.c
 +++ b/drivers/cpuidle/cpuidle.c
 @@ -179,7 +179,9 @@ void cpuidle_reflect(struct cpuidle_device *dev, int 
 index)
  void cpuidle_install_idle_handler(void)
  {
 if (enabled_devices) {
 -   /* Make sure all changes finished before we switch to new 
 idle */
 +   /*
 +* Make sure all changes finished before we switch to new 
 idle
 +*/
 smp_wmb();
 initialized = 1;
 }
 @@ -204,7 +206,6 @@ void cpuidle_pause_and_lock(void)
 mutex_lock(cpuidle_lock);
 cpuidle_uninstall_idle_handler();
  }
 -
  EXPORT_SYMBOL_GPL(cpuidle_pause_and_lock);

  /**
 @@ -215,7 +216,6 @@ void cpuidle_resume_and_unlock(void)
 cpuidle_install_idle_handler();
 mutex_unlock(cpuidle_lock);
  }
 -
  EXPORT_SYMBOL_GPL(cpuidle_resume_and_unlock);

  /* Currently used in suspend/resume path to suspend cpuidle */
 @@ -267,9 +267,11 @@ int cpuidle_enable_device(struct cpuidle_device *dev)
 if (ret)
 return ret;

 -   if (cpuidle_curr_governor-enable 
 -   (ret = cpuidle_curr_governor-enable(drv, dev)))
 -   goto fail_sysfs;
 +   if (cpuidle_curr_governor-enable) {
 +   ret = cpuidle_curr_governor-enable(drv, dev);
 +   if (ret)
 +   goto fail_sysfs;
 +   }

 smp_wmb();

 @@ -283,7 +285,6 @@ fail_sysfs:

 return ret;
  }
 -
  EXPORT_SYMBOL_GPL(cpuidle_enable_device);

  /**
 @@ -311,7 +312,6 @@ void cpuidle_disable_device(struct cpuidle_device *dev)
 cpuidle_remove_device_sysfs(dev);
 enabled_devices--;
  }
 -
  EXPORT_SYMBOL_GPL(cpuidle_disable_device);

  static void __cpuidle_unregister_device(struct cpuidle_device *dev)
 @@ -399,7 +399,6 @@ out_unregister:
 __cpuidle_unregister_device(dev);
 goto out_unlock;
  }
 -
  EXPORT_SYMBOL_GPL(cpuidle_register_device);

  /**
 @@ -423,7 +422,6 @@ void cpuidle_unregister_device(struct cpuidle_device 
 *dev)

 cpuidle_resume_and_unlock();
  }
 -
  EXPORT_SYMBOL_GPL(cpuidle_unregister_device);

  /**
 --
 1.7.9.5




 --
 Thanks and Regards
 Pramod



-- 
Thanks and Regards
Pramod
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] cpuidle: Fix Coding style reported by checkpatch.pl

2014-07-14 Thread Rafael J. Wysocki
On Monday, July 14, 2014 12:40:24 PM pramod gurav wrote:
 Hi Rafael,
 
 Can we consider these changes if there are  no issues with this?

Well, are you fixing checkpatch.pl warnings just for the sake of
this or is there a deeper reason?

Rafael


 On Fri, Jun 20, 2014 at 4:28 PM, pramod gurav
 pramod.gurav@gmail.com wrote:
  +linux-pm
 
  On Fri, Jun 20, 2014 at 4:27 PM, Pramod Gurav
  pramod.gurav@gmail.com wrote:
  Fixed: ERROR: do not use assignment in if condition
  Fixed: WARNING: EXPORT_SYMBOL should immediately follow its function
  Fixed: WARNING: line over 80 characters in a comment
 
  CC: Rafael J. Wysocki r...@rjwysocki.net
  CC: Daniel Lezcano daniel.lezc...@linaro.org
 
  Signed-off-by: Pramod Gurav pramod.gurav@gmail.com
  ---
   drivers/cpuidle/cpuidle.c |   18 --
   1 file changed, 8 insertions(+), 10 deletions(-)
 
  diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
  index 8236746..2c8752e 100644
  --- a/drivers/cpuidle/cpuidle.c
  +++ b/drivers/cpuidle/cpuidle.c
  @@ -179,7 +179,9 @@ void cpuidle_reflect(struct cpuidle_device *dev, int 
  index)
   void cpuidle_install_idle_handler(void)
   {
  if (enabled_devices) {
  -   /* Make sure all changes finished before we switch to new 
  idle */
  +   /*
  +* Make sure all changes finished before we switch to new 
  idle
  +*/
  smp_wmb();
  initialized = 1;
  }
  @@ -204,7 +206,6 @@ void cpuidle_pause_and_lock(void)
  mutex_lock(cpuidle_lock);
  cpuidle_uninstall_idle_handler();
   }
  -
   EXPORT_SYMBOL_GPL(cpuidle_pause_and_lock);
 
   /**
  @@ -215,7 +216,6 @@ void cpuidle_resume_and_unlock(void)
  cpuidle_install_idle_handler();
  mutex_unlock(cpuidle_lock);
   }
  -
   EXPORT_SYMBOL_GPL(cpuidle_resume_and_unlock);
 
   /* Currently used in suspend/resume path to suspend cpuidle */
  @@ -267,9 +267,11 @@ int cpuidle_enable_device(struct cpuidle_device *dev)
  if (ret)
  return ret;
 
  -   if (cpuidle_curr_governor-enable 
  -   (ret = cpuidle_curr_governor-enable(drv, dev)))
  -   goto fail_sysfs;
  +   if (cpuidle_curr_governor-enable) {
  +   ret = cpuidle_curr_governor-enable(drv, dev);
  +   if (ret)
  +   goto fail_sysfs;
  +   }
 
  smp_wmb();
 
  @@ -283,7 +285,6 @@ fail_sysfs:
 
  return ret;
   }
  -
   EXPORT_SYMBOL_GPL(cpuidle_enable_device);
 
   /**
  @@ -311,7 +312,6 @@ void cpuidle_disable_device(struct cpuidle_device *dev)
  cpuidle_remove_device_sysfs(dev);
  enabled_devices--;
   }
  -
   EXPORT_SYMBOL_GPL(cpuidle_disable_device);
 
   static void __cpuidle_unregister_device(struct cpuidle_device *dev)
  @@ -399,7 +399,6 @@ out_unregister:
  __cpuidle_unregister_device(dev);
  goto out_unlock;
   }
  -
   EXPORT_SYMBOL_GPL(cpuidle_register_device);
 
   /**
  @@ -423,7 +422,6 @@ void cpuidle_unregister_device(struct cpuidle_device 
  *dev)
 
  cpuidle_resume_and_unlock();
   }
  -
   EXPORT_SYMBOL_GPL(cpuidle_unregister_device);
 
   /**
  --
  1.7.9.5
 
 
 
 
  --
  Thanks and Regards
  Pramod
 
 
 
 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] cpuidle: Fix Coding style reported by checkpatch.pl

2014-07-14 Thread pramod gurav
On Mon, Jul 14, 2014 at 11:38 PM, Rafael J. Wysocki r...@rjwysocki.net wrote:
 On Monday, July 14, 2014 12:40:24 PM pramod gurav wrote:
 Hi Rafael,

 Can we consider these changes if there are  no issues with this?

 Well, are you fixing checkpatch.pl warnings just for the sake of
 this or is there a deeper reason?


I was browsing through the source code and found couple of them. Then
ran checkpatch.pl to see if there are more. And thought the error
Fixed: ERROR: do not use assignment in if condition must be fixed.
Otherwise there is no reason.

 Rafael


 On Fri, Jun 20, 2014 at 4:28 PM, pramod gurav
 pramod.gurav@gmail.com wrote:
  +linux-pm
 
  On Fri, Jun 20, 2014 at 4:27 PM, Pramod Gurav
  pramod.gurav@gmail.com wrote:
  Fixed: ERROR: do not use assignment in if condition
  Fixed: WARNING: EXPORT_SYMBOL should immediately follow its function
  Fixed: WARNING: line over 80 characters in a comment
 
  CC: Rafael J. Wysocki r...@rjwysocki.net
  CC: Daniel Lezcano daniel.lezc...@linaro.org
 
  Signed-off-by: Pramod Gurav pramod.gurav@gmail.com
  ---
   drivers/cpuidle/cpuidle.c |   18 --
   1 file changed, 8 insertions(+), 10 deletions(-)
 
  diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
  index 8236746..2c8752e 100644
  --- a/drivers/cpuidle/cpuidle.c
  +++ b/drivers/cpuidle/cpuidle.c
  @@ -179,7 +179,9 @@ void cpuidle_reflect(struct cpuidle_device *dev, int 
  index)
   void cpuidle_install_idle_handler(void)
   {
  if (enabled_devices) {
  -   /* Make sure all changes finished before we switch to new 
  idle */
  +   /*
  +* Make sure all changes finished before we switch to new 
  idle
  +*/
  smp_wmb();
  initialized = 1;
  }
  @@ -204,7 +206,6 @@ void cpuidle_pause_and_lock(void)
  mutex_lock(cpuidle_lock);
  cpuidle_uninstall_idle_handler();
   }
  -
   EXPORT_SYMBOL_GPL(cpuidle_pause_and_lock);
 
   /**
  @@ -215,7 +216,6 @@ void cpuidle_resume_and_unlock(void)
  cpuidle_install_idle_handler();
  mutex_unlock(cpuidle_lock);
   }
  -
   EXPORT_SYMBOL_GPL(cpuidle_resume_and_unlock);
 
   /* Currently used in suspend/resume path to suspend cpuidle */
  @@ -267,9 +267,11 @@ int cpuidle_enable_device(struct cpuidle_device *dev)
  if (ret)
  return ret;
 
  -   if (cpuidle_curr_governor-enable 
  -   (ret = cpuidle_curr_governor-enable(drv, dev)))
  -   goto fail_sysfs;
  +   if (cpuidle_curr_governor-enable) {
  +   ret = cpuidle_curr_governor-enable(drv, dev);
  +   if (ret)
  +   goto fail_sysfs;
  +   }
 
  smp_wmb();
 
  @@ -283,7 +285,6 @@ fail_sysfs:
 
  return ret;
   }
  -
   EXPORT_SYMBOL_GPL(cpuidle_enable_device);
 
   /**
  @@ -311,7 +312,6 @@ void cpuidle_disable_device(struct cpuidle_device 
  *dev)
  cpuidle_remove_device_sysfs(dev);
  enabled_devices--;
   }
  -
   EXPORT_SYMBOL_GPL(cpuidle_disable_device);
 
   static void __cpuidle_unregister_device(struct cpuidle_device *dev)
  @@ -399,7 +399,6 @@ out_unregister:
  __cpuidle_unregister_device(dev);
  goto out_unlock;
   }
  -
   EXPORT_SYMBOL_GPL(cpuidle_register_device);
 
   /**
  @@ -423,7 +422,6 @@ void cpuidle_unregister_device(struct cpuidle_device 
  *dev)
 
  cpuidle_resume_and_unlock();
   }
  -
   EXPORT_SYMBOL_GPL(cpuidle_unregister_device);
 
   /**
  --
  1.7.9.5
 
 
 
 
  --
  Thanks and Regards
  Pramod





 --
 I speak only for myself.
 Rafael J. Wysocki, Intel Open Source Technology Center.



-- 
Thanks and Regards
Pramod
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] cpuidle: Fix Coding style reported by checkpatch.pl

2014-06-20 Thread pramod gurav
+linux-pm

On Fri, Jun 20, 2014 at 4:27 PM, Pramod Gurav
 wrote:
> Fixed: ERROR: do not use assignment in if condition
> Fixed: WARNING: EXPORT_SYMBOL should immediately follow its function
> Fixed: WARNING: line over 80 characters in a comment
>
> CC: Rafael J. Wysocki 
> CC: Daniel Lezcano 
>
> Signed-off-by: Pramod Gurav 
> ---
>  drivers/cpuidle/cpuidle.c |   18 --
>  1 file changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
> index 8236746..2c8752e 100644
> --- a/drivers/cpuidle/cpuidle.c
> +++ b/drivers/cpuidle/cpuidle.c
> @@ -179,7 +179,9 @@ void cpuidle_reflect(struct cpuidle_device *dev, int 
> index)
>  void cpuidle_install_idle_handler(void)
>  {
> if (enabled_devices) {
> -   /* Make sure all changes finished before we switch to new 
> idle */
> +   /*
> +* Make sure all changes finished before we switch to new idle
> +*/
> smp_wmb();
> initialized = 1;
> }
> @@ -204,7 +206,6 @@ void cpuidle_pause_and_lock(void)
> mutex_lock(_lock);
> cpuidle_uninstall_idle_handler();
>  }
> -
>  EXPORT_SYMBOL_GPL(cpuidle_pause_and_lock);
>
>  /**
> @@ -215,7 +216,6 @@ void cpuidle_resume_and_unlock(void)
> cpuidle_install_idle_handler();
> mutex_unlock(_lock);
>  }
> -
>  EXPORT_SYMBOL_GPL(cpuidle_resume_and_unlock);
>
>  /* Currently used in suspend/resume path to suspend cpuidle */
> @@ -267,9 +267,11 @@ int cpuidle_enable_device(struct cpuidle_device *dev)
> if (ret)
> return ret;
>
> -   if (cpuidle_curr_governor->enable &&
> -   (ret = cpuidle_curr_governor->enable(drv, dev)))
> -   goto fail_sysfs;
> +   if (cpuidle_curr_governor->enable) {
> +   ret = cpuidle_curr_governor->enable(drv, dev);
> +   if (ret)
> +   goto fail_sysfs;
> +   }
>
> smp_wmb();
>
> @@ -283,7 +285,6 @@ fail_sysfs:
>
> return ret;
>  }
> -
>  EXPORT_SYMBOL_GPL(cpuidle_enable_device);
>
>  /**
> @@ -311,7 +312,6 @@ void cpuidle_disable_device(struct cpuidle_device *dev)
> cpuidle_remove_device_sysfs(dev);
> enabled_devices--;
>  }
> -
>  EXPORT_SYMBOL_GPL(cpuidle_disable_device);
>
>  static void __cpuidle_unregister_device(struct cpuidle_device *dev)
> @@ -399,7 +399,6 @@ out_unregister:
> __cpuidle_unregister_device(dev);
> goto out_unlock;
>  }
> -
>  EXPORT_SYMBOL_GPL(cpuidle_register_device);
>
>  /**
> @@ -423,7 +422,6 @@ void cpuidle_unregister_device(struct cpuidle_device *dev)
>
> cpuidle_resume_and_unlock();
>  }
> -
>  EXPORT_SYMBOL_GPL(cpuidle_unregister_device);
>
>  /**
> --
> 1.7.9.5
>



-- 
Thanks and Regards
Pramod
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] cpuidle: Fix Coding style reported by checkpatch.pl

2014-06-20 Thread pramod gurav
+linux-pm

On Fri, Jun 20, 2014 at 4:27 PM, Pramod Gurav
pramod.gurav@gmail.com wrote:
 Fixed: ERROR: do not use assignment in if condition
 Fixed: WARNING: EXPORT_SYMBOL should immediately follow its function
 Fixed: WARNING: line over 80 characters in a comment

 CC: Rafael J. Wysocki r...@rjwysocki.net
 CC: Daniel Lezcano daniel.lezc...@linaro.org

 Signed-off-by: Pramod Gurav pramod.gurav@gmail.com
 ---
  drivers/cpuidle/cpuidle.c |   18 --
  1 file changed, 8 insertions(+), 10 deletions(-)

 diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
 index 8236746..2c8752e 100644
 --- a/drivers/cpuidle/cpuidle.c
 +++ b/drivers/cpuidle/cpuidle.c
 @@ -179,7 +179,9 @@ void cpuidle_reflect(struct cpuidle_device *dev, int 
 index)
  void cpuidle_install_idle_handler(void)
  {
 if (enabled_devices) {
 -   /* Make sure all changes finished before we switch to new 
 idle */
 +   /*
 +* Make sure all changes finished before we switch to new idle
 +*/
 smp_wmb();
 initialized = 1;
 }
 @@ -204,7 +206,6 @@ void cpuidle_pause_and_lock(void)
 mutex_lock(cpuidle_lock);
 cpuidle_uninstall_idle_handler();
  }
 -
  EXPORT_SYMBOL_GPL(cpuidle_pause_and_lock);

  /**
 @@ -215,7 +216,6 @@ void cpuidle_resume_and_unlock(void)
 cpuidle_install_idle_handler();
 mutex_unlock(cpuidle_lock);
  }
 -
  EXPORT_SYMBOL_GPL(cpuidle_resume_and_unlock);

  /* Currently used in suspend/resume path to suspend cpuidle */
 @@ -267,9 +267,11 @@ int cpuidle_enable_device(struct cpuidle_device *dev)
 if (ret)
 return ret;

 -   if (cpuidle_curr_governor-enable 
 -   (ret = cpuidle_curr_governor-enable(drv, dev)))
 -   goto fail_sysfs;
 +   if (cpuidle_curr_governor-enable) {
 +   ret = cpuidle_curr_governor-enable(drv, dev);
 +   if (ret)
 +   goto fail_sysfs;
 +   }

 smp_wmb();

 @@ -283,7 +285,6 @@ fail_sysfs:

 return ret;
  }
 -
  EXPORT_SYMBOL_GPL(cpuidle_enable_device);

  /**
 @@ -311,7 +312,6 @@ void cpuidle_disable_device(struct cpuidle_device *dev)
 cpuidle_remove_device_sysfs(dev);
 enabled_devices--;
  }
 -
  EXPORT_SYMBOL_GPL(cpuidle_disable_device);

  static void __cpuidle_unregister_device(struct cpuidle_device *dev)
 @@ -399,7 +399,6 @@ out_unregister:
 __cpuidle_unregister_device(dev);
 goto out_unlock;
  }
 -
  EXPORT_SYMBOL_GPL(cpuidle_register_device);

  /**
 @@ -423,7 +422,6 @@ void cpuidle_unregister_device(struct cpuidle_device *dev)

 cpuidle_resume_and_unlock();
  }
 -
  EXPORT_SYMBOL_GPL(cpuidle_unregister_device);

  /**
 --
 1.7.9.5




-- 
Thanks and Regards
Pramod
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/