-
Notifications
You must be signed in to change notification settings - Fork 396
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
prov/efa: remove unneeded memset #9655
Conversation
We have some memset before assignments that do nothing, remove them to save instructions. Signed-off-by: Seth Zegelstein <szegel@amazon.com>
3d0eec5
to
b1f41e7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason memset can be removed is because there is no gap in struct efa_prv_reverse_av_key
@wzamazon what gap do you mean? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it be safer to struct efa_cur_reverse_av_key cur_key = {0};
at the beginning?
Ignore this, it doesn't matter since it only has ahn and qpn and we already assign them explicitly
I meant the struct libfabric/prov/efa/src/efa_av.h Line 66 in 52b24eb
|
I thought the memset isn't needed because |
The padding would only be relevant if the object is ever cast or punned to some other struct. Otherwise, you don't (and should rarely) need to be acutely aware of the member padding/alignment. It should be noted that compilers are pretty good at detecting superfluous |
The memset assigns the same length as the variable we are setting.... no chance anything bad will happen.