From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66211C432BE for ; Tue, 10 Aug 2021 08:15:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4FDDB6105A for ; Tue, 10 Aug 2021 08:15:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4FDDB6105A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ragnatech.se Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 89E956B0071; Tue, 10 Aug 2021 04:15:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 84ED88D0001; Tue, 10 Aug 2021 04:15:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 73D976B0073; Tue, 10 Aug 2021 04:15:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0139.hostedemail.com [216.40.44.139]) by kanga.kvack.org (Postfix) with ESMTP id 580376B0071 for ; Tue, 10 Aug 2021 04:15:21 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id E813118081D62 for ; Tue, 10 Aug 2021 08:15:20 +0000 (UTC) X-FDA: 78458461200.03.4971BFC Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) by imf18.hostedemail.com (Postfix) with ESMTP id 439B14001EB1 for ; Tue, 10 Aug 2021 08:15:20 +0000 (UTC) Received: by mail-lj1-f182.google.com with SMTP id m18so16509060ljo.1 for ; Tue, 10 Aug 2021 01:15:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech-se.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=hTjnJdFQvO4ui/jyq6IbbI6nlacVzKGNGC5xjCkuqE8=; b=fZIhlIMToPuHULlJAtDAslWMIW3oerTim7lmhyhXhgc/3nRUrKzTlsdbJps0G77VSQ ieAxJqUWR9sztQigpr3hZ6MYdg9tCzWY3A6PRJ+9AInnY+Eukautaj6N/TCQKEmk9Eoo loH5X5P1cL7PbV+XjPbKcV3dN7LWL2vSy/Zp8nyVXsfrf+F3g2SojsBthymXVReDRFFY 13wp3bFITVLZdbJ3yfn/1sVFECsS9PQ+Cmp21kAiZaA/XYBRiMcQrSNBURcH8bZpWU7z vJe4TeLfUkuIgsS9nUNiQleFo2Fwrm4GbZWIj+Z/KNndolnPHSUIv88n2wSsXhiot7P2 xAaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=hTjnJdFQvO4ui/jyq6IbbI6nlacVzKGNGC5xjCkuqE8=; b=uIbHrZYVAT6d6cYreBSBTzBcwnfmqP1zzy5egxf0LRmMvARjd7hg6qJ65yXC99lGiR 750376bzrHQEZ1OfqbvMa9g6quFQS7VSkfgDtyxOO1VLutsq3Fz9FuMlMkAGVODHFWIq a/QN9DoaDmW6KJAS22pFeGnl13MwbyBK74X7PHQY148aMdprqzeDRqIFj7pyRa9ChsR9 Sh3vX0HL6JAKo3zH5zTedkNXigUGbcwugIOtD8U0w1g3ietnLjkAqbH2Mc82NCYXeeM8 liRUrRUmQ8BJyIKhTaSKPlSAQbW0OqJggGTaIoXtyaZq4tkocVP14YZL4Nj5iRGBsowF hGTQ== X-Gm-Message-State: AOAM530RZ9935NJaxIfXkYQXxGMOkWtDHhKc9EFTQIztjlp1G7ZITIw3 L8yOCJEjxMEGqHY2GjRWREviPQ== X-Google-Smtp-Source: ABdhPJx2i4Qsx6WaHW0hgYDO9dkpUizWPQoU746eti19P+W1eNfsJwXyUmNWaPsWheDWfucmBxbrIg== X-Received: by 2002:a2e:9d47:: with SMTP id y7mr18657630ljj.408.1628583318371; Tue, 10 Aug 2021 01:15:18 -0700 (PDT) Received: from localhost (h-46-59-88-219.A463.priv.bahnhof.se. [46.59.88.219]) by smtp.gmail.com with ESMTPSA id x26sm1832031lfu.206.2021.08.10.01.15.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 01:15:17 -0700 (PDT) Date: Tue, 10 Aug 2021 10:15:17 +0200 From: Niklas =?iso-8859-1?Q?S=F6derlund?= To: kernel test robot Cc: kbuild-all@lists.01.org, Linux Memory Management List , Mauro Carvalho Chehab , linux-media@vger.kernel.org, Jacopo Mondi , Sakari Ailus Subject: Re: [linux-next:master 5146/6223] drivers/media/platform/rcar-vin/rcar-core.c:220:18: warning: Same value in both branches of ternary operator. [duplicateValueTernary] Message-ID: References: <202108101353.VuDfxbHo-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <202108101353.VuDfxbHo-lkp@intel.com> Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=ragnatech-se.20150623.gappssmtp.com header.s=20150623 header.b=fZIhlIMT; spf=pass (imf18.hostedemail.com: domain of niklas.soderlund@ragnatech.se designates 209.85.208.182 as permitted sender) smtp.mailfrom=niklas.soderlund@ragnatech.se; dmarc=none X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 439B14001EB1 X-Stat-Signature: 8785g5wjc6qso8wrtp5996qo6sm47y6n X-HE-Tag: 1628583320-210849 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hello, I had a look and this is the intended behavior. The macros is defined in=20 rcar-vin.h as, enum rvin_csi_id { RVIN_CSI20, RVIN_CSI21, RVIN_CSI40, RVIN_CSI41, RVIN_CSI_MAX, }; enum rvin_isp_id { RVIN_ISP0, RVIN_ISP1, RVIN_ISP2, RVIN_ISP4, RVIN_ISP_MAX, }; #define RVIN_REMOTES_MAX \ (((unsigned int)RVIN_CSI_MAX) > ((unsigned int)RVIN_ISP_MAX) ? \ RVIN_CSI_MAX : RVIN_ISP_MAX) The idea is to always have RVIN_REMOTES_MAX be the max number of remotes=20 in either the CSI-2 or ISP remote use-cases. The warning is generated=20 now as currently both use-cases have a maximum of 4 remotes. In future=20 this may change and I wanted this to be descibed and addressed by code=20 instead by a comment to remmeber to increment RVIN_REMOTES_MAX if one of=20 the use-cases are expanded. On 2021-08-10 13:42:04 +0800, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next= .git master > head: da454ebf578f6c542ba9f5b3ddb98db3ede109c1 > commit: 0c56f9597adc870e6761822668868fe2930f08bd [5146/6223] media: rca= r-vin: Add r8a779a0 support > compiler: riscv64-linux-gcc (GCC) 10.3.0 >=20 > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot >=20 >=20 > cppcheck warnings: (new ones prefixed by >>) > >> drivers/media/platform/rcar-vin/rcar-core.c:220:18: warning: Same va= lue in both branches of ternary operator. [duplicateValueTernary] > for (i =3D 0; i < RVIN_REMOTES_MAX; i++) > ^ >=20 > vim +220 drivers/media/platform/rcar-vin/rcar-core.c >=20 > 3bb4c3bc85bf77 Niklas S=F6derlund 2018-04-14 210 =20 > 87932605cce9cd Niklas S=F6derlund 2021-07-09 211 /* group lock should= be held when calling this function. */ > 87932605cce9cd Niklas S=F6derlund 2021-07-09 212 static int rvin_grou= p_entity_to_remote_id(struct rvin_group *group, > 87932605cce9cd Niklas S=F6derlund 2021-07-09 213 struct media_= entity *entity) > 87932605cce9cd Niklas S=F6derlund 2021-07-09 214 { > 87932605cce9cd Niklas S=F6derlund 2021-07-09 215 struct v4l2_subdev = *sd; > 87932605cce9cd Niklas S=F6derlund 2021-07-09 216 unsigned int i; > 87932605cce9cd Niklas S=F6derlund 2021-07-09 217 =20 > 87932605cce9cd Niklas S=F6derlund 2021-07-09 218 sd =3D media_entity= _to_v4l2_subdev(entity); > 87932605cce9cd Niklas S=F6derlund 2021-07-09 219 =20 > 87932605cce9cd Niklas S=F6derlund 2021-07-09 @220 for (i =3D 0; i < R= VIN_REMOTES_MAX; i++) > 87932605cce9cd Niklas S=F6derlund 2021-07-09 221 if (group->remotes= [i].subdev =3D=3D sd) > 87932605cce9cd Niklas S=F6derlund 2021-07-09 222 return i; > 87932605cce9cd Niklas S=F6derlund 2021-07-09 223 =20 > 87932605cce9cd Niklas S=F6derlund 2021-07-09 224 return -ENODEV; > 87932605cce9cd Niklas S=F6derlund 2021-07-09 225 } > 87932605cce9cd Niklas S=F6derlund 2021-07-09 226 =20 >=20 > :::::: The code at line 220 was first introduced by commit > :::::: 87932605cce9cd2a7c986abcbf73666855a2ebc7 media: rcar-vin: Move a= nd rename CSI-2 link notifications >=20 > :::::: TO: Niklas S=F6derlund > :::::: CC: Mauro Carvalho Chehab >=20 > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org --=20 Regards, Niklas S=F6derlund