[media] dvb: get rid of enum dmx_success

This enum is not actually used anymore. The only value used from
the enum is DMX_OK, passed as a parameter on two callbacks.

Yet, this value is not used anywhere. So, just remove it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
Mauro Carvalho Chehab 2015-10-06 19:53:02 -03:00
parent 4bc645df7d
commit 2f684b239c
8 changed files with 27 additions and 87 deletions

View file

@ -11,20 +11,6 @@ DVB device driver writers. The header file for this API is named <constant>demux
<title>Kernel Demux Data Types</title> <title>Kernel Demux Data Types</title>
<section id="dmx_success_t">
<title>dmx_success_t</title>
<programlisting>
typedef enum {
DMX_OK = 0, /&#x22C6; Received Ok &#x22C6;/
DMX_LENGTH_ERROR, /&#x22C6; Incorrect length &#x22C6;/
DMX_OVERRUN_ERROR, /&#x22C6; Receiver ring buffer overrun &#x22C6;/
DMX_CRC_ERROR, /&#x22C6; Incorrect CRC &#x22C6;/
DMX_FRAME_ERROR, /&#x22C6; Frame alignment error &#x22C6;/
DMX_FIFO_ERROR, /&#x22C6; Receiver FIFO overrun &#x22C6;/
DMX_MISSED_ERROR /&#x22C6; Receiver missed packet &#x22C6;/
} dmx_success_t;
</programlisting>
</section> </section>
<section id="ts_filter_types"> <section id="ts_filter_types">
<title>TS filter types</title> <title>TS filter types</title>
@ -143,22 +129,19 @@ should be kept identical) to the types in the demux device.
size_t buffer1_length, size_t buffer1_length,
__u8 &#x22C6; buffer2, __u8 &#x22C6; buffer2,
size_t buffer2_length, size_t buffer2_length,
dmx_ts_feed_t&#x22C6; source, dmx_ts_feed_t&#x22C6; source)
dmx_success_t success);
typedef int (&#x22C6;dmx_section_cb) ( __u8 &#x22C6; buffer1, typedef int (&#x22C6;dmx_section_cb) ( __u8 &#x22C6; buffer1,
size_t buffer1_len, size_t buffer1_len,
__u8 &#x22C6; buffer2, __u8 &#x22C6; buffer2,
size_t buffer2_len, size_t buffer2_len,
dmx_section_filter_t &#x22C6; source, dmx_section_filter_t &#x22C6; source);
dmx_success_t success);
typedef int (&#x22C6;dmx_pes_cb) ( __u8 &#x22C6; buffer1, typedef int (&#x22C6;dmx_pes_cb) ( __u8 &#x22C6; buffer1,
size_t buffer1_len, size_t buffer1_len,
__u8 &#x22C6; buffer2, __u8 &#x22C6; buffer2,
size_t buffer2_len, size_t buffer2_len,
dmx_pes_filter_t&#x22C6; source, dmx_pes_filter_t&#x22C6; source);
dmx_success_t success);
/&#x22C6;--------------------------------------------------------------------------&#x22C6;/ /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
/&#x22C6; DVB Front-End &#x22C6;/ /&#x22C6; DVB Front-End &#x22C6;/
@ -523,7 +506,7 @@ role="subsection"><title>dmx_ts_cb()</title>
align="char"> align="char">
<para>int dmx_ts_cb(__u8&#x22C6; buffer1, size_t buffer1_length, <para>int dmx_ts_cb(__u8&#x22C6; buffer1, size_t buffer1_length,
__u8&#x22C6; buffer2, size_t buffer2_length, dmx_ts_feed_t&#x22C6; __u8&#x22C6; buffer2, size_t buffer2_length, dmx_ts_feed_t&#x22C6;
source, dmx_success_t success);</para> source);</para>
</entry> </entry>
</row></tbody></tgroup></informaltable> </row></tbody></tgroup></informaltable>
<para>PARAMETERS <para>PARAMETERS
@ -563,14 +546,6 @@ role="subsection"><title>dmx_ts_cb()</title>
</entry><entry </entry><entry
align="char"> align="char">
<para>Indicates which TS feed is the source of the callback.</para> <para>Indicates which TS feed is the source of the callback.</para>
</entry>
</row><row><entry
align="char">
<para>dmx_success_t
success</para>
</entry><entry
align="char">
<para>Indicates if there was an error in TS reception.</para>
</entry> </entry>
</row></tbody></tgroup></informaltable> </row></tbody></tgroup></informaltable>
<para>RETURNS <para>RETURNS
@ -623,8 +598,7 @@ role="subsection"><title>dmx_section_cb()</title>
align="char"> align="char">
<para>int dmx_section_cb(__u8&#x22C6; buffer1, size_t <para>int dmx_section_cb(__u8&#x22C6; buffer1, size_t
buffer1_length, __u8&#x22C6; buffer2, size_t buffer1_length, __u8&#x22C6; buffer2, size_t
buffer2_length, dmx_section_filter_t&#x22C6; source, buffer2_length, dmx_section_filter_t&#x22C6; source);</para>
dmx_success_t success);</para>
</entry> </entry>
</row></tbody></tgroup></informaltable> </row></tbody></tgroup></informaltable>
<para>PARAMETERS <para>PARAMETERS
@ -668,14 +642,6 @@ role="subsection"><title>dmx_section_cb()</title>
</entry><entry </entry><entry
align="char"> align="char">
<para>Indicates the filter that triggered the callback.</para> <para>Indicates the filter that triggered the callback.</para>
</entry>
</row><row><entry
align="char">
<para>dmx_success_t
success</para>
</entry><entry
align="char">
<para>Indicates if there was an error in section reception.</para>
</entry> </entry>
</row></tbody></tgroup></informaltable> </row></tbody></tgroup></informaltable>
<para>RETURNS <para>RETURNS

