Commit 3588e85c authored by Michael Pyne's avatar Michael Pyne

softraid: Remove dead code and associated warning.

At some point the `in_devs` code may have controlled more than it
currently does, but right now the only logic for `in_devs` is associated
with either if/then branches that do nothing but update `in_devs`, or do
nothing at all.

I looked up the Coverity CID entry 3228 that the code references... it
turns out it was Coverity CID 253228, and was a warning that this code
was dead.  Oops.  At this point the only thing that it looks like it may
have been doing on purpose was to think about warning if an md device
array was used as a subcomponent of a RAID array, but there's currently
no code that does this.

Given that the code is dead, it's best to get rid of it and the
associated warnings.

Differential Revision:
parent 09d8fdf9
......@@ -500,27 +500,16 @@ md1 : active raid1 sda2[0] sdb2[1]
char *eq;
int in_devs = 0;
int temp_int =0;
if (strncmp(current_word, "active", sizeof("active")-1)==0)
MyArray->ArrayActive = true;
else if (strncmp(current_word, "inactive", sizeof("inactive")-1)==0)
MyArray->ArrayActive = false;
else if (MyArray->ArrayActive && MyArray->level == NULL && current_word[0] != '(' && current_word[0] != ':' /*readonly*/) {
MyArray->level = strndup(current_word, current_word_length);
in_devs = 1;
} else if (sscanf(current_word, "%d blocks ", &temp_int) == 1 ) {
MyArray->NumBlocks = temp_int; /* We have to do it via a temp_int variable otherwise we'll end up with nonsence if it's not found */
} else if (in_devs && strncmp(current_word, "blocks", sizeof("blocks")-1)==0)
in_devs = 0;
#ifdef __GNUC__
#warning in_devs cannot be != 0!! (CID 3228)
else if (in_devs && strncmp(current_word, "md", 2)==0) {
/* This has an md device as a component. Maybe we should note this or something*/
} else if(sscanf(current_word, "%[^[ ][%d]%[^ ]", buffer, &harddisk_index, status) >= 2) {
/*Each device in the raid has an index. We can find the total number of devices in the raid by
simply finding the device with the highest index + 1. */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment