public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
To: "Jasmin J." <jasmin@anw.at>
Cc: linux-media@vger.kernel.org, max.kellermann@gmail.com
Subject: Re: [PATCH 01/11] [media] dvb-core/dvb_ca_en50221.c: Rename STATUSREG_??
Date: Mon, 8 May 2017 06:55:45 -0300	[thread overview]
Message-ID: <20170508065545.52b26fc9@vento.lan> (raw)
In-Reply-To: <1494192214-20082-2-git-send-email-jasmin@anw.at>

Em Sun,  7 May 2017 23:23:24 +0200
"Jasmin J." <jasmin@anw.at> escreveu:

> From: Jasmin Jessich <jasmin@anw.at>
> 
> Rename STATUSREG_?? -> STATREG_?? to reduce the line length.

That sounds a bad idea. We use "stat" on the DVB subsystem as an
alias for statistics.

> 
> Signed-off-by: Jasmin Jessich <jasmin@anw.at>
> ---
>  drivers/media/dvb-core/dvb_ca_en50221.c | 34 ++++++++++++++++-----------------
>  1 file changed, 17 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c
> index cc709c9..b978246 100644
> --- a/drivers/media/dvb-core/dvb_ca_en50221.c
> +++ b/drivers/media/dvb-core/dvb_ca_en50221.c
> @@ -72,11 +72,11 @@ MODULE_PARM_DESC(cam_debug, "enable verbose debug messages");
>  #define CMDREG_DAIE   0x80	/* Enable DA interrupt */
>  #define IRQEN (CMDREG_DAIE)
>  
> -#define STATUSREG_RE     1	/* read error */
> -#define STATUSREG_WE     2	/* write error */
> -#define STATUSREG_FR  0x40	/* module free */
> -#define STATUSREG_DA  0x80	/* data available */
> -#define STATUSREG_TXERR (STATUSREG_RE|STATUSREG_WE)	/* general transfer error */
> +#define STATREG_RE     1	/* read error */
> +#define STATREG_WE     2	/* write error */
> +#define STATREG_FR  0x40	/* module free */
> +#define STATREG_DA  0x80	/* data available */
> +#define STATREG_TXERR (STATREG_RE|STATREG_WE)	/* general transfer error */
>  
>  
>  #define DVB_CA_SLOTSTATE_NONE           0
> @@ -347,7 +347,7 @@ static int dvb_ca_en50221_link_init(struct dvb_ca_private *ca, int slot)
>  	/* read the buffer size from the CAM */
>  	if ((ret = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_COMMAND, IRQEN | CMDREG_SR)) != 0)
>  		return ret;
> -	if ((ret = dvb_ca_en50221_wait_if_status(ca, slot, STATUSREG_DA, HZ)) != 0)
> +	if ((ret = dvb_ca_en50221_wait_if_status(ca, slot, STATREG_DA, HZ)) != 0)
>  		return ret;
>  	if ((ret = dvb_ca_en50221_read_data(ca, slot, buf, 2)) != 2)
>  		return -EIO;
> @@ -366,7 +366,7 @@ static int dvb_ca_en50221_link_init(struct dvb_ca_private *ca, int slot)
>  	/* write the buffer size to the CAM */
>  	if ((ret = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_COMMAND, IRQEN | CMDREG_SW)) != 0)
>  		return ret;
> -	if ((ret = dvb_ca_en50221_wait_if_status(ca, slot, STATUSREG_FR, HZ / 10)) != 0)
> +	if ((ret = dvb_ca_en50221_wait_if_status(ca, slot, STATREG_FR, HZ / 10)) != 0)
>  		return ret;
>  	if ((ret = dvb_ca_en50221_write_data(ca, slot, buf, 2)) != 2)
>  		return -EIO;
> @@ -661,7 +661,7 @@ static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot, u8 * eb
>  		/* check if there is data available */
>  		if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0)
>  			goto exit;
> -		if (!(status & STATUSREG_DA)) {
> +		if (!(status & STATREG_DA)) {
>  			/* no data */
>  			status = 0;
>  			goto exit;
> @@ -713,7 +713,7 @@ static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot, u8 * eb
>  		/* check for read error (RE should now be 0) */
>  		if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0)
>  			goto exit;
> -		if (status & STATUSREG_RE) {
> +		if (status & STATREG_RE) {
>  			ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_LINKINIT;
>  			status = -EIO;
>  			goto exit;
> @@ -778,8 +778,8 @@ static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot, u8 * b
>  	   process the data if necessary. */
>  	if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0)
>  		goto exitnowrite;
> -	if (status & (STATUSREG_DA | STATUSREG_RE)) {
> -		if (status & STATUSREG_DA)
> +	if (status & (STATREG_DA | STATREG_RE)) {
> +		if (status & STATREG_DA)
>  			dvb_ca_en50221_thread_wakeup(ca);
>  
>  		status = -EAGAIN;
> @@ -794,7 +794,7 @@ static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot, u8 * b
>  	/* check if interface is still free */
>  	if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0)
>  		goto exit;
> -	if (!(status & STATUSREG_FR)) {
> +	if (!(status & STATREG_FR)) {
>  		/* it wasn't free => try again later */
>  		status = -EAGAIN;
>  		goto exit;
> @@ -815,8 +815,8 @@ static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot, u8 * b
>  	if (status < 0)
>  		goto exit;
>  
> -	if (status & (STATUSREG_DA | STATUSREG_RE)) {
> -		if (status & STATUSREG_DA)
> +	if (status & (STATREG_DA | STATREG_RE)) {
> +		if (status & STATREG_DA)
>  			dvb_ca_en50221_thread_wakeup(ca);
>  
>  		status = -EAGAIN;
> @@ -839,7 +839,7 @@ static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot, u8 * b
>  	/* check for write error (WE should now be 0) */
>  	if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0)
>  		goto exit;
> -	if (status & STATUSREG_WE) {
> +	if (status & STATREG_WE) {
>  		ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_LINKINIT;
>  		status = -EIO;
>  		goto exit;
> @@ -952,7 +952,7 @@ void dvb_ca_en50221_frda_irq(struct dvb_ca_en50221 *pubca, int slot)
>  	switch (ca->slot_info[slot].slot_state) {
>  	case DVB_CA_SLOTSTATE_LINKINIT:
>  		flags = ca->pub->read_cam_control(pubca, slot, CTRLIF_STATUS);
> -		if (flags & STATUSREG_DA) {
> +		if (flags & STATREG_DA) {
>  			dprintk("CAM supports DA IRQ\n");
>  			ca->slot_info[slot].da_irq_supported = 1;
>  		}
> @@ -1166,7 +1166,7 @@ static int dvb_ca_en50221_thread(void *data)
>  				}
>  
>  				flags = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS);
> -				if (flags & STATUSREG_FR) {
> +				if (flags & STATREG_FR) {
>  					ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_LINKINIT;
>  					ca->wakeup = 1;
>  				}



Thanks,
Mauro

  reply	other threads:[~2017-05-08  9:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-07 21:23 [PATCH 00/11] Fix coding style in en50221 CAM functions Jasmin J.
2017-05-07 21:23 ` [PATCH 01/11] [media] dvb-core/dvb_ca_en50221.c: Rename STATUSREG_?? Jasmin J.
2017-05-08  9:55   ` Mauro Carvalho Chehab [this message]
2017-05-08 17:28     ` Jasmin J.
2017-06-07 16:43       ` Mauro Carvalho Chehab
2017-06-07 19:37         ` Jasmin J.
2017-06-07 22:59           ` Mauro Carvalho Chehab
2017-06-08 18:55             ` Jasmin J.
2017-05-07 21:23 ` [PATCH 02/11] [media] dvb-core/dvb_ca_en50221.c: Rename DVB_CA_SLOTSTATE_??? Jasmin J.
2017-05-07 21:23 ` [PATCH 03/11] [media] dvb-core/dvb_ca_en50221.c: Used a helper variable Jasmin J.
2017-05-07 21:23 ` [PATCH 04/11] [media] dvb-core/dvb_ca_en50221.c: Refactored dvb_ca_en50221_thread Jasmin J.
2017-05-07 21:23 ` [PATCH 05/11] [media] dvb-core/dvb_ca_en50221.c: Make checkpatch happy 1 Jasmin J.
2017-05-07 21:23 ` [PATCH 06/11] [media] dvb-core/dvb_ca_en50221.c: Make checkpatch happy 2 Jasmin J.
2017-05-07 21:23 ` [PATCH 07/11] [media] dvb-core/dvb_ca_en50221.c: Make checkpatch happy 3 Jasmin J.
2017-05-07 21:23 ` [PATCH 08/11] [media] dvb-core/dvb_ca_en50221.c: Make checkpatch happy 4 Jasmin J.
2017-05-07 21:23 ` [PATCH 09/11] [media] dvb-core/dvb_ca_en50221.c: Make checkpatch happy 5 Jasmin J.
2017-05-07 21:23 ` [PATCH 10/11] [media] dvb-core/dvb_ca_en50221.c: Make checkpatch happy 6 Jasmin J.
2017-05-07 21:23 ` [PATCH 11/11] [media] dvb-core/dvb_ca_en50221.c: Fixed wrong EXPORT_SYMBOL order Jasmin J.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170508065545.52b26fc9@vento.lan \
    --to=mchehab@s-opensource.com \
    --cc=jasmin@anw.at \
    --cc=linux-media@vger.kernel.org \
    --cc=max.kellermann@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox