Skip to content

RFC: Typesafe callbacks

Rusty Russell lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 16 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6typesafe: Convert stop_machine and callersdrivers/char/hw_random/intel-rng.c include/linux/stop_machine.h kernel/module.c +1 more+15 -150 replies
2/6typesafe: kthread_create and kthread_runinclude/linux/kthread.h kernel/kthread.c+32 -276 replies
3/6typesafe: convert kthread userscrypto/cryptd.c crypto/cryptomgr.c drivers/base/firmware_class.c +67 more+104 -1830 replies
4/6typesafe: cast_if_type to allow macros functions which take more than one type.include/linux/compiler-gcc.h include/linux/compiler-intel.h+19 -00 replies
5/6typesafe: request_irq and devm_request_irqinclude/linux/interrupt.h kernel/irq/devres.c kernel/irq/manage.c+23 -100 replies
6/6typesafe: timersinclude/linux/timer.h+16 -80 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6] RFC: Typesafe callbacks

Hi all,

Converting to and from void * for callback functions loses type safety:
everywhere else we expect the compiler to catch incorrect pointer types handed to functions.

It's pretty simple to create typesafe callback functions using typeof, and
with a little gcc trickery we can allow both old-style and typesafe callbacks to avoid churn on commonly-used routines.

Feedback welcomed,
Rusty.