All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dvb_frontend: initialize variable s with FE_NONE instead of 0
@ 2017-07-21 16:01 Colin King
  2017-07-21 18:05 ` Shuah Khan
  2017-07-23 23:07 ` kbuild test robot
  0 siblings, 2 replies; 4+ messages in thread
From: Colin King @ 2017-07-21 16:01 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Max Kellermann, Ingo Molnar,
	Markus Elfring, Shuah Khan, Masahiro Yamada, linux-media
  Cc: linux-kernel

From: Colin Ian King <colin.king@canonical.com>

In a previous commit, we added FE_NONE as an unknown fe_status.
Initialize variable s to FE_NONE instead of the more opaque value 0.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/media/dvb-core/dvb_frontend.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
index 18cc3bbc699c..114994ca0929 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -460,7 +460,7 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra
 
 static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
 {
-	enum fe_status s = 0;
+	enum fe_status s = FE_NONE;
 	int retval = 0;
 	struct dvb_frontend_private *fepriv = fe->frontend_priv;
 	struct dtv_frontend_properties *c = &fe->dtv_property_cache, tmp;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] dvb_frontend: initialize variable s with FE_NONE instead of 0
  2017-07-21 16:01 [PATCH] dvb_frontend: initialize variable s with FE_NONE instead of 0 Colin King
@ 2017-07-21 18:05 ` Shuah Khan
  2017-07-21 18:09   ` Colin Ian King
  2017-07-23 23:07 ` kbuild test robot
  1 sibling, 1 reply; 4+ messages in thread
From: Shuah Khan @ 2017-07-21 18:05 UTC (permalink / raw)
  To: Colin King, Mauro Carvalho Chehab, Max Kellermann, Ingo Molnar,
	Markus Elfring, Masahiro Yamada, linux-media
  Cc: Shuah Khan, Shuah Khan

On 07/21/2017 10:01 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> In a previous commit, we added FE_NONE as an unknown fe_status.
> Initialize variable s to FE_NONE instead of the more opaque value 0.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

The change looks good to me.
Reviewed-by: Shuah Khan <shuahkh@osg.samsung.com>

I think this patch should be part of a patch series that includes
the uAPI Documentation change, uAPI change, and the following
patch:

[PATCH][V2] dvb_frontend: ensure that inital front end status initialized

based on Mauro's review comments. Anyway, I will leave it to Mauro to
decide how he wants the patches split and if he is okay with uAPI change.

thanks,
-- Shuah

> ---
>  drivers/media/dvb-core/dvb_frontend.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
> index 18cc3bbc699c..114994ca0929 100644
> --- a/drivers/media/dvb-core/dvb_frontend.c
> +++ b/drivers/media/dvb-core/dvb_frontend.c
> @@ -460,7 +460,7 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra
>  
>  static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
>  {
> -	enum fe_status s = 0;
> +	enum fe_status s = FE_NONE;
>  	int retval = 0;
>  	struct dvb_frontend_private *fepriv = fe->frontend_priv;
>  	struct dtv_frontend_properties *c = &fe->dtv_property_cache, tmp;
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] dvb_frontend: initialize variable s with FE_NONE instead of 0
  2017-07-21 18:05 ` Shuah Khan
