Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix trivial calloc(3) arguments order #13052

Merged
merged 1 commit into from
Feb 2, 2022
Merged

Conversation

kusumi
Copy link
Member

@kusumi kusumi commented Feb 1, 2022

Motivation and Context

Just a trivial fix.

Description

calloc(3) takes nmemb first.

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
@adamdmoss
Copy link
Contributor

IMHO neither way around is more intuitive or correct than the other, at least in these cases...

@kusumi
Copy link
Member Author

kusumi commented Feb 1, 2022

Neither is more intuitive than other, but that's how it's defined plus ZoL has had this correct. Of course most implementations just use nmemb * size, so it usually makes no real difference.

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Feb 2, 2022
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Feb 2, 2022
@behlendorf behlendorf merged commit 955bf4d into openzfs:master Feb 2, 2022
nicman23 pushed a commit to nicman23/zfs that referenced this pull request Aug 22, 2022
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <freqlabs@FreeBSD.org>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Closes openzfs#13052
nicman23 pushed a commit to nicman23/zfs that referenced this pull request Aug 22, 2022
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <freqlabs@FreeBSD.org>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Closes openzfs#13052
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants