summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAugusto Cardoso <devnull@localhost>2003-12-10 08:09:59 +0000
committerAugusto Cardoso <devnull@localhost>2003-12-10 08:09:59 +0000
commit373b604e2c3b07fc4893e7b0bd5202e007955c53 (patch)
tree0a3f8dcfb77843bb76eb5050f20390d9e1c68773
parent4884d78652757fcbb80a11ac41903b94abd152d9 (diff)
downloadmediapointer-dvb-s2-373b604e2c3b07fc4893e7b0bd5202e007955c53.tar.gz
mediapointer-dvb-s2-373b604e2c3b07fc4893e7b0bd5202e007955c53.tar.bz2
Optimization for pid 0x2000 and code simplification.
-rw-r--r--linux/drivers/media/dvb/b2c2/skystar2.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/linux/drivers/media/dvb/b2c2/skystar2.c b/linux/drivers/media/dvb/b2c2/skystar2.c
index 5f8f678b9..01b1b9d15 100644
--- a/linux/drivers/media/dvb/b2c2/skystar2.c
+++ b/linux/drivers/media/dvb/b2c2/skystar2.c
@@ -1146,9 +1146,8 @@ static int add_hw_pid(struct adapter *adapter, u16 pid)
if (pid <= 0x1f)
return 1;
- if (pid == 0x2000) {
- /* we can't use a filter, so no search */
- } else {
+ /* we can't use a filter for 0x2000, so no search */
+ if (pid != 0x2000) {
/* find an unused hardware filter */
for (i = 0; i < adapter->useable_hw_filters; i++) {
dprintk("%s: pid=%d searching slot=%d\n", __FUNCTION__, pid, i);
@@ -1177,9 +1176,8 @@ static int remove_hw_pid(struct adapter *adapter, u16 pid)
if (pid <= 0x1f)
return 1;
- if (pid == 0x2000) {
- /* we can't use a filter, so no search */
- } else {
+ /* we can't use a filter for 0x2000, so no search */
+ if (pid != 0x2000) {
for (i = 0; i < adapter->useable_hw_filters; i++) {
dprintk("%s: pid=%d searching slot=%d\n", __FUNCTION__, pid, i);
if (adapter->hw_pids[i] == pid) { // find the pid slot
@@ -1245,10 +1243,7 @@ static int remove_pid(struct adapter *adapter, u16 pid)
if (adapter->pid_rc[i] <= 0) {
// remove from the list
adapter->pid_count--;
- for (j = i; j < adapter->pid_count; j++) {
- adapter->pid_list[j] = adapter->pid_list[j + 1];
- adapter->pid_rc[j] = adapter->pid_rc[j + 1];
- }
+ adapter->pid_list[i]=adapter->pid_list[adapter->pid_count];
// hardware setting
remove_hw_pid(adapter, pid);
}