Page MenuHomeFreeBSD

mbuf: remove remnants of caddr_t
AcceptedPublic

Authored by glebius on Wed, Oct 14, 7:46 PM.
Tags
None
Referenced Files
F176046831: D60736.id189949.diff
Thu, Oct 15, 3:05 PM
F176044222: D60736.diff
Thu, Oct 15, 2:33 PM
F176010940: D60736.id189949.diff
Thu, Oct 15, 7:05 AM
F176010773: D60736.id189949.diff
Thu, Oct 15, 7:03 AM
F176009726: D60736.id189931.diff
Thu, Oct 15, 6:51 AM
F176008407: D60736.id189931.diff
Thu, Oct 15, 6:33 AM
F176008057: D60736.id189937.diff
Thu, Oct 15, 6:28 AM
F176005986: D60736.diff
Thu, Oct 15, 5:59 AM

Details

Reviewers
adrian
tuexen
zlei
Group Reviewers
network
transport
Summary

caddr_t is a typedef for a character pointer (char *) that originated in
Version 7 Unix, released by AT&T in 1979. It became obsolete in 1981,
when ANSI C introduced void *.

There is a lot of code that uses m->m_data for arithmetics, thus we can't
switch it to void * easily. Let's at least stop proliferation of caddr_t.
We have developers that are twice younger than obsoletion of this type.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 78232
Build 75115: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Wed, Oct 14, 7:48 PM

Sorry, dropped unfinished diff. Will update.

Change m_append, m_copyback, m_copydata prototypes to use void *.

This revision now requires review to proceed.Wed, Oct 14, 9:06 PM

We have developers that are twice younger than obsoletion of this type.

Looks like I'm not qualified to approve this one. 🚶

This revision is now accepted and ready to land.Wed, Oct 14, 11:24 PM
zlei added inline comments.
sys/kern/uipc_mbuf.c
699

Maybe it is shorter to use macro mtodo ?

1296

Actually bzero() does not care about the type. No need to cast to char *.

1311

Ditto.

1356
1356
1369
sys/sys/mbuf.h
347

I guess the type of m_data can eventually be converted void * ? But many drivers access m_data directly.

sys/sys/mbuf.h
347

I'd be all for a pass through all direct references of m_data and turning them into mtod / mtodo calls.

(And maybe at the same time make an mtod_const ...)

Use void * where char * isn't needed.

This revision now requires review to proceed.Thu, Oct 15, 4:44 AM

mtodo() is not used widely, I don't yet want to proliferate its use. At least not with this change.

This revision is now accepted and ready to land.Thu, Oct 15, 6:20 AM