Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] dvb_demux: convert an internal ifdef into a Kconfig option

There are some ifdefs inside the dvb_demux that are meant to
enable advanced debug capabilities, at the cost of being very
verbose.

Keeping those as internal ifdefs is a very bad idea, as it
doesn't make easy to check if the code there was broken by
some patch. So, let's add an explicit Kconfig option for it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

+18 -9
+13
drivers/media/dvb-core/Kconfig
··· 27 27 will be required to manage the device nodes. 28 28 29 29 If you are unsure about this, say N here. 30 + 31 + config DVB_DEMUX_SECTION_LOSS_LOG 32 + bool "Enable DVB demux section packet loss log" 33 + depends on DVB_CORE 34 + default n 35 + help 36 + Enable extra log messages meant to detect packet loss 37 + inside the Kernel. 38 + 39 + Should not be enabled on normal cases, as logs can 40 + be very verbose. 41 + 42 + If you are unsure about this, say N here.
+5 -9
drivers/media/dvb-core/dvb_demux.c
··· 37 37 #include "dvb_demux.h" 38 38 39 39 #define NOBUFS 40 - /* 41 - ** #define DVB_DEMUX_SECTION_LOSS_LOG to monitor payload loss in the syslog 42 - */ 43 - // #define DVB_DEMUX_SECTION_LOSS_LOG 44 40 45 41 static int dvb_demux_tscheck; 46 42 module_param(dvb_demux_tscheck, int, 0644); ··· 190 194 { 191 195 struct dmx_section_feed *sec = &feed->feed.sec; 192 196 193 - #ifdef DVB_DEMUX_SECTION_LOSS_LOG 197 + #ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG 194 198 if (sec->secbufp < sec->tsfeedp) { 195 199 int i, n = sec->tsfeedp - sec->secbufp; 196 200 ··· 243 247 return 0; 244 248 245 249 if (sec->tsfeedp + len > DMX_MAX_SECFEED_SIZE) { 246 - #ifdef DVB_DEMUX_SECTION_LOSS_LOG 250 + #ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG 247 251 dprintk("dvb_demux.c section buffer full loss: %d/%d\n", 248 252 sec->tsfeedp + len - DMX_MAX_SECFEED_SIZE, 249 253 DMX_MAX_SECFEED_SIZE); ··· 277 281 /* dump [secbuf .. secbuf+seclen) */ 278 282 if (feed->pusi_seen) 279 283 dvb_dmx_swfilter_section_feed(feed); 280 - #ifdef DVB_DEMUX_SECTION_LOSS_LOG 284 + #ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG 281 285 else 282 286 dprintk("dvb_demux.c pusi not seen, discarding section data\n"); 283 287 #endif ··· 313 317 } 314 318 315 319 if (!ccok || dc_i) { 316 - #ifdef DVB_DEMUX_SECTION_LOSS_LOG 320 + #ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG 317 321 dprintk("dvb_demux.c discontinuity detected %d bytes lost\n", 318 322 count); 319 323 /* ··· 345 349 dvb_dmx_swfilter_section_copy_dump(feed, after, 346 350 after_len); 347 351 } 348 - #ifdef DVB_DEMUX_SECTION_LOSS_LOG 352 + #ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG 349 353 else if (count > 0) 350 354 dprintk("dvb_demux.c PUSI=1 but %d bytes lost\n", 351 355 count);