View file

@ -55,21 +55,6 @@
#define DMX_MAX_SECFEED_SIZE (DMX_MAX_SECTION_SIZE + 188) #define DMX_MAX_SECFEED_SIZE (DMX_MAX_SECTION_SIZE + 188)
#endif #endif
/*
* enum dmx_success: Success codes for the Demux Callback API.
*/
enum dmx_success {
DMX_OK = 0, /* Received Ok */
DMX_LENGTH_ERROR, /* Incorrect length */
DMX_OVERRUN_ERROR, /* Receiver ring buffer overrun */
DMX_CRC_ERROR, /* Incorrect CRC */
DMX_FRAME_ERROR, /* Frame alignment error */
DMX_FIFO_ERROR, /* Receiver FIFO overrun */
DMX_MISSED_ERROR /* Receiver missed packet */
} ;
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/* TS packet reception */ /* TS packet reception */
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
@ -141,15 +126,13 @@ typedef int (*dmx_ts_cb) ( const u8 * buffer1,
size_t buffer1_length, size_t buffer1_length,
const u8 * buffer2, const u8 * buffer2,
size_t buffer2_length, size_t buffer2_length,
struct dmx_ts_feed* source, struct dmx_ts_feed* source);
enum dmx_success success);
typedef int (*dmx_section_cb) ( const u8 * buffer1, typedef int (*dmx_section_cb) ( const u8 * buffer1,
size_t buffer1_len, size_t buffer1_len,
const u8 * buffer2, const u8 * buffer2,
size_t buffer2_len, size_t buffer2_len,
struct dmx_section_filter * source, struct dmx_section_filter * source);
enum dmx_success success);
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/* DVB Front-End */ /* DVB Front-End */

View file

