]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
PM / OPP rename 'head' as 'rcu_head' or 'srcu_head' based on its type
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 25 Nov 2014 10:34:16 +0000 (16:04 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 29 Nov 2014 22:53:20 +0000 (23:53 +0100)
Both 'struct dev_pm_opp' and 'struct device_opp' have member with name 'head'
but with different types. This leads to confusion while reading the code.

Name them 'rcu_head' and 'srcu_head'.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/opp.c

index 89ced955fafa92dd7eb6d6b58b5fae78669f8710..76ae6fd28345d250f20304cfbf7a126f6d6cbe9e 100644 (file)
@@ -53,7 +53,7 @@
  * @rate:      Frequency in hertz
  * @u_volt:    Nominal voltage in microvolts corresponding to this OPP
  * @dev_opp:   points back to the device_opp struct this opp belongs to
- * @head:      RCU callback head used for deferred freeing
+ * @rcu_head:  RCU callback head used for deferred freeing
  *
  * This structure stores the OPP information for a given device.
  */
@@ -65,7 +65,7 @@ struct dev_pm_opp {
        unsigned long u_volt;
 
        struct device_opp *dev_opp;
-       struct rcu_head head;
+       struct rcu_head rcu_head;
 };
 
 /**
@@ -76,7 +76,7 @@ struct dev_pm_opp {
  *             RCU usage: nodes are not modified in the list of device_opp,
  *             however addition is possible and is secured by dev_opp_list_lock
  * @dev:       device pointer
- * @head:      notifier head to notify the OPP availability changes.
+ * @srcu_head: notifier head to notify the OPP availability changes.
  * @opp_list:  list of opps
  *
  * This is an internal data structure maintaining the link to opps attached to
@@ -87,7 +87,7 @@ struct device_opp {
        struct list_head node;
 
        struct device *dev;
-       struct srcu_notifier_head head;
+       struct srcu_notifier_head srcu_head;
        struct list_head opp_list;
 };
 
@@ -436,7 +436,7 @@ int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
                }
 
                dev_opp->dev = dev;
-               srcu_init_notifier_head(&dev_opp->head);
+               srcu_init_notifier_head(&dev_opp->srcu_head);
                INIT_LIST_HEAD(&dev_opp->opp_list);
 
                /* Secure the device list modification */
@@ -481,7 +481,7 @@ int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
         * Notify the changes in the availability of the operable
         * frequency/voltage list.
         */
-       srcu_notifier_call_chain(&dev_opp->head, OPP_EVENT_ADD, new_opp);
+       srcu_notifier_call_chain(&dev_opp->srcu_head, OPP_EVENT_ADD, new_opp);
        return 0;
 }
 EXPORT_SYMBOL_GPL(dev_pm_opp_add);
@@ -557,14 +557,14 @@ static int opp_set_availability(struct device *dev, unsigned long freq,
 
        list_replace_rcu(&opp->node, &new_opp->node);
        mutex_unlock(&dev_opp_list_lock);
-       kfree_rcu(opp, head);
+       kfree_rcu(opp, rcu_head);
 
        /* Notify the change of the OPP availability */
        if (availability_req)
-               srcu_notifier_call_chain(&dev_opp->head, OPP_EVENT_ENABLE,
+               srcu_notifier_call_chain(&dev_opp->srcu_head, OPP_EVENT_ENABLE,
                                         new_opp);
        else
-               srcu_notifier_call_chain(&dev_opp->head, OPP_EVENT_DISABLE,
+               srcu_notifier_call_chain(&dev_opp->srcu_head, OPP_EVENT_DISABLE,
                                         new_opp);
 
        return 0;
@@ -629,7 +629,7 @@ struct srcu_notifier_head *dev_pm_opp_get_notifier(struct device *dev)
        if (IS_ERR(dev_opp))
                return ERR_CAST(dev_opp); /* matching type */
 
-       return &dev_opp->head;
+       return &dev_opp->srcu_head;
 }
 
 #ifdef CONFIG_OF