@ 2017-07-21 18:09   ` Colin Ian King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin Ian King @ 2017-07-21 18:09 UTC (permalink / raw)
  To: shuah, Mauro Carvalho Chehab, Max Kellermann, Ingo Molnar,
	Markus Elfring, Masahiro Yamada, linux-media
  Cc: Shuah Khan

On 21/07/17 19:05, Shuah Khan wrote:
> On 07/21/2017 10:01 AM, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> In a previous commit, we added FE_NONE as an unknown fe_status.
>> Initialize variable s to FE_NONE instead of the more opaque value 0.
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> 
> The change looks good to me.
> Reviewed-by: Shuah Khan <shuahkh@osg.samsung.com>
> 
> I think this patch should be part of a patch series that includes
> the uAPI Documentation change, uAPI change, and the following
> patch:
> 
> [PATCH][V2] dvb_frontend: ensure that inital front end status initialized
> 
> based on Mauro's review comments. Anyway, I will leave it to Mauro to
> decide how he wants the patches split and if he is okay with uAPI change.
> 

OK, I'm off on vacation very shortly, so I won't be able to respond for
any further resubmissions for a couple of weeks.

> thanks,
> -- Shuah
> 
>> ---
>>  drivers/media/dvb-core/dvb_frontend.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
>> index 18cc3bbc699c..114994ca0929 100644
>> --- a/drivers/media/dvb-core/dvb_frontend.c
>> +++ b/drivers/media/dvb-core/dvb_frontend.c
>> @@ -460,7 +460,7 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra
>>  
>>  static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
>>  {
>> -	enum fe_status s = 0;
>> +	enum fe_status s = FE_NONE;
>>  	int retval = 0;
>>  	struct dvb_frontend_private *fepriv = fe->frontend_priv;
>>  	struct dtv_frontend_properties *c = &fe->dtv_property_cache, tmp;
>>
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] dvb_frontend: initialize variable s with FE_NONE instead of 0
  2017-07-21 16:01 [PATCH] dvb_frontend: initialize variable s with FE_NONE instead of 0 Colin King
  2017-07-21 18:05 ` Shuah Khan