@ -352,8 +352,7 @@ static void dvb_dmxdev_filter_timer(struct dmxdev_filter *dmxdevfilter)
static int dvb_dmxdev_section_callback(const u8 *buffer1, size_t buffer1_len, static int dvb_dmxdev_section_callback(const u8 *buffer1, size_t buffer1_len,
const u8 *buffer2, size_t buffer2_len, const u8 *buffer2, size_t buffer2_len,
struct dmx_section_filter *filter, struct dmx_section_filter *filter)
enum dmx_success success)
{ {
struct dmxdev_filter *dmxdevfilter = filter->priv; struct dmxdev_filter *dmxdevfilter = filter->priv;
int ret; int ret;
@ -386,8 +385,7 @@ static int dvb_dmxdev_section_callback(const u8 *buffer1, size_t buffer1_len,
static int dvb_dmxdev_ts_callback(const u8 *buffer1, size_t buffer1_len, static int dvb_dmxdev_ts_callback(const u8 *buffer1, size_t buffer1_len,
const u8 *buffer2, size_t buffer2_len, const u8 *buffer2, size_t buffer2_len,
struct dmx_ts_feed *feed, struct dmx_ts_feed *feed)
enum dmx_success success)
{ {
struct dmxdev_filter *dmxdevfilter = feed->priv; struct dmxdev_filter *dmxdevfilter = feed->priv;
struct dvb_ringbuffer *buffer; struct dvb_ringbuffer *buffer;

View file

@ -130,7 +130,7 @@ static inline int dvb_dmx_swfilter_payload(struct dvb_demux_feed *feed,
feed->peslen += count; feed->peslen += count;
return feed->cb.ts(&buf[p], count, NULL, 0, &feed->feed.ts, DMX_OK); return feed->cb.ts(&buf[p], count, NULL, 0, &feed->feed.ts);
} }
static int dvb_dmx_swfilter_sectionfilter(struct dvb_demux_feed *feed, static int dvb_dmx_swfilter_sectionfilter(struct dvb_demux_feed *feed,
@ -152,7 +152,7 @@ static int dvb_dmx_swfilter_sectionfilter(struct dvb_demux_feed *feed,
return 0; return 0;
return feed->cb.sec(feed->feed.sec.secbuf, feed->feed.sec.seclen, return feed->cb.sec(feed->feed.sec.secbuf, feed->feed.sec.seclen,
NULL, 0, &f->filter, DMX_OK); NULL, 0, &f->filter);
} }
static inline int dvb_dmx_swfilter_section_feed(struct dvb_demux_feed *feed) static inline int dvb_dmx_swfilter_section_feed(struct dvb_demux_feed *feed)
@ -367,8 +367,7 @@ static inline void dvb_dmx_swfilter_packet_type(struct dvb_demux_feed *feed,
if (feed->ts_type & TS_PAYLOAD_ONLY) if (feed->ts_type & TS_PAYLOAD_ONLY)
dvb_dmx_swfilter_payload(feed, buf); dvb_dmx_swfilter_payload(feed, buf);
else else
feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts, feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts);
DMX_OK);
} }
if (feed->ts_type & TS_DECODER) if (feed->ts_type & TS_DECODER)
if (feed->demux->write_to_decoder) if (feed->demux->write_to_decoder)
@ -469,7 +468,7 @@ static void dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf)
if (feed->pid == pid) if (feed->pid == pid)
dvb_dmx_swfilter_packet_type(feed, buf); dvb_dmx_swfilter_packet_type(feed, buf);
else if (feed->pid == 0x2000) else if (feed->pid == 0x2000)
feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts, DMX_OK); feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts);
} }
} }
@ -588,7 +587,7 @@ void dvb_dmx_swfilter_raw(struct dvb_demux *demux, const u8 *buf, size_t count)
spin_lock_irqsave(&demux->lock, flags); spin_lock_irqsave(&demux->lock, flags);
demux->feed->cb.ts(buf, count, NULL, 0, &demux->feed->feed.ts, DMX_OK); demux->feed->cb.ts(buf, count, NULL, 0, &demux->feed->feed.ts);
spin_unlock_irqrestore(&demux->lock, flags); spin_unlock_irqrestore(&demux->lock, flags);
} }

View file

