On Mon, 02 Jun 2014 20:29:16 -0700, Peter Tosh said:
function_1() { do some stuff }
my_print_function = function_1
EXPORT_SYMBOL(my_print_function)
No, you want EXPORT_SYMBOL(function_1) here.
function_t() { doing different stuff }
my_print_fuction = function_2
And just another function pointer assignment here
(other code)
my_print_function = function_1
My question is: Is this the correct way of doing this? Or will this cause issues?
The correct way to do this would be just use a call through a function pointer - that way any other code that's at a different point in execution doesn't end up calling something unexpected.(because let's face it - if the code is expecting to call function_1, and it suddenly ends up in function_2 anyhow, it will quite possibly misbehave).