On Fri, 1 Dec 2017, Kees Cook wrote:
On Fri, Dec 1, 2017 at 2:47 AM, Sven Eckelmann sven@narfation.org wrote:
The commit e99e88a9d2b0 ("treewide: setup_timer() -> timer_setup()") changed the argument name and type of the timer function but didn't adjust the kernel-doc of these functions.
Signed-off-by: Sven Eckelmann sven@narfation.org
Cc: Kees Cook keescook@chromium.org
Acked-by: Kees Cook keescook@chromium.org
I wonder if there is a way for Coccinelle to change kernel-doc?
It can't change it, but with some cleverness (ie python/ocaml code) it can be used to find problems. I've attached a semantic patch that I wrote for this. It gives reports like:
drivers/acpi/arm64/iort.c:864 dma_size doesn't appear in ids: dev dma_addr size
Indeed the code has:
/** * iort_dma_setup() - Set-up device DMA parameters. * * @dev: device to configure * @dma_addr: device DMA address result pointer * @size: DMA range size result pointer */ void iort_dma_setup(struct device *dev, u64 *dma_addr, u64 *dma_size)
So the kerneldoc has the wrong name. There are also things like this:
drivers/acpi/acpica/utdebug.c:617 acpi_trace_point doesn't match preceding comment: begin
Here the code is:
/******************************************************************************\ * * * FUNCTION: acpi_trace_point * * PARAMETERS: type - Trace event type * begin - TRUE if before execution * aml - Executed AML address * pathname - Object path * pointer - Pointer to the related object * * RETURN: None * * DESCRIPTION: Interpreter execution trace. *
******************************************************************************\ /
void acpi_trace_point(acpi_trace_event_type type, u8 begin, u8 *aml, char *pathname)
So the rule doesn't seem to know about this kind of documentation.
julia
-Kees
net/batman-adv/tp_meter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c index 15cd213..ebc4e22 100644 --- a/net/batman-adv/tp_meter.c +++ b/net/batman-adv/tp_meter.c @@ -482,7 +482,7 @@ static void batadv_tp_reset_sender_timer(struct batadv_tp_vars *tp_vars)
/**
- batadv_tp_sender_timeout - timer that fires in case of packet loss
- @arg: address of the related tp_vars
- @t: address to timer_list inside tp_vars
- If fired it means that there was packet loss.
- Switch to Slow Start, set the ss_threshold to half of the current cwnd and
@@ -1106,7 +1106,7 @@ static void batadv_tp_reset_receiver_timer(struct batadv_tp_vars *tp_vars) /**
- batadv_tp_receiver_shutdown - stop a tp meter receiver when timeout is
- reached without received ack
- @arg: address of the related tp_vars
*/
- @t: address to timer_list inside tp_vars
static void batadv_tp_receiver_shutdown(struct timer_list *t) { -- 2.11.0
-- Kees Cook Pixel Security