[linux-yocto] [PATCH 14/57] LSIAXM55xx: Checkpatch updates to patch 'Various performance fixes for rapidio'

Bruce Ashfield bruce.ashfield at windriver.com
Tue Mar 18 14:32:27 PDT 2014


This should be squashed into the previous commit. No sense introducing it,
and then fixing it.

Bruce

On 14-03-18 12:56 AM, Charlie Paul wrote:
> Signed-off-by: Chaarlie Paul <charlie.paul at windriver.com>
> ---
>   drivers/rapidio/devices/lsi/axxia-rio-irq.c |   34 +++++++++---------
>   drivers/rapidio/devices/lsi/axxia-rio-irq.h |    6 ++--
>   drivers/rapidio/devices/lsi/axxia-rio.c     |   50 ++++++++++++---------------
>   drivers/rapidio/devices/lsi/axxia-rio.h     |    4 +--
>   4 files changed, 45 insertions(+), 49 deletions(-)
>
> diff --git a/drivers/rapidio/devices/lsi/axxia-rio-irq.c b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
> index b26ed60..f26adac 100644
> --- a/drivers/rapidio/devices/lsi/axxia-rio-irq.c
> +++ b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
> @@ -434,9 +434,8 @@ int alloc_irq_handler(struct rio_irq_handler *h,
>   		mask |= h->irq_state_mask;
>   		__rio_local_write_config_32(mport, h->irq_enab_reg_addr, mask);
>   	}
> -	if (h->irq_enab_reg_addr) {
> +	if (h->irq_enab_reg_addr)
>   		__rio_local_write_config_32(mport, h->irq_state_reg_addr, mask);
> -	}
>
>   	return rc;
>   }
> @@ -505,8 +504,10 @@ static inline void __misc_fatal(struct rio_mport *mport,
>   	__rio_local_read_config_32(mport, EPC_IECSR(priv->portNdx), &iecsr);
>
>   	/* clear latched state indications */
> -	__rio_local_write_config_32(mport, RIO_ESCSR(priv->portNdx), (escsr & RIO_EXCSR_WOLR));
> -	__rio_local_write_config_32(mport, EPC_IECSR(priv->portNdx), (iecsr & EPC_IECSR_RETE));
> +	__rio_local_write_config_32(mport,
> +			RIO_ESCSR(priv->portNdx), (escsr & RIO_EXCSR_WOLR));
> +	__rio_local_write_config_32(mport,
> +			EPC_IECSR(priv->portNdx), (iecsr & EPC_IECSR_RETE));
>
>   #if defined(CONFIG_AXXIA_RIO_STAT)
>   	__add_event_dbg(priv, escsr, iecsr);
> @@ -917,15 +918,14 @@ static void release_dme(struct kref *kref)
>
>   	if (me->desc) {
>   		for (i = 0, desc = me->desc; i < me->entries; i++, desc++) {
> -			if (desc->msg_virt)
> +			if (desc->msg_virt != NULL)
>   				kfree(desc->msg_virt);
>   		}
>   		kfree(me->desc);
>   	}
>
> -	if (me->descriptors) {
> +	if (me->descriptors != NULL)
>   		kfree(me->descriptors);
> -	}
>
>   	if (!priv->internalDesc) {
>   		if (me->dres.parent)
> @@ -954,7 +954,7 @@ static inline int check_dme(int dme_no,
>   			    int *dmes)
>   {
>   	int i;
> -	for (i=0; i < 2; i++) {
> +	for (i = 0; i < 2; i++) {
>   		if (dme_no < numDmes[i]) {
>   			if (dmes[i] & (1 << dme_no)) {
>   				if (dmesInUse[i] & (1 << dme_no))
> @@ -976,7 +976,7 @@ static inline int select_dme(int dme_no,
>   			     int value)
>   {
>   	int i;
> -	for (i=0; i < 2; i++) {
> +	for (i = 0; i < 2; i++) {
>   		if (dme_no < numDmes[i]) {
>   			dmesInUse[i] &= ~(1 << dme_no);
>   			dmesInUse[i] |= (value << dme_no);
> @@ -998,8 +998,8 @@ static inline int choose_ob_dme(
>   	int i, j, ret = 0;
>
>   	/* Find an OB DME that is enabled and which has empty slots */
> -	for(j=0; j < 2; j++) {
> -		for(i=0; i < priv->numOutbDmes[j]; i++) {
> +	for (j = 0; j < 2; j++) {
> +		for (i = 0; i < priv->numOutbDmes[j]; i++) {
>   			int sz = RIO_OUTB_DME_TO_BUF_SIZE(priv, i);
>   			struct rio_irq_handler *h = &priv->ob_dme_irq[i];
>   			struct rio_msg_dme *dme = h->data;
> @@ -1048,7 +1048,7 @@ static void release_mbox(struct kref *kref)
>
>   	priv->ib_dme_irq[mb->mbox_no].irq_state_mask = 0;
>
> -	if (mb->virt_buffer)
> +	if (mb->virt_buffer != NULL)
>   		kfree(mb->virt_buffer);
>
>   	kfree(mb);
> @@ -1106,7 +1106,8 @@ static struct rio_msg_dme *alloc_message_engine(struct rio_mport *mport,
>   	me->desc = kzalloc(sizeof(struct rio_msg_desc) * entries, GFP_KERNEL);
>   	if (!me->desc)
>   		goto err;
> -	me->descriptors = kzalloc(sizeof(struct rio_desc) * entries, GFP_KERNEL);
> +	me->descriptors = kzalloc(sizeof(struct rio_desc) *
> +			entries, GFP_KERNEL);
>   	if (!me->descriptors)
>   		goto err;
>   	me->entries = entries;
> @@ -1595,7 +1596,7 @@ static void ib_dme_irq_handler(struct rio_irq_handler *h, u32 state)
>   				}
>   				if (!(dw0 & DME_DESC_DW0_VALID)) {
>   					__ib_dme_event_dbg(priv, dme_no,
> -							   1 << RIO_IB_DME_RX_PENDING_AT_SLEEP);
> +							1 << RIO_IB_DME_RX_PENDING_AT_SLEEP);
>   #ifdef STRICT_INB_ORDERING
>   					inval++;
>   					pr_warn("RIO: Inbound Message engine %d disabled\n RIO: Receive buffer ring is corrupt\n",
> @@ -1888,7 +1889,8 @@ void axxia_rio_port_get_state(struct rio_mport *mport, int cleanup)
>   	__rio_local_read_config_32(mport, RIO_ESCSR(priv->portNdx), &escsr);
>   	__rio_local_read_config_32(mport, EPC_IECSR(priv->portNdx), &iecsr);
>
> -	__rio_local_write_config_32(mport, RIO_ESCSR(priv->portNdx), (escsr & RIO_EXCSR_WOLR));
> +	__rio_local_write_config_32(mport, RIO_ESCSR(priv->portNdx),
> +			(escsr & RIO_EXCSR_WOLR));
>   #if defined(CONFIG_AXXIA_RIO_STAT)
>   	__add_state_dbg(priv, escsr);
>   	if (!(escsr & RIO_ESCSR_PO)) /* Port is down */
> @@ -2166,7 +2168,7 @@ int axxia_add_outb_message(struct rio_mport *mport, struct rio_dev *rdev,
>   	    (mbox_dest >= RIO_MAX_TX_MBOX))
>   		return -EINVAL;
>
> -        dme = choose_ob_dme(priv, len, &mb, &buf_sz);
> +	dme = choose_ob_dme(priv, len, &mb, &buf_sz);
>   	if (dme < 0) {
>   		rc = dme;
>   		return rc;
> diff --git a/drivers/rapidio/devices/lsi/axxia-rio-irq.h b/drivers/rapidio/devices/lsi/axxia-rio-irq.h
> index 961d93b..f80ca93 100644
> --- a/drivers/rapidio/devices/lsi/axxia-rio-irq.h
> +++ b/drivers/rapidio/devices/lsi/axxia-rio-irq.h
> @@ -165,7 +165,7 @@ enum rio_ob_dme_dbg {
>   						     descriptor builds */
>   #define	RIO_MBOX_TO_BUF_SIZE(mid)		\
>   	((mid <= RIO_MAX_RX_MBOX_4KB) ? RIO_MSG_MULTI_SIZE : RIO_MSG_SEG_SIZE)
> -#define	RIO_OUTB_DME_TO_BUF_SIZE(p,did)		\
> +#define	RIO_OUTB_DME_TO_BUF_SIZE(p, did)		\
>   	((did < p->numOutbDmes[0]) ? RIO_MSG_MULTI_SIZE : RIO_MSG_SEG_SIZE)
>
>   #define DME_MAX_IB_ENGINES          32
> @@ -307,9 +307,7 @@ void axxia_rio_port_irq_disable(struct rio_mport *mport);
>   /* Data_streaming - add function declaration as axxia-rio-ds.c
>   **                  calls this function as well */
>   int alloc_irq_handler(
> -	struct rio_irq_handler *h,
> -        void *data,
> -        const char *name);
> +	struct rio_irq_handler *h, void *data, const char *name);
>
>   void release_irq_handler(struct rio_irq_handler *h);
>
> diff --git a/drivers/rapidio/devices/lsi/axxia-rio.c b/drivers/rapidio/devices/lsi/axxia-rio.c
> index becdb1c..8dbe58d 100644
> --- a/drivers/rapidio/devices/lsi/axxia-rio.c
> +++ b/drivers/rapidio/devices/lsi/axxia-rio.c
> @@ -193,8 +193,7 @@ static int __axxia_local_config_write_actual(struct rio_priv *priv,
>   						priv->regs_win_paged +
>   						(offset & 0x7ff)));
>   	} else {
> -		dev_err(priv->dev, "RIO: Trying to write to config register "
> -				   "not specified for AXIA (0x%8.8x)\n",
> +		dev_err(priv->dev, "RIO: Trying to write to config register not specified for AXIA (0x%8.8x)\n",
>   			offset);
>   	}
>
> @@ -310,8 +309,7 @@ static int axxia_rio_config_read(struct rio_mport *mport, int index,
>   				       0);
>
>   	if (TTYPE_VAL(ctrl)) { /* Not maintenance */
> -		dev_err(priv->dev, "(%s): Window is not setup for Maintenance "
> -				   "operations. 0x%8.8x\n",
> +		dev_err(priv->dev, "(%s): Window is not setup for Maintenance operations. 0x%8.8x\n",
>   			__func__, ctrl);
>   		AXXIA_RIO_ENABLE_MACHINE_CHECK();
>   		return -EINVAL;
> @@ -791,8 +789,7 @@ void axxia_rio_set_mport_disc_mode(struct rio_mport *mport)
>   		__rio_local_write_config_32(mport,
>   					    EPC_PNADIDCSR(priv->portNdx),
>   					    result);
> -		dev_dbg(priv->dev, "Port%dAltDevIdmCSR set to 0x%X for "
> -			"main port\n",
> +		dev_dbg(priv->dev, "Port%dAltDevIdmCSR set to 0x%X for main port\n",
>   			priv->portNdx, CONFIG_RAPIDIO_SECOND_DEST_ID);
>   	}
>   #else
> @@ -810,8 +807,7 @@ void axxia_rio_set_mport_disc_mode(struct rio_mport *mport)
>   		__rio_local_write_config_32(mport,
>   					    EPC_PNADIDCSR(priv->portNdx),
>   					    result);
> -		dev_dbg(priv->dev, "Port%dAltDevIdmCSR set to 0x%X for "
> -			"main port\n",
> +		dev_dbg(priv->dev, "Port%dAltDevIdmCSR set to 0x%X for main port\n",
>   			priv->portNdx, result);
>   	}
>   #endif
> @@ -854,7 +850,7 @@ static void axxia_init_port_data(struct rio_mport *mport)
>   		__rio_local_read_config_32(mport, RIO_DEV_ID_CAR, &devid);
>   		__rio_local_read_config_32(mport, RAB_CTRL, &data);
>   		priv->internalDesc = (data & 0x00001000) ? 1 : 0;
> -		for (i=0; i < 2; i++) {
> +		for (i = 0; i < 2; i++) {
>   			if (devid == legacyids[i])
>   				priv->internalDesc = 1;
>   		}
> @@ -965,7 +961,7 @@ static int rio_start_port(struct rio_mport *mport)
>   	{
>   		u32 hdlcsr, didcar, rabver;
>
> -		__rio_local_read_config_32(mport,RIO_HOST_DID_LOCK_CSR,&hdlcsr);
> +		__rio_local_read_config_32(mport, RIO_HOST_DID_LOCK_CSR, &hdlcsr);
>   		__rio_local_read_config_32(mport, RIO_DEV_ID_CAR, &didcar);
>   		__rio_local_read_config_32(mport, RAB_VER, &rabver);
>
> @@ -974,8 +970,7 @@ static int rio_start_port(struct rio_mport *mport)
>   			__LINE__,
>   			RIO_DEV_ID_CAR, didcar,
>   			RAB_VER, rabver);
> -		printk("rio[%d]: AR[%d] CCSR[%x]=%08x ESCSR[%x]=%08x "
> -		      "HBDIDLCSR[%x]=%08x\n",
> +		pr_info("rio[%d]: AR[%d] CCSR[%x]=%08x ESCSR[%x]=%08x HBDIDLCSR[%x]=%08x\n",
>   			mport->id,
>   			__LINE__,
>   			RIO_CCSR(priv->portNdx), ccsr,
> @@ -1132,12 +1127,12 @@ static int rio_parse_dtb(
>
>   	if (!of_device_is_available(dev->dev.of_node)) {
>   		IODP("rio[%d]: AR[%d] status = not available\n", 99, __LINE__);
> -	        return -ENODEV;
> +		return -ENODEV;
>   	} else {
>   		IODP("rio[%d]: AR[%d] status = available\n", 99, __LINE__);
>   	}
>
> -        if (of_property_read_u32(dev->dev.of_node, "index", &rlen))
> +	if (of_property_read_u32(dev->dev.of_node, "index", &rlen))
>   		return -ENODEV;
>   	*ndx = rlen;
>
> @@ -1162,20 +1157,20 @@ static int rio_parse_dtb(
>
>   	/* Get node address wide */
>   	cell = of_get_property(dev->dev.of_node, "#address-cells", NULL);
> -	if (cell) {
> +	if (cell)
>   		aw = *cell;
> -	} else {
> +	else
>   		aw = of_n_addr_cells(dev->dev.of_node);
> -	}
> +
>   	if (aw > 3)			/* Anomaly in A15 build+parse */
>   		aw = 2;
>   	/* Get node size wide */
>   	cell = of_get_property(dev->dev.of_node, "#size-cells", NULL);
> -	if (cell) {
> +	if (cell)
>   		sw = *cell;
> -	} else {
> +	else
>   		sw = of_n_size_cells(dev->dev.of_node);
> -	}
> +
>   	if (sw > 3)			/* Anomaly in A15 build+parse */
>   		sw = 2;
>   	/* Get parent address wide wide */
> @@ -1502,7 +1497,8 @@ static struct rio_priv *rio_priv_dtb_setup(
>   			rc = -ENOMEM;
>   			goto err_linkdown;
>   		}
> -		IODP("rio[%d]: LDR win=%p\n", mport->id, priv->linkdown_reset.win);
> +		IODP("rio[%d]: LDR win=%p\n",
> +				mport->id, priv->linkdown_reset.win);
>   	}
>
>   	return priv;
> @@ -1671,12 +1667,12 @@ static int axxia_rio_setup(struct platform_device *dev)
>   #endif
>
>   	/* Data_streaming */
> -        if (ds_dtb_info.ds_enabled == 1) {
> -                rc = axxia_cfg_ds(mport, &ds_dtb_info);
> -                if (rc)
> -                        goto err_mport;
> -                axxia_rio_ds_port_irq_init(mport);
> -        }
> +	if (ds_dtb_info.ds_enabled == 1) {
> +		rc = axxia_cfg_ds(mport, &ds_dtb_info);
> +		if (rc)
> +			goto err_mport;
> +		axxia_rio_ds_port_irq_init(mport);
> +	}
>
>   	/* Register port with core driver
>   	 */
> diff --git a/drivers/rapidio/devices/lsi/axxia-rio.h b/drivers/rapidio/devices/lsi/axxia-rio.h
> index e13c8ac..4d751d5 100644
> --- a/drivers/rapidio/devices/lsi/axxia-rio.h
> +++ b/drivers/rapidio/devices/lsi/axxia-rio.h
> @@ -511,11 +511,11 @@ struct rio_priv {
>
>   	/* Chip-specific DME availability */
>   	int numOutbDmes[2];	/* [0]=MSeg, [1]=Sseg */
> -        int outbDmesInUse[2];
> +	int outbDmesInUse[2];
>   	int outbDmes[2];	/* set of defined outbound DMEs:
>   				 *   [0]=MSeg, [1]=SSeg */
>   	int numInbDmes[2];	/* [0]=MSeg, [1]=Sseg */
> -        int inbDmesInUse[2];
> +	int inbDmesInUse[2];
>   	int inbDmes[2];		/* set of defined inbound DMEs */
>
>   	/* Linkdown Reset; Trigger via SRDS STAT1 */
>



More information about the linux-yocto mailing list