Skip to content

typesafe callbacks

Rusty Russell lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6cast_if_type: allow macros functions which take more than one type.include/linux/compiler-gcc.h include/linux/compiler-intel.h+21 -00 replies
2/6typesafe_cb: wrappers for typesafe callbacks.include/linux/kernel.h+35 -00 replies
3/6typesafe: Convert stop_machineinclude/linux/stop_machine.h kernel/stop_machine.c+10 -60 replies
4/6typesafe: kthread_create and kthread_runinclude/linux/kthread.h kernel/kthread.c+30 -270 replies
5/6typesafe: request_irq and devm_request_irqinclude/linux/interrupt.h kernel/irq/devres.c kernel/irq/manage.c+20 -100 replies
6/6typesafe: TIMER_INITIALIZER and setup_timerinclude/linux/timer.h+22 -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] typesafe callbacks

The idea is to create a general typesafe callback mechanism which doesn't break compile on existing code and doesn't allow any unsafe callback types.

Al had a very long timer conversion series followed by a different mechanism, and that just covered timers; unfortunately that technique provides insufficient typechecking for the general case (eg. int return types and callback functions which take integer args as well as the data arg).

Note that these typechecks end up being *too* strict in some cases, disallowing some potentially valid cases. But since you can still use the current via-void* method, these corner cases lose nothing.