git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 7/8] fsmonitor: mark unused hashmap callback parameters

From
Jeff King <peff@peff.net>
Date
Sep 18, 2023, 22:33 UTC
Message-ID
<20230918223314.GG2659298@coredump.intra.peff.net>
In-Reply-To
<20230918222908.GA2659096@coredump.intra.peff.net>

Like many hashmap comparison functions, our cookies_cmp() does not look at its extra void data parameter. This should have been annotated in 02c3c59e62 (hashmap: mark unused callback parameters, 2022-08-19), but this new case was added around the same time (plus fsmonitor is not built at all on Linux, so it is easy to miss there).

Signed-off-by: Jeff King <peff@peff.net>
---
 builtin/fsmonitor--daemon.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/builtin/fsmonitor--daemon.c b/builtin/fsmonitor--daemon.c
index 7c4130c981..ce511c3ed6 100644
--- a/builtin/fsmonitor--daemon.c
+++ b/builtin/fsmonitor--daemon.c
@@ -129,8 +129,9 @@ struct fsmonitor_cookie_item {
 	enum fsmonitor_cookie_item_result result;
 };
 
-static int cookies_cmp(const void *data, const struct hashmap_entry *he1,
-		     const struct hashmap_entry *he2, const void *keydata)
+static int cookies_cmp(const void *data UNUSED,
+		       const struct hashmap_entry *he1,
+		       const struct hashmap_entry *he2, const void *keydata)
 {
 	const struct fsmonitor_cookie_item *a =
 		container_of(he1, const struct fsmonitor_cookie_item, entry);
-- 
2.42.0.671.g43fbf3903a
Previous: Jeff KingNext: Jeff King
Message 8 of 11 in “fsmonitor unused parameter cleanups”
  1. 0/8 fsmonitor unused parameter cleanupsJeff King, Sep 18, 2023
  2. 1/8 fsmonitor: prefer repo_git_path() to git_pathdup()Jeff King, Sep 18, 2023
  3. 2/8 fsmonitor/win32: drop unused parametersJeff King, Sep 18, 2023
  4. 3/8 fsmonitor: mark some maybe-unused parametersJeff King, Sep 18, 2023
  5. 4/8 fsmonitor/win32: mark unused parameter in fsm_os__incompatible()Jeff King, Sep 18, 2023
  6. 5/8 fsmonitor: mark unused parameters in stub functionsJeff King, Sep 18, 2023
  7. 6/8 fsmonitor/darwin: mark unused parameters in system callbackJeff King, Sep 18, 2023
  8. 7/8 fsmonitor: mark unused hashmap callback parametersJeff King, Sep 18, 2023
  9. 8/8 run-command: mark unused parameters in start_bg_wait callbacksJeff King, Sep 18, 2023
  10. Jeff HostetlerSep 19, 2023
  11. Junio C HamanoSep 19, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.