Page MenuHomeFreeBSD

linuxkpi: Add `strtomem()` and `strtomem_pad()`
Needs RevisionPublic

Authored by dumbbell on Sun, Mar 8, 1:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Mar 28, 12:36 AM
Unknown Object (File)
Sun, Mar 22, 3:18 AM
Unknown Object (File)
Sat, Mar 21, 10:34 AM
Unknown Object (File)
Fri, Mar 20, 5:52 AM
Unknown Object (File)
Fri, Mar 20, 3:24 AM
Unknown Object (File)
Thu, Mar 19, 10:35 PM
Unknown Object (File)
Thu, Mar 12, 9:45 PM
Unknown Object (File)
Wed, Mar 11, 4:55 PM
Subscribers

Details

Reviewers
bz
Group Reviewers
linuxkpi
Summary

The DRM generic code started to use strtomem_pad() in Linux 6.11.

This is part of the update of DRM drivers to Linux 6.11.

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

sys/compat/linuxkpi/common/include/linux/string.h
311

what is this 4-arg memcpy?

Fix use of memcpy() as reported by @emaste

dumbbell added inline comments.
sys/compat/linuxkpi/common/include/linux/string.h
311

Too much copy-paste

bz requested changes to this revision.Sun, Mar 29, 11:29 PM
bz added a subscriber: bz.
bz added inline comments.
sys/compat/linuxkpi/common/include/linux/string.h
307

Reading the description it sounds like (here and down) dest should use ARRAY_SIZE (nitems)?

This revision now requires changes to proceed.Sun, Mar 29, 11:29 PM
sys/compat/linuxkpi/common/include/linux/string.h
307

So you suggest:

size_t dstlen = ARRAY_SIZE(dst);
``` instead, is that correct?

I’m not sure i get the difference. Is it semantically more correct?

In this case, should `ARRAY_SIZE()` be used for `srclen` too?
sys/compat/linuxkpi/common/include/linux/string.h
307

Only for dstlen as dst that is supposed to be a Pointer of destination character array (marked as __nonstring) according to the documentation. Making in ARRAY_SIZE I hope will catch other possible kinds of buffers--while Linux should catch that already for drivers I would hope, in case we use this internally in LinuxKPI it's just to be saver.