@ -761,7 +761,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
static int dvb_net_ts_callback(const u8 *buffer1, size_t buffer1_len, static int dvb_net_ts_callback(const u8 *buffer1, size_t buffer1_len,
const u8 *buffer2, size_t buffer2_len, const u8 *buffer2, size_t buffer2_len,
struct dmx_ts_feed *feed, enum dmx_success success) struct dmx_ts_feed *feed)
{ {
struct net_device *dev = feed->priv; struct net_device *dev = feed->priv;
@ -870,8 +870,7 @@ static void dvb_net_sec(struct net_device *dev,
static int dvb_net_sec_callback(const u8 *buffer1, size_t buffer1_len, static int dvb_net_sec_callback(const u8 *buffer1, size_t buffer1_len,
const u8 *buffer2, size_t buffer2_len, const u8 *buffer2, size_t buffer2_len,
struct dmx_section_filter *filter, struct dmx_section_filter *filter)
enum dmx_success success)
{ {
struct net_device *dev = filter->priv; struct net_device *dev = filter->priv;

View file

@ -303,7 +303,6 @@ static int arm_thread(void *data)
static int DvbDmxFilterCallback(u8 *buffer1, size_t buffer1_len, static int DvbDmxFilterCallback(u8 *buffer1, size_t buffer1_len,
u8 *buffer2, size_t buffer2_len, u8 *buffer2, size_t buffer2_len,
struct dvb_demux_filter *dvbdmxfilter, struct dvb_demux_filter *dvbdmxfilter,
enum dmx_success success,
struct av7110 *av7110) struct av7110 *av7110)
{ {
if (!dvbdmxfilter->feed->demux->dmx.frontend) if (!dvbdmxfilter->feed->demux->dmx.frontend)
@ -329,16 +328,14 @@ static int DvbDmxFilterCallback(u8 *buffer1, size_t buffer1_len,
} }
return dvbdmxfilter->feed->cb.sec(buffer1, buffer1_len, return dvbdmxfilter->feed->cb.sec(buffer1, buffer1_len,
buffer2, buffer2_len, buffer2, buffer2_len,
&dvbdmxfilter->filter, &dvbdmxfilter->filter);
DMX_OK);
case DMX_TYPE_TS: case DMX_TYPE_TS:
if (!(dvbdmxfilter->feed->ts_type & TS_PACKET)) if (!(dvbdmxfilter->feed->ts_type & TS_PACKET))
return 0; return 0;
if (dvbdmxfilter->feed->ts_type & TS_PAYLOAD_ONLY) if (dvbdmxfilter->feed->ts_type & TS_PAYLOAD_ONLY)
return dvbdmxfilter->feed->cb.ts(buffer1, buffer1_len, return dvbdmxfilter->feed->cb.ts(buffer1, buffer1_len,
buffer2, buffer2_len, buffer2, buffer2_len,
&dvbdmxfilter->feed->feed.ts, &dvbdmxfilter->feed->feed.ts);
DMX_OK);
else else
av7110_p2t_write(buffer1, buffer1_len, av7110_p2t_write(buffer1, buffer1_len,
dvbdmxfilter->feed->pid, dvbdmxfilter->feed->pid,
@ -422,7 +419,7 @@ static void debiirq(unsigned long cookie)
DvbDmxFilterCallback((u8 *)av7110->debi_virt, DvbDmxFilterCallback((u8 *)av7110->debi_virt,
av7110->debilen, NULL, 0, av7110->debilen, NULL, 0,
av7110->handle2filter[handle], av7110->handle2filter[handle],
DMX_OK, av7110); av7110);
xfer = RX_BUFF; xfer = RX_BUFF;
break; break;

View file

@ -102,7 +102,7 @@ int av7110_record_cb(struct dvb_filter_pes2ts *p2t, u8 *buf, size_t len)
buf[4] = buf[5] = 0; buf[4] = buf[5] = 0;
if (dvbdmxfeed->ts_type & TS_PAYLOAD_ONLY) if (dvbdmxfeed->ts_type & TS_PAYLOAD_ONLY)
return dvbdmxfeed->cb.ts(buf, len, NULL, 0, return dvbdmxfeed->cb.ts(buf, len, NULL, 0,
&dvbdmxfeed->feed.ts, DMX_OK); &dvbdmxfeed->feed.ts);
else else
return dvb_filter_pes2ts(p2t, buf, len, 1); return dvb_filter_pes2ts(p2t, buf, len, 1);
} }
@ -112,7 +112,7 @@ static int dvb_filter_pes2ts_cb(void *priv, unsigned char *data)
struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *) priv; struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *) priv;
dvbdmxfeed->cb.ts(data, 188, NULL, 0, dvbdmxfeed->cb.ts(data, 188, NULL, 0,
&dvbdmxfeed->feed.ts, DMX_OK); &dvbdmxfeed->feed.ts);
return 0; return 0;
} }
@ -815,7 +815,7 @@ static void p_to_t(u8 const *buf, long int length, u16 pid, u8 *counter,
memcpy(obuf + l, buf + c, TS_SIZE - l); memcpy(obuf + l, buf + c, TS_SIZE - l);
c = length; c = length;
} }
feed->cb.ts(obuf, 188, NULL, 0, &feed->feed.ts, DMX_OK); feed->cb.ts(obuf, 188, NULL, 0, &feed->feed.ts);
pes_start = 0; pes_start = 0;
} }
} }

View file

@ -375,8 +375,7 @@ static int ttusb_dec_audio_pes2ts_cb(void *priv, unsigned char *data)
struct ttusb_dec *dec = priv; struct ttusb_dec *dec = priv;
dec->audio_filter->feed->cb.ts(data, 188, NULL, 0, dec->audio_filter->feed->cb.ts(data, 188, NULL, 0,
&dec->audio_filter->feed->feed.ts, &dec->audio_filter->feed->feed.ts);
DMX_OK);
return 0; return 0;
} }
@ -386,8 +385,7 @@ static int ttusb_dec_video_pes2ts_cb(void *priv, unsigned char *data)
struct ttusb_dec *dec = priv; struct ttusb_dec *dec = priv;
dec->video_filter->feed->cb.ts(data, 188, NULL, 0, dec->video_filter->feed->cb.ts(data, 188, NULL, 0,
&dec->video_filter->feed->feed.ts, &dec->video_filter->feed->feed.ts);
DMX_OK);
return 0; return 0;
} }
@ -439,7 +437,7 @@ static void ttusb_dec_process_pva(struct ttusb_dec *dec, u8 *pva, int length)
if (output_pva) { if (output_pva) {
dec->video_filter->feed->cb.ts(pva, length, NULL, 0, dec->video_filter->feed->cb.ts(pva, length, NULL, 0,
&dec->video_filter->feed->feed.ts, DMX_OK); &dec->video_filter->feed->feed.ts);
return; return;
} }
@ -500,7 +498,7 @@ static void ttusb_dec_process_pva(struct ttusb_dec *dec, u8 *pva, int length)
case 0x02: /* MainAudioStream */ case 0x02: /* MainAudioStream */
if (output_pva) { if (output_pva) {
dec->audio_filter->feed->cb.ts(pva, length, NULL, 0, dec->audio_filter->feed->cb.ts(pva, length, NULL, 0,
&dec->audio_filter->feed->feed.ts, DMX_OK); &dec->audio_filter->feed->feed.ts);
return; return;
} }
@ -538,7 +536,7 @@ static void ttusb_dec_process_filter(struct ttusb_dec *dec, u8 *packet,
if (filter) if (filter)
filter->feed->cb.sec(&packet[2], length - 2, NULL, 0, filter->feed->cb.sec(&packet[2], length - 2, NULL, 0,
&filter->filter, DMX_OK); &filter->filter);
} }
static void ttusb_dec_process_packet(struct ttusb_dec *dec) static void ttusb_dec_process_packet(struct ttusb_dec *dec)