Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f67102c4 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[media] mb86a20s: remove global BER/PER counters if per-layer counters vanish



If, for any reason, all per-layers counters stop, remove the
corresponding global counter.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent d9b6f08a
Loading
Loading
Loading
Loading
+9 −3
Original line number Original line Diff line number Diff line
@@ -1604,7 +1604,6 @@ static int mb86a20s_get_stats(struct dvb_frontend *fe)
					"%s: Can't get BER for layer %c (error %d).\n",
					"%s: Can't get BER for layer %c (error %d).\n",
					__func__, 'A' + i, rc);
					__func__, 'A' + i, rc);
			}
			}

			if (c->block_error.stat[1 + i].scale != FE_SCALE_NOT_AVAILABLE)
			if (c->block_error.stat[1 + i].scale != FE_SCALE_NOT_AVAILABLE)
				pre_ber_layers++;
				pre_ber_layers++;


@@ -1627,7 +1626,6 @@ static int mb86a20s_get_stats(struct dvb_frontend *fe)
					"%s: Can't get BER for layer %c (error %d).\n",
					"%s: Can't get BER for layer %c (error %d).\n",
					__func__, 'A' + i, rc);
					__func__, 'A' + i, rc);
			}
			}

			if (c->block_error.stat[1 + i].scale != FE_SCALE_NOT_AVAILABLE)
			if (c->block_error.stat[1 + i].scale != FE_SCALE_NOT_AVAILABLE)
				post_ber_layers++;
				post_ber_layers++;


@@ -1652,7 +1650,6 @@ static int mb86a20s_get_stats(struct dvb_frontend *fe)
					__func__, 'A' + i, rc);
					__func__, 'A' + i, rc);


			}
			}

			if (c->block_error.stat[1 + i].scale != FE_SCALE_NOT_AVAILABLE)
			if (c->block_error.stat[1 + i].scale != FE_SCALE_NOT_AVAILABLE)
				per_layers++;
				per_layers++;


@@ -1686,6 +1683,9 @@ static int mb86a20s_get_stats(struct dvb_frontend *fe)
		c->pre_bit_error.stat[0].uvalue = t_pre_bit_error;
		c->pre_bit_error.stat[0].uvalue = t_pre_bit_error;
		c->pre_bit_count.stat[0].scale = FE_SCALE_COUNTER;
		c->pre_bit_count.stat[0].scale = FE_SCALE_COUNTER;
		c->pre_bit_count.stat[0].uvalue = t_pre_bit_count;
		c->pre_bit_count.stat[0].uvalue = t_pre_bit_count;
	} else {
		c->pre_bit_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
		c->pre_bit_count.stat[0].scale = FE_SCALE_COUNTER;
	}
	}


	/*
	/*
@@ -1704,6 +1704,9 @@ static int mb86a20s_get_stats(struct dvb_frontend *fe)
		c->post_bit_error.stat[0].uvalue = t_post_bit_error;
		c->post_bit_error.stat[0].uvalue = t_post_bit_error;
		c->post_bit_count.stat[0].scale = FE_SCALE_COUNTER;
		c->post_bit_count.stat[0].scale = FE_SCALE_COUNTER;
		c->post_bit_count.stat[0].uvalue = t_post_bit_count;
		c->post_bit_count.stat[0].uvalue = t_post_bit_count;
	} else {
		c->post_bit_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
		c->post_bit_count.stat[0].scale = FE_SCALE_COUNTER;
	}
	}


	if (per_layers) {
	if (per_layers) {
@@ -1718,6 +1721,9 @@ static int mb86a20s_get_stats(struct dvb_frontend *fe)
		c->block_error.stat[0].uvalue = t_block_error;
		c->block_error.stat[0].uvalue = t_block_error;
		c->block_count.stat[0].scale = FE_SCALE_COUNTER;
		c->block_count.stat[0].scale = FE_SCALE_COUNTER;
		c->block_count.stat[0].uvalue = t_block_count;
		c->block_count.stat[0].uvalue = t_block_count;
	} else {
		c->block_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
		c->block_count.stat[0].scale = FE_SCALE_COUNTER;
	}
	}


	return rc;
	return rc;