Hi Szymon, On Thu, Jan 09, 2014, Szymon Janc wrote: > @@ -191,8 +191,10 @@ bool io_set_read_handler(struct io *io, io_callback_func_t callback, > > done: > io->read_callback = callback; > - io->read_destroy = destroy; > - io->read_data = user_data; > + if (callback) { > + io->read_destroy = destroy; > + io->read_data = user_data; > + } > > return true; > } You're already checking for the value of callback earlier in the function, so to avoid another check how about just move these assignments right before the done: label? > @@ -252,8 +254,10 @@ bool io_set_write_handler(struct io *io, io_callback_func_t callback, > > done: > io->write_callback = callback; > - io->write_destroy = destroy; > - io->write_data = user_data; > + if (callback) { > + io->write_destroy = destroy; > + io->write_data = user_data; > + } > > return true; > } Same here. Johan -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html