@ 2017-07-23 23:07 ` kbuild test robot
  1 sibling, 0 replies; 4+ messages in thread
From: kbuild test robot @ 2017-07-23 23:07 UTC (permalink / raw)
  To: Colin King
  Cc: kbuild-all, Mauro Carvalho Chehab, Max Kellermann, Ingo Molnar,
	Markus Elfring, Shuah Khan, Masahiro Yamada, linux-media,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 6214 bytes --]

Hi Colin,

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on v4.13-rc1 next-20170721]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Colin-King/dvb_frontend-initialize-variable-s-with-FE_NONE-instead-of-0/20170724-063439
base:   git://linuxtv.org/media_tree.git master
config: i386-randconfig-x019-201730 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/media/dvb-core/dvb_frontend.c: In function 'dvb_frontend_swzigzag':
>> drivers/media/dvb-core/dvb_frontend.c:463:21: error: 'FE_NONE' undeclared (first use in this function)
     enum fe_status s = FE_NONE;
                        ^~~~~~~
   drivers/media/dvb-core/dvb_frontend.c:463:21: note: each undeclared identifier is reported only once for each function it appears in

vim +/FE_NONE +463 drivers/media/dvb-core/dvb_frontend.c

   460	
   461	static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
   462	{
 > 463		enum fe_status s = FE_NONE;
   464		int retval = 0;
   465		struct dvb_frontend_private *fepriv = fe->frontend_priv;
   466		struct dtv_frontend_properties *c = &fe->dtv_property_cache, tmp;
   467	
   468		/* if we've got no parameters, just keep idling */
   469		if (fepriv->state & FESTATE_IDLE) {
   470			fepriv->delay = 3*HZ;
   471			fepriv->quality = 0;
   472			return;
   473		}
   474	
   475		/* in SCAN mode, we just set the frontend when asked and leave it alone */
   476		if (fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT) {
   477			if (fepriv->state & FESTATE_RETUNE) {
   478				tmp = *c;
   479				if (fe->ops.set_frontend)
   480					retval = fe->ops.set_frontend(fe);
   481				*c = tmp;
   482				if (retval < 0)
   483					fepriv->state = FESTATE_ERROR;
   484				else
   485					fepriv->state = FESTATE_TUNED;
   486			}
   487			fepriv->delay = 3*HZ;
   488			fepriv->quality = 0;
   489			return;
   490		}
   491	
   492		/* get the frontend status */
   493		if (fepriv->state & FESTATE_RETUNE) {
   494			s = 0;
   495		} else {
   496			if (fe->ops.read_status)
   497				fe->ops.read_status(fe, &s);
   498			if (s != fepriv->status) {
   499				dvb_frontend_add_event(fe, s);
   500				fepriv->status = s;
   501			}
   502		}
   503	
   504		/* if we're not tuned, and we have a lock, move to the TUNED state */
   505		if ((fepriv->state & FESTATE_WAITFORLOCK) && (s & FE_HAS_LOCK)) {
   506			dvb_frontend_swzigzag_update_delay(fepriv, s & FE_HAS_LOCK);
   507			fepriv->state = FESTATE_TUNED;
   508	
   509			/* if we're tuned, then we have determined the correct inversion */
   510			if ((!(fe->ops.info.caps & FE_CAN_INVERSION_AUTO)) &&
   511			    (c->inversion == INVERSION_AUTO)) {
   512				c->inversion = fepriv->inversion;
   513			}
   514			return;
   515		}
   516	
   517		/* if we are tuned already, check we're still locked */
   518		if (fepriv->state & FESTATE_TUNED) {
   519			dvb_frontend_swzigzag_update_delay(fepriv, s & FE_HAS_LOCK);
   520	
   521			/* we're tuned, and the lock is still good... */
   522			if (s & FE_HAS_LOCK) {
   523				return;
   524			} else { /* if we _WERE_ tuned, but now don't have a lock */
   525				fepriv->state = FESTATE_ZIGZAG_FAST;
   526				fepriv->started_auto_step = fepriv->auto_step;
   527				fepriv->check_wrapped = 0;
   528			}
   529		}
   530	
   531		/* don't actually do anything if we're in the LOSTLOCK state,
   532		 * the frontend is set to FE_CAN_RECOVER, and the max_drift is 0 */
   533		if ((fepriv->state & FESTATE_LOSTLOCK) &&
   534		    (fe->ops.info.caps & FE_CAN_RECOVER) && (fepriv->max_drift == 0)) {
   535			dvb_frontend_swzigzag_update_delay(fepriv, s & FE_HAS_LOCK);
   536			return;
   537		}
   538	
   539		/* don't do anything if we're in the DISEQC state, since this
   540		 * might be someone with a motorized dish controlled by DISEQC.
   541		 * If its actually a re-tune, there will be a SET_FRONTEND soon enough.	*/
   542		if (fepriv->state & FESTATE_DISEQC) {
   543			dvb_frontend_swzigzag_update_delay(fepriv, s & FE_HAS_LOCK);
   544			return;
   545		}
   546	
   547		/* if we're in the RETUNE state, set everything up for a brand
   548		 * new scan, keeping the current inversion setting, as the next
   549		 * tune is _very_ likely to require the same */
   550		if (fepriv->state & FESTATE_RETUNE) {
   551			fepriv->lnb_drift = 0;
   552			fepriv->auto_step = 0;
   553			fepriv->auto_sub_step = 0;
   554			fepriv->started_auto_step = 0;
   555			fepriv->check_wrapped = 0;
   556		}
   557	
   558		/* fast zigzag. */
   559		if ((fepriv->state & FESTATE_SEARCHING_FAST) || (fepriv->state & FESTATE_RETUNE)) {
   560			fepriv->delay = fepriv->min_delay;
   561	
   562			/* perform a tune */
   563			retval = dvb_frontend_swzigzag_autotune(fe,
   564								fepriv->check_wrapped);
   565			if (retval < 0) {
   566				return;
   567			} else if (retval) {
   568				/* OK, if we've run out of trials at the fast speed.
   569				 * Drop back to slow for the _next_ attempt */
   570				fepriv->state = FESTATE_SEARCHING_SLOW;
   571				fepriv->started_auto_step = fepriv->auto_step;
   572				return;
   573			}
   574			fepriv->check_wrapped = 1;
   575	
   576			/* if we've just retuned, enter the ZIGZAG_FAST state.
   577			 * This ensures we cannot return from an
   578			 * FE_SET_FRONTEND ioctl before the first frontend tune
   579			 * occurs */
   580			if (fepriv->state & FESTATE_RETUNE) {
   581				fepriv->state = FESTATE_TUNING_FAST;
   582			}
   583		}
   584	
   585		/* slow zigzag */
   586		if (fepriv->state & FESTATE_SEARCHING_SLOW) {
   587			dvb_frontend_swzigzag_update_delay(fepriv, s & FE_HAS_LOCK);
   588	
   589			/* Note: don't bother checking for wrapping; we stay in this
   590			 * state until we get a lock */
   591			dvb_frontend_swzigzag_autotune(fe, 0);
   592		}
   593	}
   594	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30572 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-07-23 23:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-21 16:01 [PATCH] dvb_frontend: initialize variable s with FE_NONE instead of 0 Colin King
2017-07-21 18:05 ` Shuah Khan
2017-07-21 18:09   ` Colin Ian King
2017-07-23 23:07 ` kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.