Skip to content

Commit

Permalink
[media] dib8000: Properly represent long long integers
Browse files Browse the repository at this point in the history
When compiling with avr32, it gets those errors:

	drivers/media/dvb-frontends/dib8000.c: In function 'dib8000_get_stats':
	drivers/media/dvb-frontends/dib8000.c:4121: warning: integer constant is too large for 'long' type

Fix integer representation to avoid overflow.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
  • Loading branch information
Mauro Carvalho Chehab committed Jan 13, 2014
1 parent 6fcd3b6 commit 5dc8526
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/media/dvb-frontends/dib8000.c
Original file line number Diff line number Diff line change
Expand Up @@ -4118,7 +4118,7 @@ static int dib8000_get_stats(struct dvb_frontend *fe, fe_status_t stat)
/* Get UCB measures */
dib8000_read_unc_blocks(fe, &val);
if (val < state->init_ucb)
state->init_ucb += 0x100000000L;
state->init_ucb += 0x100000000LL;

c->block_error.stat[0].scale = FE_SCALE_COUNTER;
c->block_error.stat[0].uvalue = val + state->init_ucb;
Expand All @@ -4128,7 +4128,7 @@ static int dib8000_get_stats(struct dvb_frontend *fe, fe_status_t stat)
time_us = dib8000_get_time_us(fe, -1);

if (time_us) {
blocks = 1250000UL * 1000000UL;
blocks = 1250000ULL * 1000000ULL;
do_div(blocks, time_us * 8 * 204);
c->block_count.stat[0].scale = FE_SCALE_COUNTER;
c->block_count.stat[0].uvalue += blocks;
Expand Down Expand Up @@ -4191,7 +4191,7 @@ static int dib8000_get_stats(struct dvb_frontend *fe, fe_status_t stat)
if (!time_us)
time_us = dib8000_get_time_us(fe, i);
if (time_us) {
blocks = 1250000UL * 1000000UL;
blocks = 1250000ULL * 1000000ULL;
do_div(blocks, time_us * 8 * 204);
c->block_count.stat[0].scale = FE_SCALE_COUNTER;
c->block_count.stat[0].uvalue += blocks;
Expand Down

0 comments on commit 5dc8526

Please sign in to comment.