Commit f54def5b authored by Sean Young's avatar Sean Young Committed by Mauro Carvalho Chehab
Browse files

media: dib0070: incorrect format specifiers detected by clang



drivers/media/dvb-frontends/dib0070.c:192:52: warning: format specifies type 'short' but the argument has type 's8' (aka 'signed char') [-Wformat]
                dprintk("CAPTRIM=%hd; ADC = %hd (ADC) & %dmV\n", state->captrim, adc, (u32) adc*(u32)1800/(u32)1024);
                                 ~~~                             ^~~~~~~~~~~~~~
                                 %hhd
drivers/media/dvb-frontends/dib0070.c:30:22: note: expanded from macro 'dprintk'
                       __func__, ##arg);                                \
                                   ^~~
drivers/media/dvb-frontends/dib0070.c:203:59: warning: format specifies type 'short' but the argument has type 's8' (aka 'signed char') [-Wformat]
                        dprintk("CAPTRIM=%hd is closer to target (%hd/%hd)\n", state->captrim, adc, state->adc_diff);
                                         ~~~                                   ^~~~~~~~~~~~~~
                                         %hhd
drivers/media/dvb-frontends/dib0070.c:30:22: note: expanded from macro 'dprintk'
                       __func__, ##arg);                                \
                                   ^~~
drivers/media/dvb-frontends/dib0070.c:367:46: warning: format specifies type 'short' but the argument has type 'u8' (aka 'unsigned char') [-Wformat]
                dprintk("Tuning for Band: %hd (%d kHz)\n", band, freq);
                                          ~~~              ^~~~
                                          %hhu
drivers/media/dvb-frontends/dib0070.c:30:22: note: expanded from macro 'dprintk'
                       __func__, ##arg);                                \
                                   ^~~
drivers/media/dvb-frontends/dib0070.c:445:39: warning: format specifies type 'short' but the argument has type 'u8' (aka 'unsigned char') [-Wformat]
                        dprintk("REFDIV: %hd, FREF: %d\n", REFDIV, FREF);
                                         ~~~               ^~~~~~
                                         %hhu
drivers/media/dvb-frontends/dib0070.c:30:22: note: expanded from macro 'dprintk'
                       __func__, ##arg);                                \
                                   ^~~
drivers/media/dvb-frontends/dib0070.c:447:57: warning: format specifies type 'short' but the argument has type 'u8' (aka 'unsigned char') [-Wformat]
                        dprintk("Num: %hd, Den: %hd, SD: %hd\n", (u16) Rest, Den, (state->lo4 >> 12) & 0x1);
                                                ~~~                          ^~~
                                                %hhu
drivers/media/dvb-frontends/dib0070.c:30:22: note: expanded from macro 'dprintk'
                       __func__, ##arg);                                \
                                   ^~~
drivers/media/dvb-frontends/dib0070.c:447:62: warning: format specifies type 'short' but the argument has type 'int' [-Wformat]
                        dprintk("Num: %hd, Den: %hd, SD: %hd\n", (u16) Rest, Den, (state->lo4 >> 12) & 0x1);
                                                         ~~~                      ^~~~~~~~~~~~~~~~~~~~~~~~
                                                         %d
drivers/media/dvb-frontends/dib0070.c:30:22: note: expanded from macro 'dprintk'
                       __func__, ##arg);                                \
                                   ^~~
drivers/media/dvb-frontends/dib0070.c:448:33: warning: format specifies type 'short' but the argument has type 'u8' (aka 'unsigned char') [-Wformat]
                        dprintk("HFDIV code: %hd\n", state->current_tune_table_index->hfdiv);
                                             ~~~     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                             %hhu
drivers/media/dvb-frontends/dib0070.c:30:22: note: expanded from macro 'dprintk'
                       __func__, ##arg);                                \
                                   ^~~
drivers/media/dvb-frontends/dib0070.c:449:27: warning: format specifies type 'short' but the argument has type 'u8' (aka 'unsigned char') [-Wformat]
                        dprintk("VCO = %hd\n", state->current_tune_table_index->vco_band);
                                       ~~~     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                       %hhu
