Skip to content

min: Cleaned up usage of MIN in favor of safer CCAN min.#3272

Merged
igaw merged 1 commit intolinux-nvme:masterfrom
Micron-TPG-OSS:cleanup-min-usage
Apr 15, 2026
Merged

min: Cleaned up usage of MIN in favor of safer CCAN min.#3272
igaw merged 1 commit intolinux-nvme:masterfrom
Micron-TPG-OSS:cleanup-min-usage

Conversation

@bgoing-micron-oss
Copy link
Copy Markdown
Contributor

Libnvme's util.c uses a combination of CCAN's min from minmax.h and the MIN defined in param.h. The CCAN implementation has typechecking and is more portable, whereas the param.h definition of MIN only exists on Linux.

  • Updating util.c to use CCAN's min implementation consistently.
  • Removing unused MIN definition in nbft.c.

Libnvme's util.c uses a combination of CCAN's min from minmax.h and
the MIN defined in param.h.  The CCAN implementation has typechecking
and is more portable, whereas the param.h definition of MIN only exists
on Linux.
- Updating util.c to use CCAN's min implementation consistently.
- Removing unused MIN definition in nbft.c.

Signed-off-by: Broc Going <bgoing@micron.com>
@igaw
Copy link
Copy Markdown
Collaborator

igaw commented Apr 15, 2026

This looks good. Are you resubmitting it?

@bgoing-micron-oss
Copy link
Copy Markdown
Contributor Author

This looks good. Are you resubmitting it?
After opening this I saw that you had a major refactoring pull request submitted, so I was waiting to review that today and see if this was still applicable.

@igaw
Copy link
Copy Markdown
Collaborator

igaw commented Apr 15, 2026

Yes, sorry busy moving stuff around. Whenever I pull on a string I end up a big refactoring excersice. Anyway, the code base gets better. I check what is missing after the libnvme_fabrics_config refactoring. What needs to go from the public API. Hopefully this was the last big piece. Obviously, there is still a bit to do in the c files. The main goal is to get the public API done first.

@igaw igaw merged commit 09dce4c into linux-nvme:master Apr 15, 2026
29 checks passed
@igaw
Copy link
Copy Markdown
Collaborator

igaw commented Apr 15, 2026

Thanks!

@bgoing-micron-oss bgoing-micron-oss deleted the cleanup-min-usage branch April 16, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants