* [PATCH 15/37] dvb: dst: remove redundant checksum calculation
@ 2005-11-01 8:14 Michael Krufky
0 siblings, 0 replies; only message in thread
From: Michael Krufky @ 2005-11-01 8:14 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, linux-dvb-maintainer
[-- Attachment #1: Type: text/plain, Size: 2 bytes --]
[-- Attachment #2: 2378.patch --]
[-- Type: text/x-patch, Size: 1852 bytes --]
From: Perceval Anichini <perceval.anichini@streamvision.fr>
- removes the redundant checksum calculation, which was also exported from the dst.c module
Signed-off-by: Perceval Anichini <perceval.anichini@streamvision.fr>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
drivers/media/dvb/bt8xx/dst_ca.c | 24 +++++-------------------
1 file changed, 5 insertions(+), 19 deletions(-)
--- linux-2.6.14-git3.orig/drivers/media/dvb/bt8xx/dst_ca.c
+++ linux-2.6.14-git3/drivers/media/dvb/bt8xx/dst_ca.c
@@ -69,26 +69,12 @@
}
-static int put_checksum(u8 *check_string, int length)
+static void put_checksum(u8 *check_string, int length)
{
- u8 i = 0, checksum = 0;
-
- dprintk(verbose, DST_CA_DEBUG, 1, " ========================= Checksum calculation ===========================");
- dprintk(verbose, DST_CA_DEBUG, 1, " String Length=[0x%02x]", length);
- dprintk(verbose, DST_CA_DEBUG, 1, " String=[");
-
- while (i < length) {
- dprintk(verbose, DST_CA_DEBUG, 0, " %02x", check_string[i]);
- checksum += check_string[i];
- i++;
- }
- dprintk(verbose, DST_CA_DEBUG, 0, " ]\n");
- dprintk(verbose, DST_CA_DEBUG, 1, "Sum=[%02x]\n", checksum);
- check_string[length] = ~checksum + 1;
- dprintk(verbose, DST_CA_DEBUG, 1, " Checksum=[%02x]", check_string[length]);
- dprintk(verbose, DST_CA_DEBUG, 1, " ==========================================================================");
-
- return 0;
+ dprintk(verbose, DST_CA_DEBUG, 1, " Computing string checksum.");
+ dprintk(verbose, DST_CA_DEBUG, 1, " -> string length : 0x%02x", length);
+ check_string[length] = dst_check_sum (check_string, length);
+ dprintk(verbose, DST_CA_DEBUG, 1, " -> checksum : 0x%02x", check_string[length]);
}
static int dst_ci_command(struct dst_state* state, u8 * data, u8 *ca_string, u8 len, int read)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-11-01 8:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-01 8:14 [PATCH 15/37] dvb: dst: remove redundant checksum calculation Michael Krufky
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.