From: Alex Elder <elder@linaro.org>
To: kernel test robot <lkp@intel.com>
Cc: kbuild-all@lists.01.org,
Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [linux-next:master 6165/12612] drivers/net/ipa/ipa_endpoint.c:478:6: warning: Same value in both branches of ternary operator. [duplicateValueTernary]
Date: Wed, 23 Jun 2021 13:15:54 -0500 [thread overview]
Message-ID: <3c166d5b-e642-a169-b0fb-deba1be68646@linaro.org> (raw)
In-Reply-To: <202106240127.TGJDGPf7-lkp@intel.com>
On 6/23/21 12:03 PM, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head: d61c8b66c84080ecf8f9f4d9272ab4ec78029a59
> commit: 5567d4d9e7381230462a564d4f466177f3ba9dd5 [6165/12612] net: ipa: add support for inline checksum offload
> compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
>
> cppcheck warnings: (new ones prefixed by >>)
>>> drivers/net/ipa/ipa_endpoint.c:478:6: warning: Same value in both branches of ternary operator. [duplicateValueTernary]
> : IPA_CS_OFFLOAD_INLINE;
> ^
Here is the full expression:
enabled = version < IPA_VERSION_4_5
? IPA_CS_OFFLOAD_UL
: IPA_CS_OFFLOAD_INLINE;
The *value* of IPA_CS_OFFLOAD_UL *happens to be* the same
as IPA_CS_OFFLOAD_INLINE, but they represent distinct things.
The code is doing what it's doing very intentionally.
I would like to avoid being reminded of this "problem" in
the future, but I don't expect replying to the robot is
the way to do that.
Anyone have a suggestion? Am I fine if I simply ignore this?
-Alex
> cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>
>>> net/sctp/socket.c:6135:3: warning: Assignment of function parameter has no effect outside the function. Did you forget dereferencing it? [uselessAssignmentPtrArg]
> to += addrlen;
> ^
>>> net/sctp/socket.c:6137:3: warning: Assignment of function parameter has no effect outside the function. [uselessAssignmentArg]
> space_left -= addrlen;
> ^
>
> vim +478 drivers/net/ipa/ipa_endpoint.c
>
> 456
> 457 static void ipa_endpoint_init_cfg(struct ipa_endpoint *endpoint)
> 458 {
> 459 u32 offset = IPA_REG_ENDP_INIT_CFG_N_OFFSET(endpoint->endpoint_id);
> 460 enum ipa_cs_offload_en enabled;
> 461 u32 val = 0;
> 462
> 463 /* FRAG_OFFLOAD_EN is 0 */
> 464 if (endpoint->data->checksum) {
> 465 enum ipa_version version = endpoint->ipa->version;
> 466
> 467 if (endpoint->toward_ipa) {
> 468 u32 checksum_offset;
> 469
> 470 /* Checksum header offset is in 4-byte units */
> 471 checksum_offset = sizeof(struct rmnet_map_header);
> 472 checksum_offset /= sizeof(u32);
> 473 val |= u32_encode_bits(checksum_offset,
> 474 CS_METADATA_HDR_OFFSET_FMASK);
> 475
> 476 enabled = version < IPA_VERSION_4_5
> 477 ? IPA_CS_OFFLOAD_UL
> > 478 : IPA_CS_OFFLOAD_INLINE;
> 479 } else {
> 480 enabled = version < IPA_VERSION_4_5
> 481 ? IPA_CS_OFFLOAD_DL
> 482 : IPA_CS_OFFLOAD_INLINE;
> 483 }
> 484 } else {
> 485 enabled = IPA_CS_OFFLOAD_NONE;
> 486 }
> 487 val |= u32_encode_bits(enabled, CS_OFFLOAD_EN_FMASK);
> 488 /* CS_GEN_QMB_MASTER_SEL is 0 */
> 489
> 490 iowrite32(val, endpoint->ipa->reg_virt + offset);
> 491 }
> 492
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
>
prev parent reply other threads:[~2021-06-23 18:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-23 17:03 kernel test robot
2021-06-23 18:15 ` Alex Elder [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3c166d5b-e642-a169-b0fb-deba1be68646@linaro.org \
--to=elder@linaro.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox