Skip to content

Conversation

@tomas-winkler-sndk
Copy link
Contributor

Some minor code improvements in wdc plugin.

@igaw
Copy link
Collaborator

igaw commented Apr 28, 2025

Could you please rebase your changes (they are conflicting after the recent change) and also address the checkpatch errors? Thanks.

@tomas-winkler-sndk
Copy link
Contributor Author

I can rebase, though need a non-automated maintainer decision regarding the checkpatch warnings. Either we break strings or allow long lines.

@igaw
Copy link
Collaborator

igaw commented Apr 29, 2025

Ignore the checkpatch warnings, I thought checkpatch was pointing out other stuff. Sorry.

Add wdc_is_zn350() wrapper to replace repeating open code condition
(device_id == WDC_NVME_ZN350_DEV_ID ||
 device_id == WDC_NVME_ZN350_DEV_ID_1)

Signed-off-by: Tomas Winkler <tomas.winkler@sandisk.com>
1. Refactor function signatures to use `const char *` for char
pointer arguments that are not intended to be modified.
2. Constify pointers to constant strings.

This improves code clarity and prevents accidental modifications to
read-only data.

Signed-off-by: Tomas Winkler <tomas.winkler@sandisk.com>
Replace the internal implementation for finding specific UUIDs
with the `nvme_uuid_find()` function provided by libnvme.

This change simplifies the code and improves maintainability
by leveraging a well-tested utility function from the library.
While the internal implementation might have offered slightly
better performance as we looped only once in few cases
the clarity and reduced code duplication are preferred.

Signed-off-by: Tomas Winkler <tomas.winkler@sandisk.com>
@igaw igaw merged commit d83b03e into linux-nvme:master Apr 30, 2025
16 of 17 checks passed
@igaw
Copy link
Collaborator

igaw commented Apr 30, 2025

Thanks!

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