drivers/media/dvb-frontends/dib0070.c:30:22: note: expanded from macro 'dprintk'
                       __func__, ##arg);                                \
                                   ^~~
drivers/media/dvb-frontends/dib0070.c:450:40: warning: format specifies type 'short' but the argument has type 'u8' (aka 'unsigned char') [-Wformat]
                        dprintk("VCOF: ((%hd*%d) << 1))\n", state->current_tune_table_index->vco_multi, freq);
                                         ~~~                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                         %hhu
drivers/media/dvb-frontends/dib0070.c:30:22: note: expanded from macro 'dprintk'
                       __func__, ##arg);                                \
                                   ^~~

Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 4ec14f24
Loading
Loading
Loading
Loading
+15 −8
Original line number Diff line number Diff line
@@ -189,7 +189,8 @@ static int dib0070_captrim(struct dib0070_state *state, enum frontend_tune_state

		adc = dib0070_read_reg(state, 0x19);

		dprintk("CAPTRIM=%hd; ADC = %hd (ADC) & %dmV\n", state->captrim, adc, (u32) adc*(u32)1800/(u32)1024);
		dprintk("CAPTRIM=%d; ADC = %hd (ADC) & %dmV\n", state->captrim,
			adc, (u32)adc * (u32)1800 / (u32)1024);

		if (adc >= 400) {
			adc -= 400;
@@ -200,7 +201,8 @@ static int dib0070_captrim(struct dib0070_state *state, enum frontend_tune_state
		}

		if (adc < state->adc_diff) {
			dprintk("CAPTRIM=%hd is closer to target (%hd/%hd)\n", state->captrim, adc, state->adc_diff);
			dprintk("CAPTRIM=%d is closer to target (%hd/%hd)\n",
				state->captrim, adc, state->adc_diff);
			state->adc_diff = adc;
			state->fcaptrim = state->captrim;
		}
@@ -364,7 +366,7 @@ static int dib0070_tune_digital(struct dvb_frontend *fe)
	}

	if (*tune_state == CT_TUNER_START) {
		dprintk("Tuning for Band: %hd (%d kHz)\n", band, freq);
		dprintk("Tuning for Band: %d (%d kHz)\n", band, freq);
		if (state->current_rf != freq) {
			u8 REFDIV;
			u32 FBDiv, Rest, FREF, VCOF_kHz;
@@ -442,12 +444,17 @@ static int dib0070_tune_digital(struct dvb_frontend *fe)
			dib0070_write_reg(state, 0x20,
				0x0040 | 0x0020 | 0x0010 | 0x0008 | 0x0002 | 0x0001 | state->current_tune_table_index->tuner_enable);

			dprintk("REFDIV: %hd, FREF: %d\n", REFDIV, FREF);
			dprintk("REFDIV: %u, FREF: %d\n", REFDIV, FREF);
			dprintk("FBDIV: %d, Rest: %d\n", FBDiv, Rest);
			dprintk("Num: %hd, Den: %hd, SD: %hd\n", (u16) Rest, Den, (state->lo4 >> 12) & 0x1);
			dprintk("HFDIV code: %hd\n", state->current_tune_table_index->hfdiv);
			dprintk("VCO = %hd\n", state->current_tune_table_index->vco_band);
			dprintk("VCOF: ((%hd*%d) << 1))\n", state->current_tune_table_index->vco_multi, freq);
			dprintk("Num: %u, Den: %u, SD: %d\n", (u16)Rest, Den,
				(state->lo4 >> 12) & 0x1);
			dprintk("HFDIV code: %u\n",
				state->current_tune_table_index->hfdiv);
			dprintk("VCO = %u\n",
				state->current_tune_table_index->vco_band);
			dprintk("VCOF: ((%u*%d) << 1))\n",
				state->current_tune_table_index->vco_multi,
				freq);

			*tune_state = CT_TUNER_STEP_0;
		} else { /* we are already tuned to this frequency - the configuration is correct  */