On 4/19/22 08:30, Kirill A. Shutemov wrote: >> I think the stuff coming from the linux/ namespace you can simply copy >> into a header in compressed/, like I've done with efi.h. > Hm. Dave was worried about having copies of _find_next_bit() and > __bitmap_*() inside compressed/. > > How do we rectify code duplication and making decompresser self-contained? > Do we care about multiple copies of the same code in the kernel? > Do we care about keeping them in sync? Would it be feasible to have the common code defined as a 'static inline' in a header that both the main kernel and the decompressor could include? Something like the attached patch. I'd much rather duplicate something like this: int strncasecmp(const char *s1, const char *s2, size_t len) { return __lib_strncasecmp(s1, s1, len); } in the decompressor versus a real full implementation.