Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* Re: [PATCH v2 1/5] media: qcom: iris: Improve format alignment for encoder
       [not found] <20251031-iris_encoder_enhancements-v2-1-319cd75cbb45@oss.qualcomm.com>
@ 2025-11-03 10:54 ` kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-11-03 10:54 UTC (permalink / raw)
  To: Wangao Wang, Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab
  Cc: llvm, oe-kbuild-all, linux-media, linux-arm-msm, linux-kernel,
	Wangao Wang, quic_qiweil, quic_renjiang

Hi Wangao,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 13863a59e410cab46d26751941980dc8f088b9b3]

url:    https://github.com/intel-lab-lkp/linux/commits/Wangao-Wang/media-qcom-iris-Improve-format-alignment-for-encoder/20251031-175803
base:   13863a59e410cab46d26751941980dc8f088b9b3
patch link:    https://lore.kernel.org/r/20251031-iris_encoder_enhancements-v2-1-319cd75cbb45%40oss.qualcomm.com
patch subject: [PATCH v2 1/5] media: qcom: iris: Improve format alignment for encoder
config: riscv-allmodconfig (https://download.01.org/0day-ci/archive/20251103/202511031813.c8c7mkXF-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project d2625a438020ad35330cda29c3def102c1687b1b)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251103/202511031813.c8c7mkXF-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202511031813.c8c7mkXF-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c:236:7: warning: variable 'left_offset' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
     236 |                 if (V4L2_TYPE_IS_CAPTURE(plane)) {
         |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/uapi/linux/videodev2.h:182:2: note: expanded from macro 'V4L2_TYPE_IS_CAPTURE'
     182 |         (V4L2_TYPE_IS_VALID(type) && !V4L2_TYPE_IS_OUTPUT(type))
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c:246:43: note: uninitialized use occurs here
     246 |         payload[0] = FIELD_PREP(GENMASK(31, 16), left_offset) | top_offset;
         |                                                  ^~~~~~~~~~~
   drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c:236:3: note: remove the 'if' if its condition is always true
     236 |                 if (V4L2_TYPE_IS_CAPTURE(plane)) {
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c:236:7: warning: variable 'left_offset' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
     236 |                 if (V4L2_TYPE_IS_CAPTURE(plane)) {
         |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/uapi/linux/videodev2.h:182:3: note: expanded from macro 'V4L2_TYPE_IS_CAPTURE'
     182 |         (V4L2_TYPE_IS_VALID(type) && !V4L2_TYPE_IS_OUTPUT(type))
         |          ^~~~~~~~~~~~~~~~~~~~~~~~
   include/uapi/linux/videodev2.h:165:2: note: expanded from macro 'V4L2_TYPE_IS_VALID'
     165 |         ((type) >= V4L2_BUF_TYPE_VIDEO_CAPTURE &&\
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     166 |          (type) <= V4L2_BUF_TYPE_META_OUTPUT)
         |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c:246:43: note: uninitialized use occurs here
     246 |         payload[0] = FIELD_PREP(GENMASK(31, 16), left_offset) | top_offset;
         |                                                  ^~~~~~~~~~~
   drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c:236:7: note: remove the '&&' if its condition is always true
     236 |                 if (V4L2_TYPE_IS_CAPTURE(plane)) {
         |                     ^
   include/uapi/linux/videodev2.h:182:3: note: expanded from macro 'V4L2_TYPE_IS_CAPTURE'
     182 |         (V4L2_TYPE_IS_VALID(type) && !V4L2_TYPE_IS_OUTPUT(type))
         |          ^
   include/uapi/linux/videodev2.h:165:2: note: expanded from macro 'V4L2_TYPE_IS_VALID'
     165 |         ((type) >= V4L2_BUF_TYPE_VIDEO_CAPTURE &&\
         |         ^
>> drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c:236:7: warning: variable 'left_offset' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
     236 |                 if (V4L2_TYPE_IS_CAPTURE(plane)) {
         |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/uapi/linux/videodev2.h:182:3: note: expanded from macro 'V4L2_TYPE_IS_CAPTURE'
     182 |         (V4L2_TYPE_IS_VALID(type) && !V4L2_TYPE_IS_OUTPUT(type))
         |          ^~~~~~~~~~~~~~~~~~~~~~~~
   include/uapi/linux/videodev2.h:165:3: note: expanded from macro 'V4L2_TYPE_IS_VALID'
     165 |         ((type) >= V4L2_BUF_TYPE_VIDEO_CAPTURE &&\
         |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c:246:43: note: uninitialized use occurs here
     246 |         payload[0] = FIELD_PREP(GENMASK(31, 16), left_offset) | top_offset;
         |                                                  ^~~~~~~~~~~
   drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c:236:7: note: remove the '&&' if its condition is always true
     236 |                 if (V4L2_TYPE_IS_CAPTURE(plane)) {
         |                     ^
   include/uapi/linux/videodev2.h:182:3: note: expanded from macro 'V4L2_TYPE_IS_CAPTURE'
     182 |         (V4L2_TYPE_IS_VALID(type) && !V4L2_TYPE_IS_OUTPUT(type))
         |          ^
   include/uapi/linux/videodev2.h:165:3: note: expanded from macro 'V4L2_TYPE_IS_VALID'
     165 |         ((type) >= V4L2_BUF_TYPE_VIDEO_CAPTURE &&\
         |          ^
   drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c:217:17: note: initialize the variable 'left_offset' to silence this warning
     217 |         u32 left_offset, top_offset;
         |                        ^
         |                         = 0
   3 warnings generated.


vim +236 drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c

   211	
   212	static int iris_hfi_gen2_set_crop_offsets(struct iris_inst *inst, u32 plane)
   213	{
   214		struct iris_inst_hfi_gen2 *inst_hfi_gen2 = to_iris_inst_hfi_gen2(inst);
   215		u32 port = iris_hfi_gen2_get_port(inst, plane);
   216		u32 bottom_offset, right_offset;
   217		u32 left_offset, top_offset;
   218		u32 codec_align;
   219		u32 payload[2];
   220	
   221		codec_align = inst->codec == V4L2_PIX_FMT_HEVC ? 32 : 16;
   222	
   223		if (inst->domain == DECODER) {
   224			if (V4L2_TYPE_IS_OUTPUT(plane)) {
   225				bottom_offset = (inst->fmt_src->fmt.pix_mp.height - inst->crop.height);
   226				right_offset = (inst->fmt_src->fmt.pix_mp.width - inst->crop.width);
   227				left_offset = inst->crop.left;
   228				top_offset = inst->crop.top;
   229			} else {
   230				bottom_offset = (inst->fmt_dst->fmt.pix_mp.height - inst->compose.height);
   231				right_offset = (inst->fmt_dst->fmt.pix_mp.width - inst->compose.width);
   232				left_offset = inst->compose.left;
   233				top_offset = inst->compose.top;
   234			}
   235		} else {
 > 236			if (V4L2_TYPE_IS_CAPTURE(plane)) {
   237				bottom_offset = (ALIGN(inst->enc_raw_height, codec_align) -
   238						inst->enc_raw_height);
   239				right_offset = (ALIGN(inst->enc_raw_width, codec_align) -
   240						inst->enc_raw_width);
   241				left_offset = inst->crop.left;
   242				top_offset = inst->crop.top;
   243			}
   244		}
   245	
   246		payload[0] = FIELD_PREP(GENMASK(31, 16), left_offset) | top_offset;
   247		payload[1] = FIELD_PREP(GENMASK(31, 16), right_offset) | bottom_offset;
   248		inst_hfi_gen2->src_subcr_params.crop_offsets[0] = payload[0];
   249		inst_hfi_gen2->src_subcr_params.crop_offsets[1] = payload[1];
   250	
   251		return iris_hfi_gen2_session_set_property(inst,
   252							  HFI_PROP_CROP_OFFSETS,
   253							  HFI_HOST_FLAGS_NONE,
   254							  port,
   255							  HFI_PAYLOAD_64_PACKED,
   256							  &payload,
   257							  sizeof(u64));
   258	}
   259	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-11-03 10:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20251031-iris_encoder_enhancements-v2-1-319cd75cbb45@oss.qualcomm.com>
2025-11-03 10:54 ` [PATCH v2 1/5] media: qcom: iris: Improve format alignment for encoder kernel test robot

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