linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 6165/12612] drivers/net/ipa/ipa_endpoint.c:478:6: warning: Same value in both branches of ternary operator. [duplicateValueTernary]
@ 2021-06-23 17:03 kernel test robot
  2021-06-23 18:15 ` Alex Elder
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2021-06-23 17:03 UTC (permalink / raw)
  To: Alex Elder; +Cc: kbuild-all, Linux Memory Management List

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;
        ^

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-23 18:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-23 17:03 [linux-next:master 6165/12612] drivers/net/ipa/ipa_endpoint.c:478:6: warning: Same value in both branches of ternary operator. [duplicateValueTernary] kernel test robot
2021-06-23 18:15 ` Alex Elder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox