comedi_offset_munge(9)
π comedi_offset_munge(9) β the Kernel API Manual, but make it cute
okay so bestie, you're in the Kernel API Manual and today's main character is comedi_offset_munge β¨ (yes that's the page title, and yes the manual name is literally Kernel API Manual, we're fancy like that π)
β¨ NAME β¨
comedi_offset_munge β Convert between offset binary and 2's complement π¦
πΈ SYNOPSIS πΈ
unsigned int comedi_offset_munge (struct comedi_subdevice *s , unsigned
int val );
literally that's the whole function signature, no notes π
π ARGUMENTS π
sβ your COMEDI subdevice π (yes, it's astruct comedi_subdevice *, she's the star of the show)valβ the value to be converted π goes in as one thing, comes out as another, the glow-up is real
π DESCRIPTION π
okay so what this icon does: she toggles the highest bit of a sample value π₯ and by doing that she toggles between offset binary and 2's complement. that's it, that's the whole vibe. flip the top bit, switch the encoding, slay π
one lil caveat though bestie, no cap: she assumes that s->maxdata is a power of 2 minus 1 π«Ά. like that's the deal, that's the contract, don't come at her with anything else.
π RETURN π
the converted value π that's what you get back, the newly munged sample, iconic behaviour honestly β
π¦ SEE ALSO π¦
the whole friend group, in order, because we don't do gatekeeping here π:
- Kernel file
./include/linux/comedi/comedidev.h struct comedi_subdevice(9)struct comedi_buf_page(9)struct comedi_buf_map(9)struct comedi_async(9)enum comedi_cb(9)struct comedi_driver(9)struct comedi_device(9)struct comedi_lrange(9)comedi_range_is_bipolar(9)comedi_range_is_unipolar(9)comedi_range_is_external(9)comedi_chan_range_is_bipolar(9)comedi_chan_range_is_unipolar(9)comedi_chan_range_is_external(9)comedi_bytes_per_sample(9)comedi_sample_shift(9)comedi_bytes_to_samples(9)comedi_samples_to_bytes(9)comedi_check_trigger_src(9)comedi_check_trigger_is_unique(9)comedi_check_trigger_arg_is(9)comedi_check_trigger_arg_min(9)comedi_check_trigger_arg_max(9)comedi_buf_n_bytes_ready(9)__comedi_request_region(9)comedi_request_region(9)module_comedi_driver(9)
like, the whole squad ππ
okay that's the page bestie, and before I go β the source path is ./include/linux/comedi and the date on this bad girl is October 2026 β so like, from the future, obviously π
π«Ά bye mwah π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms