Skip to content

Commit

Permalink
stress-ng: restructure loop stress_exclude_unsupported
Browse files Browse the repository at this point in the history
Remove a level of indentation

Signed-off-by: Colin Ian King <[email protected]>
  • Loading branch information
ColinIanKing committed Oct 10, 2024
1 parent f6574a3 commit a656818
Showing 1 changed file with 25 additions and 21 deletions.
46 changes: 25 additions & 21 deletions stress-ng.c
Original file line number Diff line number Diff line change
Expand Up @@ -2849,32 +2849,36 @@ static inline void stress_exclude_unsupported(bool *unsupported)

for (i = 0; i < SIZEOF_ARRAY(stressors); i++) {
const stress_t *stressor = &stressors[i];
stress_stressor_t *ss;

if (stressor->info) {
if (stressor->info->supported) {
for (ss = stressors_head; ss; ss = ss->next) {
if (!ss->ignore.run) {
const char *name = ss->stressor->name;
if (!stressor->info)
continue;

if ((ss->stressor == stressor) && ss->num_instances &&
(stressor->info->supported(name) < 0)) {
stress_ignore_stressor(ss, STRESS_STRESSOR_UNSUPPORTED);
*unsupported = true;
}
if (stressor->info->supported) {
stress_stressor_t *ss;

for (ss = stressors_head; ss; ss = ss->next) {
if (!ss->ignore.run) {
const char *name = ss->stressor->name;

if ((ss->stressor == stressor) && ss->num_instances &&
(stressor->info->supported(name) < 0)) {
stress_ignore_stressor(ss, STRESS_STRESSOR_UNSUPPORTED);
*unsupported = true;
}
}
}
if (stressor->info->stressor == stress_unimplemented) {
for (ss = stressors_head; ss; ss = ss->next) {
if (!ss->ignore.run) {
const char *name = ss->stressor->name;

if ((ss->stressor == stressor) && ss->num_instances) {
stress_exclude_unimplemented(name, stressor->info);
stress_ignore_stressor(ss, STRESS_STRESSOR_UNSUPPORTED);
*unsupported = true;
}
}
if (stressor->info->stressor == stress_unimplemented) {
stress_stressor_t *ss;

for (ss = stressors_head; ss; ss = ss->next) {
if (!ss->ignore.run) {
const char *name = ss->stressor->name;

if ((ss->stressor == stressor) && ss->num_instances) {
stress_exclude_unimplemented(name, stressor->info);
stress_ignore_stressor(ss, STRESS_STRESSOR_UNSUPPORTED);
*unsupported = true;
}
}
}
Expand Down

0 comments on commit a656818

Please sign in to comment.