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

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

Merged
merged 1 commit into from
Mar 4, 2019

Conversation

dbogdan
Copy link
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
/*Check for NULL*/
if(fhmStatus == NULL)
{
return (uint32_t)talApiErrHandler(device, TAL_ERRHDL_INVALID_PARAM,
TAL_ERR_GETFHMSTS_NULL_PARAM, retVal, TALACT_ERR_CHECK_PARAM);
}

#if TALISE_VERBOSE
Copy link
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
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

@@ -1678,7 +1696,7 @@ uint32_t TALISE_setDigDcOffsetEn(taliseDevice_t *device, uint8_t enableMask)
{
dataToWrite |= ((enableMask & ((uint8_t)TAL_DC_OFFSET_ORX1 | (uint8_t)TAL_DC_OFFSET_ORX2)) >> 2);
}

Copy link
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
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
Contributor

commodo commented Mar 1, 2019

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

Copy link
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>
@commodo commodo merged commit 26551a2 into master Mar 4, 2019
@commodo commodo deleted the fix_unused_variable branch March 4, 2019 12:28
threexc pushed a commit to threexc/linux that referenced this pull request Apr 22, 2024
In case when is64 == 1 in emit(A64_REV32(is64, dst, dst), ctx) the
generated insn reverses byte order for both high and low 32-bit words,
resuling in an incorrect swap as indicated by the jit test:

[ 9757.262607] test_bpf: analogdevicesinc#312 BSWAP 16: 0x0123456789abcdef -> 0xefcd jited:1 8 PASS
[ 9757.264435] test_bpf: analogdevicesinc#313 BSWAP 32: 0x0123456789abcdef -> 0xefcdab89 jited:1 ret 1460850314 != -271733879 (0x5712ce8a != 0xefcdab89)FAIL (1 times)
[ 9757.266260] test_bpf: analogdevicesinc#314 BSWAP 64: 0x0123456789abcdef -> 0x67452301 jited:1 8 PASS
[ 9757.268000] test_bpf: analogdevicesinc#315 BSWAP 64: 0x0123456789abcdef >> 32 -> 0xefcdab89 jited:1 8 PASS
[ 9757.269686] test_bpf: analogdevicesinc#316 BSWAP 16: 0xfedcba9876543210 -> 0x1032 jited:1 8 PASS
[ 9757.271380] test_bpf: analogdevicesinc#317 BSWAP 32: 0xfedcba9876543210 -> 0x10325476 jited:1 ret -1460850316 != 271733878 (0xa8ed3174 != 0x10325476)FAIL (1 times)
[ 9757.273022] test_bpf: analogdevicesinc#318 BSWAP 64: 0xfedcba9876543210 -> 0x98badcfe jited:1 7 PASS
[ 9757.274721] test_bpf: analogdevicesinc#319 BSWAP 64: 0xfedcba9876543210 >> 32 -> 0x10325476 jited:1 9 PASS

Fix this by forcing 32bit variant of rev32.

Fixes: 1104247 ("bpf, arm64: Support unconditional bswap")
Signed-off-by: Artem Savkov <asavkov@redhat.com>
Tested-by: Puranjay Mohan <puranjay12@gmail.com>
Acked-by: Puranjay Mohan <puranjay12@gmail.com>
Acked-by: Xu Kuohai <xukuohai@huawei.com>
Message-ID: <20240321081809.158803-1-asavkov@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
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.

None yet

3 participants