Skip to contentSkip to conversation

do we need 10 copies?

DISCUSSION Garst R. Reese 4 participants 4 messages Sep 23, 2001 – Sep 24, 2001

lore
Share & tools
lore
#0 lore raw

This table (512 bytes) and the code to implement crc-ccit is replicated in 10 drivers. ppp-async even exports it. Surely there is a better way. Garst

arch/ppc/xmon/xmon.c: 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
arch/ia64/sn/io/l1.c: 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
drivers/net/hamradio/hdlcdrv.c: 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
drivers/net/hamradio/baycom_epp.c: 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
drivers/net/ppp_async.c: 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
drivers/isdn/hisax/rawhdlc.c: 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
drivers/isdn/hisax/netjet.c: 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
drivers/isdn/hisax/st5481_hdlc.c: 0x0000,0x1189,0x2312,0x329b,0x4624,0x57ad,0x6536,0x74bf,
drivers/isdn/tpam/tpam_crcpc.c: 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
net/irda/crc.c: 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,

#1 lore raw
Quoted 2 lines · Garst R. Reese

This table (512 bytes) and the code to implement crc-ccit is replicated in 10 drivers. ppp-async even exports it. Surely there is a better way.

As for the ISDN code (4 copies), there is the plan to use a a common HDLC en/decoding module, however that's a 2.5 thing. I'll take a look if I can find a generic solution then, but it might turn out difficult - having a module of its own just for that table wastes nearly a page, so that's probably worse than the current state of affairs.

--Kai

#2 lore raw
Quoted 8 lines · Kai Germaschewski
Quoted 2 lines · Garst R. Reese

This table (512 bytes) and the code to implement crc-ccit is replicated in 10 drivers. ppp-async even exports it. Surely there is a better way.

As for the ISDN code (4 copies), there is the plan to use a a common HDLC en/decoding module, however that's a 2.5 thing. I'll take a look if I can find a generic solution then, but it might turn out difficult - having a module of its own just for that table wastes nearly a page, so that's probably worse than the current state of affairs.

I think the point is not so much that it tries to save memory, but that it avoids duplicated code and errors. IIRC there were bugs in previous kernels related to typos/errors in the individual crc tables...

-Dan

Signature · 1 line
[-] Omae no subete no kichi wa ore no mono da. [-]
#3 lore raw
In reply to Kai Germaschewski

[email protected] (Kai Germaschewski) wrote on 23.09.01 in <Pine.LNX.4.33.0109232106020.14414-100000@vaio>:

Quoted 10 lines · Garst R. Reese
Quoted 3 lines

This table (512 bytes) and the code to implement crc-ccit is replicated in 10 drivers. ppp-async even exports it. Surely there is a better way.

As for the ISDN code (4 copies), there is the plan to use a a common HDLC en/decoding module, however that's a 2.5 thing. I'll take a look if I can find a generic solution then, but it might turn out difficult - having a module of its own just for that table wastes nearly a page, so that's probably worse than the current state of affairs.

Why a module? Just make it something the base kernel exports, like other general library functions.

Oh, and ISTR that there are also still a number of zlib copies ... and, uh, about the PPP code ...

MfG Kai