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

osd: Initialization of data members #17691

Merged
merged 1 commit into from Dec 13, 2017

Conversation

Projects
None yet
4 participants
@amitkumar50
Copy link
Contributor

commented Sep 13, 2017

Fixes the coverity issues:

** 717336 Uninitialized scalar field

CID 717336 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member whitelisted is not initialized
in this constructor nor in any functions that it calls.

** 728001 Uninitialized scalar field

CID 728001 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member priority is not initialized
in this constructor nor in any functions that it calls.

** 1405358 Uninitialized scalar field

CID 1405358 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member field read_length.v is
not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Amit Kumar amitkuma@redhat.com

@@ -4404,7 +4404,7 @@ struct C_ChecksumRead : public Context {
OSDOp &osd_op;
Checksummer::CSumType csum_type;
bufferlist init_value_bl;
ceph_le64 read_length;
ceph_le64 read_length {};

This comment has been minimized.

Copy link
@joscollin

joscollin Sep 15, 2017

Member

Nit: Avoid unwanted space before {

@amitkumar50 amitkumar50 force-pushed the amitkumar50:cov-osd-3 branch from 198a866 to 4420cee Sep 16, 2017

@amitkumar50

This comment has been minimized.

Copy link
Contributor Author

commented Sep 16, 2017

Done Thanks @joscollin

@@ -4404,7 +4404,7 @@ struct C_ChecksumRead : public Context {
OSDOp &osd_op;
Checksummer::CSumType csum_type;
bufferlist init_value_bl;
ceph_le64 read_length;
ceph_le64 read_length{};

This comment has been minimized.

Copy link
@joscollin

joscollin Sep 18, 2017

Member

ceph_le64 seems to be an unsigned integer. So better initialize with 0 to be specific.

@amitkumar50 amitkumar50 force-pushed the amitkumar50:cov-osd-3 branch from 4420cee to c0ab7e9 Oct 8, 2017

@amitkumar50

This comment has been minimized.

Copy link
Contributor Author

commented Oct 8, 2017

Done Thanks @joscollin

@tchaikov

This comment has been minimized.

Copy link
Contributor

commented Oct 24, 2017

/home/jenkins-build/build/workspace/ceph-dev-new-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos7/DIST/centos7/MACHINE_SIZE/huge/release/13.0.0-2372-g6738ee1/rpm/el7/BUILD/ceph-13.0.0-2372-g6738ee1/src/osd/PrimaryLogPG.cc:4381:27: error: could not convert '0' from 'int' to 'ceph_le64 {aka ceph_le<long long unsigned int>}'
   ceph_le64 read_length = 0;
                           ^
@tchaikov
Copy link
Contributor

left a comment

does not compile

Right. I have tested it myself now.

@amitkumar50 amitkumar50 force-pushed the amitkumar50:cov-osd-3 branch from c0ab7e9 to de90bd6 Nov 22, 2017

@amitkumar50

This comment has been minimized.

Copy link
Contributor Author

commented Nov 22, 2017

@tchaikov Done Changes. Thanks

osd: Initialization of data members
Fixes the coverity issues:

** 717336 Uninitialized scalar field
CID 717336 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member whitelisted is not initialized
in this constructor nor in any functions that it calls.

** 728001 Uninitialized scalar field
CID 728001 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member priority is not initialized
in this constructor nor in any functions that it calls.

Signed-off-by: Amit Kumar <amitkuma@redhat.com>
@amitkumar50

This comment has been minimized.

Copy link
Contributor Author

commented Dec 9, 2017

@tchaikov can you plz review

@yuriw

This comment has been minimized.

Copy link
Contributor

commented Dec 12, 2017

@yuriw yuriw merged commit 230e1e4 into ceph:master Dec 13, 2017

5 checks passed

Docs: build check OK - docs built
Details
Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details
make check (arm64) make check succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.