[lkml]   [2010]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 4/6] usb-serial: optimize sysrq function calls
On Tue, 9 Mar 2010, Jason Wessel wrote:

> There is no need to have external function calls for the sysrq
> functions. The compiler can inline the sysrq calls such that they are
> entirely a NOP if CONFIG_MAGIC_SYSRQ is not set.

This is not the best way to do what you want. Keep
usb_serial_handle_sysrq_char() and usb_serial_handle_break() as
out-of-line routines in generic.c, but make them conditional on
CONFIG_MAGIC_SYSRQ. Then in the header file, depending on whether or
not CONFIG_MAGIC_SYSRQ is defined, either put the usual extern function
declarations or else put do-nothing inline definitions.

The advantage of keeping the functions out-of-line is the reduced
amount of code space (since the bodies aren't replicated every place
they get used). This way you keep that advantage while still getting
the NOP implementation if CONFIG_MAGIC_SYSRQ isn't set.

Alan Stern

 \ /
  Last update: 2010-03-09 16:17    [W:0.060 / U:22.796 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site