Skip to content

iio: adc: talise: Fix unused variable warnings#318

Merged
commodo merged 1 commit intomasterfrom
fix_unused_variable
Mar 4, 2019
Merged

iio: adc: talise: Fix unused variable warnings#318
commodo merged 1 commit intomasterfrom
fix_unused_variable

Conversation

@dbogdan
Copy link
Copy Markdown
Contributor

@dbogdan dbogdan commented Feb 28, 2019

warning: unused variable ‘halError’ [-Wunused-variable]
adiHalErr_t halError = ADIHAL_OK;
^~~~~~~~

Signed-off-by: Dragos Bogdan dragos.bogdan@analog.com

@dbogdan dbogdan requested a review from a team February 28, 2019 22:36
TAL_ERR_GETFHMSTS_NULL_PARAM, retVal, TALACT_ERR_CHECK_PARAM);
}

#if TALISE_VERBOSE
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure moving this higher is semantically correct;
technically, fhmStatus == NULL can happen and then the talWriteToLog() would write error TAL_ERR_OK

one idea to fix this lower is to add brackets to introduce a new scope ;
so, technically somethhing like this

#if TALISE_VERBOSE
{
    adiHalErr_t halError = ADIHAL_OK;

    halError = talWriteToLog(device->devHalInfo, ADIHAL_LOG_MSG, TAL_ERR_OK, "TALISE_getFhmStatus()\n");
    retVal = talApiErrHandler(device, TAL_ERRHDL_HAL_LOG, halError, retVal, TALACT_WARN_RESET_LOG);
}
#endif

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm; i take back what i said;
this should be fine; given that other places do the same thing

sorry for the noise

{
dataToWrite |= ((enableMask & ((uint8_t)TAL_DC_OFFSET_ORX1 | (uint8_t)TAL_DC_OFFSET_ORX2)) >> 2);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: some whitespace changes are mixed into this patch

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for that. My editor is automatically removing the whitespace in these cases. I've pushed the updated commit.

@commodo
Copy link
Copy Markdown
Contributor

commodo commented Mar 1, 2019

just some minor comments;
will merge next week if nobody has any objections

Copy link
Copy Markdown
Contributor

@mhennerich mhennerich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API driver is not something we maintain here. We should fix this also wherever this code is maintained.

warning: unused variable ‘halError’ [-Wunused-variable]
     adiHalErr_t halError = ADIHAL_OK;
                 ^~~~~~~~

Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com>
@dbogdan dbogdan force-pushed the fix_unused_variable branch from b914464 to 1fbeca5 Compare March 1, 2019 08:58
@commodo commodo merged commit 26551a2 into master Mar 4, 2019
@commodo commodo deleted the fix_unused_variable branch March 4, 2019 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants