[v5,02/10] mfd: intel-m10-bmc: Rename the local variables

Message ID 20221226175849.13056-3-ilpo.jarvinen@linux.intel.com
State New
Headers
Series intel-m10-bmc: Split BMC to core and SPI parts & add PMCI+N6000 support |

Commit Message

Ilpo Järvinen Dec. 26, 2022, 5:58 p.m. UTC
  Local variables directly interact with dev_get_drvdata/dev_set_drvdata
should be named ddata.

Co-developed-by: Tianfei zhang <tianfei.zhang@intel.com>
Signed-off-by: Tianfei zhang <tianfei.zhang@intel.com>
Reviewed-by: Russ Weight <russell.h.weight@intel.com>
Reviewed-by: Xu Yilun <yilun.xu@intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/mfd/intel-m10-bmc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
  

Comments

Lee Jones Jan. 9, 2023, 6:07 p.m. UTC | #1
On Mon, 26 Dec 2022, Ilpo Järvinen wrote:

> Local variables directly interact with dev_get_drvdata/dev_set_drvdata
> should be named ddata.
> 
> Co-developed-by: Tianfei zhang <tianfei.zhang@intel.com>

It took 2 people to rename some variables? :)

> Signed-off-by: Tianfei zhang <tianfei.zhang@intel.com>
> Reviewed-by: Russ Weight <russell.h.weight@intel.com>
> Reviewed-by: Xu Yilun <yilun.xu@intel.com>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> ---
>  drivers/mfd/intel-m10-bmc.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mfd/intel-m10-bmc.c b/drivers/mfd/intel-m10-bmc.c
> index 12c522c16d83..2c26203c4799 100644
> --- a/drivers/mfd/intel-m10-bmc.c
> +++ b/drivers/mfd/intel-m10-bmc.c
> @@ -81,15 +81,15 @@ static DEVICE_ATTR_RO(bmcfw_version);
>  static ssize_t mac_address_show(struct device *dev,
>  				struct device_attribute *attr, char *buf)
>  {
> -	struct intel_m10bmc *max10 = dev_get_drvdata(dev);
> +	struct intel_m10bmc *ddata = dev_get_drvdata(dev);

In general I'm all for the use of 'ddata' for driver data.

For my own reference (apply this as-is to your sign-off block):
                                                       
Acked-for-MFD-by: Lee Jones <lee@kernel.org>

>  	unsigned int macaddr_low, macaddr_high;
>  	int ret;
>  
> -	ret = m10bmc_sys_read(max10, M10BMC_MAC_LOW, &macaddr_low);
> +	ret = m10bmc_sys_read(ddata, M10BMC_MAC_LOW, &macaddr_low);
>  	if (ret)
>  		return ret;
>  
> -	ret = m10bmc_sys_read(max10, M10BMC_MAC_HIGH, &macaddr_high);
> +	ret = m10bmc_sys_read(ddata, M10BMC_MAC_HIGH, &macaddr_high);
>  	if (ret)
>  		return ret;
>  
> @@ -106,11 +106,11 @@ static DEVICE_ATTR_RO(mac_address);
>  static ssize_t mac_count_show(struct device *dev,
>  			      struct device_attribute *attr, char *buf)
>  {
> -	struct intel_m10bmc *max10 = dev_get_drvdata(dev);
> +	struct intel_m10bmc *ddata = dev_get_drvdata(dev);
>  	unsigned int macaddr_high;
>  	int ret;
>  
> -	ret = m10bmc_sys_read(max10, M10BMC_MAC_HIGH, &macaddr_high);
> +	ret = m10bmc_sys_read(ddata, M10BMC_MAC_HIGH, &macaddr_high);
>  	if (ret)
>  		return ret;
>  
> -- 
> 2.30.2
>
  
Ilpo Järvinen Jan. 9, 2023, 6:17 p.m. UTC | #2
On Mon, 9 Jan 2023, Lee Jones wrote:

> On Mon, 26 Dec 2022, Ilpo Järvinen wrote:
> 
> > Local variables directly interact with dev_get_drvdata/dev_set_drvdata
> > should be named ddata.
> > 
> > Co-developed-by: Tianfei zhang <tianfei.zhang@intel.com>
> 
> It took 2 people to rename some variables? :)

It took one person to rename the variables, and other to prepare it into a 
series which required some changes to the original patch (which is when 
I added my SoB). But I can remove Tianfei (Andy mentioned earlier for 
simple changes it's okay).
  
Lee Jones Jan. 10, 2023, 10:13 a.m. UTC | #3
On Mon, 09 Jan 2023, Ilpo Järvinen wrote:

> On Mon, 9 Jan 2023, Lee Jones wrote:
> 
> > On Mon, 26 Dec 2022, Ilpo Järvinen wrote:
> > 
> > > Local variables directly interact with dev_get_drvdata/dev_set_drvdata
> > > should be named ddata.
> > > 
> > > Co-developed-by: Tianfei zhang <tianfei.zhang@intel.com>
> > 
> > It took 2 people to rename some variables? :)
> 
> It took one person to rename the variables, and other to prepare it into a 
> series which required some changes to the original patch (which is when 
> I added my SoB). But I can remove Tianfei (Andy mentioned earlier for 
> simple changes it's okay).

It's not a blocker.  I just found it humorous. :)

> > > Signed-off-by: Tianfei zhang <tianfei.zhang@intel.com>
> > > Reviewed-by: Russ Weight <russell.h.weight@intel.com>
> > > Reviewed-by: Xu Yilun <yilun.xu@intel.com>
> > > Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> > > ---
> > >  drivers/mfd/intel-m10-bmc.c | 10 +++++-----
> > >  1 file changed, 5 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/drivers/mfd/intel-m10-bmc.c b/drivers/mfd/intel-m10-bmc.c
> > > index 12c522c16d83..2c26203c4799 100644
> > > --- a/drivers/mfd/intel-m10-bmc.c
> > > +++ b/drivers/mfd/intel-m10-bmc.c
> > > @@ -81,15 +81,15 @@ static DEVICE_ATTR_RO(bmcfw_version);
> > >  static ssize_t mac_address_show(struct device *dev,
> > >  				struct device_attribute *attr, char *buf)
> > >  {
> > > -	struct intel_m10bmc *max10 = dev_get_drvdata(dev);
> > > +	struct intel_m10bmc *ddata = dev_get_drvdata(dev);
> > 
> > In general I'm all for the use of 'ddata' for driver data.
> > 
> > For my own reference (apply this as-is to your sign-off block):
> >                                                        
> > Acked-for-MFD-by: Lee Jones <lee@kernel.org>
  

Patch

diff --git a/drivers/mfd/intel-m10-bmc.c b/drivers/mfd/intel-m10-bmc.c
index 12c522c16d83..2c26203c4799 100644
--- a/drivers/mfd/intel-m10-bmc.c
+++ b/drivers/mfd/intel-m10-bmc.c
@@ -81,15 +81,15 @@  static DEVICE_ATTR_RO(bmcfw_version);
 static ssize_t mac_address_show(struct device *dev,
 				struct device_attribute *attr, char *buf)
 {
-	struct intel_m10bmc *max10 = dev_get_drvdata(dev);
+	struct intel_m10bmc *ddata = dev_get_drvdata(dev);
 	unsigned int macaddr_low, macaddr_high;
 	int ret;
 
-	ret = m10bmc_sys_read(max10, M10BMC_MAC_LOW, &macaddr_low);
+	ret = m10bmc_sys_read(ddata, M10BMC_MAC_LOW, &macaddr_low);
 	if (ret)
 		return ret;
 
-	ret = m10bmc_sys_read(max10, M10BMC_MAC_HIGH, &macaddr_high);
+	ret = m10bmc_sys_read(ddata, M10BMC_MAC_HIGH, &macaddr_high);
 	if (ret)
 		return ret;
 
@@ -106,11 +106,11 @@  static DEVICE_ATTR_RO(mac_address);
 static ssize_t mac_count_show(struct device *dev,
 			      struct device_attribute *attr, char *buf)
 {
-	struct intel_m10bmc *max10 = dev_get_drvdata(dev);
+	struct intel_m10bmc *ddata = dev_get_drvdata(dev);
 	unsigned int macaddr_high;
 	int ret;
 
-	ret = m10bmc_sys_read(max10, M10BMC_MAC_HIGH, &macaddr_high);
+	ret = m10bmc_sys_read(ddata, M10BMC_MAC_HIGH, &macaddr_high);
 	if (ret)
 		return ret;