Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp506629iog; Fri, 17 Jun 2022 07:46:30 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sGfig4SiYkMxX4zPf7oNd0ri1ZDVRB5J4N7nWwJyYsOcc6eagEF3r6TJ9tenWXac/Qodj7 X-Received: by 2002:a17:906:2001:b0:6f3:bd7f:d878 with SMTP id 1-20020a170906200100b006f3bd7fd878mr9805412ejo.133.1655477190592; Fri, 17 Jun 2022 07:46:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655477190; cv=none; d=google.com; s=arc-20160816; b=OnrSs97LMGG3Mfu/Z4vznPlM1fX+/W4z2PY2uXXF9VGOIvRtTPUMDIJomo8te0Hoip QvPp6uIpnDJeXRsUm4ZstK2uJ4wyk0AcBDArAD0XaUiAuPYhzPgJFeAgGvRfkGj5NG1H axrSOfhP2Q7w9bS7WAEgTL2d0i7AKW78F9pwEIN6MtBqL3KiRKUYUDfVv8EPpGxQz+vR WK1tZ8a+UcBrlWeC/5i13rIQD1fsfDOCDTZAUlRHe2xU4n3tjAunr3//D2PqpLss/PX4 iJNP//mFpAJSA+KBANxpK9ToFw8bzWZmL4jiPW7lpww56RpdzPZOqRB5twT+H2P9mVnv O67g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=to73bPfqtP6VCBE+P6OqTBAaKW9C6/rXQdHMSBECfYM=; b=OCF5+Ycicu2s2D7LsKrBcR4RZR+YaS9Dl37F2tBKzbM8W9i/TuLym0AQgH+BYbCTQi d4zzJxfmDL2z7ImGe2llg3t6PojiqQ1rgaSYRFoz8r9HUhZ2h1CuGLvh+Pl/2yVaAXt9 9wsuW2e6lZvO3Fzbelt270hNlF/r59jjCoPFhcVlbl+KN7gedL0tfBaaK1XESrtM1wUV qlDoisD/U3Khmn9IDZlET5LdEw10x5gmOKvBloTKYOSJk63hx4jjKH6V8ek3mL8ubTw7 znyWzY5PoqSqOLJeurcsy4x0GTEh/Ia+debaOH5g1m0ft9Qnmfv1CqzQATki9bjQS10E 52sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Iu3o569Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sh7-20020a1709076e8700b00706ba4fdb72si3149833ejc.891.2022.06.17.07.46.04; Fri, 17 Jun 2022 07:46:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Iu3o569Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382785AbiFQOkt (ORCPT + 99 others); Fri, 17 Jun 2022 10:40:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233234AbiFQOks (ORCPT ); Fri, 17 Jun 2022 10:40:48 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43FEE39684; Fri, 17 Jun 2022 07:40:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655476847; x=1687012847; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=nUf3VSmAhMT7KhA0SZgvMeAAppiMPu6TfIssmeBBkZ0=; b=Iu3o569Zq7X/KFY3ys6MNnLHLpzc43WCvCoXjM/MTeGREhs7gOA174ob KDPIe+QVFKcoVut3CyIRjkJDbJUoVbqhBkfT73wxDpupUtOKZhYaYqIZU 0jD6NdgGjGnEMLcmwKFibowiD9qMjZUM6UPwFrSvfqIJyptPrffZYbnIM IPp6E8grhv2V4maIQVenz3ZvaRRWpElzY3oUR8Bgalc73z4zbsmCkexoO LCsl6XLlb0EMw7GG1vfALSrTdAKeT0C/L3PWTiA4sCgt1LLSAWyTFs5gV XjjvN1/Buh7p12rKXvgMwm583NZ9D4mkt04OnDhRo2P7EnDNUw2oCEToE A==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="341193588" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="341193588" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2022 07:40:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="713789777" Received: from lkp-server01.sh.intel.com (HELO 60dabacc1df6) ([10.239.97.150]) by orsmga004.jf.intel.com with ESMTP; 17 Jun 2022 07:40:44 -0700 Received: from kbuild by 60dabacc1df6 with local (Exim 4.95) (envelope-from ) id 1o2D9P-000PVx-Mp; Fri, 17 Jun 2022 14:40:43 +0000 Date: Fri, 17 Jun 2022 22:40:25 +0800 From: kernel test robot To: Ricardo Ribalda , Laurent Pinchart , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, tfiga@chromium.org, senozhatsky@chromium.org, yunkec@google.com Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org, linux-media@vger.kernel.org, Ricardo Ribalda Subject: Re: [PATCH v7 2/8] media: uvcvideo: Add support for per-device control mapping overrides Message-ID: <202206172239.M4dQBUhz-lkp@intel.com> References: <20220617103645.71560-3-ribalda@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220617103645.71560-3-ribalda@chromium.org> X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ricardo, I love your patch! Perhaps something to improve: [auto build test WARNING on media-tree/master] [also build test WARNING on linus/master v5.19-rc2 next-20220617] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/intel-lab-lkp/linux/commits/Ricardo-Ribalda/uvcvideo-Fix-handling-of-power_line_frequency/20220617-185644 base: git://linuxtv.org/media_tree.git master config: hexagon-randconfig-r045-20220617 (https://download.01.org/0day-ci/archive/20220617/202206172239.M4dQBUhz-lkp@intel.com/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d764aa7fc6b9cc3fbe960019018f5f9e941eb0a6) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/10bdca4191d7a8be97c77dbe4ba89c05713ee0e2 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Ricardo-Ribalda/uvcvideo-Fix-handling-of-power_line_frequency/20220617-185644 git checkout 10bdca4191d7a8be97c77dbe4ba89c05713ee0e2 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/media/usb/uvc/ If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> drivers/media/usb/uvc/uvc_ctrl.c:2442:6: warning: variable 'mapping' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (chain->dev->info->mappings) { ^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/media/usb/uvc/uvc_ctrl.c:2459:9: note: uninitialized use occurs here mend = mapping + ARRAY_SIZE(uvc_ctrl_mappings); ^~~~~~~ drivers/media/usb/uvc/uvc_ctrl.c:2442:2: note: remove the 'if' if its condition is always true if (chain->dev->info->mappings) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/media/usb/uvc/uvc_ctrl.c:2406:43: note: initialize the variable 'mapping' to silence this warning const struct uvc_control_mapping *mapping; ^ = NULL 1 warning generated. vim +2442 drivers/media/usb/uvc/uvc_ctrl.c 2396 2397 /* 2398 * Add control information and hardcoded stock control mappings to the given 2399 * device. 2400 */ 2401 static void uvc_ctrl_init_ctrl(struct uvc_video_chain *chain, 2402 struct uvc_control *ctrl) 2403 { 2404 const struct uvc_control_info *info = uvc_ctrls; 2405 const struct uvc_control_info *iend = info + ARRAY_SIZE(uvc_ctrls); 2406 const struct uvc_control_mapping *mapping; 2407 const struct uvc_control_mapping *mend; 2408 2409 /* XU controls initialization requires querying the device for control 2410 * information. As some buggy UVC devices will crash when queried 2411 * repeatedly in a tight loop, delay XU controls initialization until 2412 * first use. 2413 */ 2414 if (UVC_ENTITY_TYPE(ctrl->entity) == UVC_VC_EXTENSION_UNIT) 2415 return; 2416 2417 for (; info < iend; ++info) { 2418 if (uvc_entity_match_guid(ctrl->entity, info->entity) && 2419 ctrl->index == info->index) { 2420 uvc_ctrl_add_info(chain->dev, ctrl, info); 2421 /* 2422 * Retrieve control flags from the device. Ignore errors 2423 * and work with default flag values from the uvc_ctrl 2424 * array when the device doesn't properly implement 2425 * GET_INFO on standard controls. 2426 */ 2427 uvc_ctrl_get_flags(chain->dev, ctrl, &ctrl->info); 2428 break; 2429 } 2430 } 2431 2432 if (!ctrl->initialized) 2433 return; 2434 2435 /* 2436 * First check if the device provides a custom mapping for this control, 2437 * used to override standard mappings for non-conformant devices. Don't 2438 * process standard mappings if a custom mapping is found. This 2439 * mechanism doesn't support combining standard and custom mappings for 2440 * a single control. 2441 */ > 2442 if (chain->dev->info->mappings) { 2443 bool custom = false; 2444 unsigned int i; 2445 2446 for (i = 0; (mapping = chain->dev->info->mappings[i]); ++i) { 2447 if (uvc_entity_match_guid(ctrl->entity, mapping->entity) && 2448 ctrl->info.selector == mapping->selector) { 2449 __uvc_ctrl_add_mapping(chain, ctrl, mapping); 2450 custom = true; 2451 } 2452 } 2453 2454 if (custom) 2455 return; 2456 } 2457 2458 /* Process common mappings next. */ 2459 mend = mapping + ARRAY_SIZE(uvc_ctrl_mappings); 2460 for (mapping = uvc_ctrl_mappings; mapping < mend; ++mapping) { 2461 if (uvc_entity_match_guid(ctrl->entity, mapping->entity) && 2462 ctrl->info.selector == mapping->selector) 2463 __uvc_ctrl_add_mapping(chain, ctrl, mapping); 2464 } 2465 2466 /* Finally process version-specific mappings. */ 2467 if (chain->dev->uvc_version < 0x0150) { 2468 mapping = uvc_ctrl_mappings_uvc11; 2469 mend = mapping + ARRAY_SIZE(uvc_ctrl_mappings_uvc11); 2470 } else { 2471 mapping = uvc_ctrl_mappings_uvc15; 2472 mend = mapping + ARRAY_SIZE(uvc_ctrl_mappings_uvc15); 2473 } 2474 2475 for (; mapping < mend; ++mapping) { 2476 if (uvc_entity_match_guid(ctrl->entity, mapping->entity) && 2477 ctrl->info.selector == mapping->selector) 2478 __uvc_ctrl_add_mapping(chain, ctrl, mapping); 2479 } 2480 } 2481 -- 0-DAY CI Kernel Test Service https://01.org/lkp