From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F28027054C for ; Mon, 18 Aug 2025 06:34:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755498853; cv=none; b=g8NPeGQyqb+qX8r4321491E9oGfq1nzwwYyyya65JUrvF9MT3EotA519Gt6qCuoZqTkO3Q4FHWnnALdUnHAV6rtcKnCNAG4kSWLpr8oOTDkJldeutlY513/hUzD7hoUZJiaPvWKIoioTdhqu68bqrQVZWdJTBsuCAemXJ3+05AI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755498853; c=relaxed/simple; bh=jCGii2UgR1DubFjNhVV24kwwJVQu4mE/TURwvMamQJo=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=iUffM4Fgipo/BQspnBkTrohhhB35v8Bo2nZJOQKaeQMAKqiroImNn1a7SSkmPexR2sZ5dDzEPGDBpeibvGushFOWKQWM5RH461nE4uBYnnw/MZMlE6/1NqzRSCNXgYoTTaEpGrhanmwJafXkAjYONjNgF6lJpzWW5yXgQW2qgyI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=xw4cWWHh; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="xw4cWWHh" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-3b9e7437908so3849640f8f.3 for ; Sun, 17 Aug 2025 23:34:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1755498850; x=1756103650; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=vboU5xoEehUgMZFt48gs99Sfg/+NXyB1MrQfEX3BN2Q=; b=xw4cWWHhVWDjebedEew7o63WDrm4zYAF2lBSBaUkTpQ3YbsfRslBaiHnlfARibZQDm KlwqTVRkzm13M/SZxD3jFrHCutXLy71ddtSw4n6pxPcNGnKnXOwcjE7IebITU0sOZ4Mk 6q53G3kUx7zHmddEhNU5y9n5TyJtetp36pJon15vzC3FousmRGP98T/DgRNq9cYQ5sCa ByNnomT2TwqRwMBFwfxQC6dBh2pl7zcKl77iAx1/ogrmDDIO5KT2VBiy4h7KxVXaufmq FZQvt2WKuM8wxYvBLPY3TRZ7CWCBnqdEeGaQPwiEkBRhLsNaimCQivxDtCQrgNnPwKRU K9MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755498850; x=1756103650; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vboU5xoEehUgMZFt48gs99Sfg/+NXyB1MrQfEX3BN2Q=; b=M9A0mwD1+VdHi3Q+wcMuvmawqiL7f1bDxRMTAh7HNgJP5vzHX5T3z4yGh++/RBoeHf AoubQtjywA+OIBKb4cisuraXQrppD5iGVptCSIggOceqbQhK+0VrH4Hc5j29au/y9uod x8yml0uVmRZk86VkZT1F02WDxwWRakA+nufH6/22eg++yZXt49tyBisv4tty1xJxQYKh 1DMXZglwAb3jex3mTXZdLbOfdjXVujL7h9vqvJqeJW6mulz+jnNR5JopqidpBXVyQn8+ Lu0ZjEK68M7WGmidMRbtfErFlPLIv07olLuwoOKPG6kFgmyUkOwizLYZbSFJN844sKCS jK8A== X-Forwarded-Encrypted: i=1; AJvYcCU5dNnsYmR/W0PwGmGqWICvvCUxioWO4aFSGL5RW0XVBZffwtP1idhNBqARnKRj2iFr2i1ZKf5hPRPwVuk=@vger.kernel.org X-Gm-Message-State: AOJu0YzAfJiyNBhEitLNYOCbYKLKhtQNu9N5VaSkCE+ZSyzwuBLfZpL0 hzWWf1yNfev8dxE3/MxBNdv6Szjx9aG+LGMlHW0eX3X0su7itvIjrBU1C3BDamLZAzM= X-Gm-Gg: ASbGncv1DsdmuI1ncROBY5JQgz6oLy6ZD0M8HRbTLUV1TA02c3Nf/tic76zh5pRczj+ vPZ+y6KVgnXtW4e2puHuS+QvusPVO10n2xMV8ABlo537sBWdDzxsgLLYYj1a+tk834nyIjffqFm WV7RQPnrT7FTmdGKxr7BF4g+l42RhU39jmiRlymvW2dUqReMz7HdxPDe6imO/BXkRg8NfTH+j8I KcWN5ZdmMqmBOMvPTkagIU1xYc5WMpIhYgNtju0nJ5Ed+8kVHgk1hbfpyFxPDXXO7BC5aBTx50n qLM0eipJwcayyS+2N0wW6s4/632UsKuKFs892NjW+H69EiJg5jGjY/tmyVsruYpdxMOXIMqq1YV pD98r9liAapIF+7BY5gZhDwhSQaC61clyf/OTvQrH46M= X-Google-Smtp-Source: AGHT+IEcL9XvpvVrTZJabDptBXonFfKX8kZQE+VLqoofN9e3zCBpLdnrziNE+gZOjAV0cFhS0TiOPg== X-Received: by 2002:a05:6000:3102:b0:3a5:298a:3207 with SMTP id ffacd0b85a97d-3bc6a28004bmr5124234f8f.48.1755498850198; Sun, 17 Aug 2025 23:34:10 -0700 (PDT) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-45a22210a65sm118913085e9.6.2025.08.17.23.34.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Aug 2025 23:34:09 -0700 (PDT) Date: Mon, 18 Aug 2025 09:34:06 +0300 From: Dan Carpenter To: oe-kbuild@lists.linux.dev, Zong Jiang Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev, linux-serial@vger.kernel.org, Greg Kroah-Hartman Subject: [tty:tty-testing 8/24] drivers/tty/serial/qcom_geni_serial.c:274 get_port_from_line() error: Calling ida_alloc_range() with a 'max' argument which is a power of 2. -1 missing? Message-ID: <202508180815.R2nDyajs-lkp@intel.com> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing head: 7cd9f5d6c5a3f31d2b282d31ddc4d78ff83a5c08 commit: 9391ab1ed9b3fe0d1af7d7858d9bf42f476628c8 [8/24] serial: qcom-geni: Make UART port count configurable via Kconfig config: parisc-randconfig-r072-20250818 (https://download.01.org/0day-ci/archive/20250818/202508180815.R2nDyajs-lkp@intel.com/config) compiler: hppa-linux-gcc (GCC) 8.5.0 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 | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202508180815.R2nDyajs-lkp@intel.com/ New smatch warnings: drivers/tty/serial/qcom_geni_serial.c:274 get_port_from_line() error: Calling ida_alloc_range() with a 'max' argument which is a power of 2. -1 missing? Old smatch warnings: drivers/tty/serial/qcom_geni_serial.c:1931 qcom_geni_serial_probe() warn: missing unwind goto? vim +/max +274 drivers/tty/serial/qcom_geni_serial.c c3e7966c60745f Zong Jiang 2025-08-12 260 static struct qcom_geni_serial_port *get_port_from_line(int line, bool console, struct device *dev) c4f528795d1add Karthikeyan Ramasubramanian 2018-03-14 261 { 8a8a66a1a18a1d Girish Mahadevan 2018-07-13 262 struct qcom_geni_serial_port *port; 9391ab1ed9b3fe Zong Jiang 2025-08-12 263 int nr_ports = console ? GENI_UART_CONS_PORTS : CONFIG_SERIAL_QCOM_GENI_UART_PORTS; 8a8a66a1a18a1d Girish Mahadevan 2018-07-13 264 a53be6945f5123 Viken Dadhaniya 2025-03-27 265 if (console) { a53be6945f5123 Viken Dadhaniya 2025-03-27 266 if (line < 0 || line >= nr_ports) a53be6945f5123 Viken Dadhaniya 2025-03-27 267 return ERR_PTR(-ENXIO); a53be6945f5123 Viken Dadhaniya 2025-03-27 268 a53be6945f5123 Viken Dadhaniya 2025-03-27 269 port = &qcom_geni_console_port; a53be6945f5123 Viken Dadhaniya 2025-03-27 270 } else { a53be6945f5123 Viken Dadhaniya 2025-03-27 271 int max_alias_num = of_alias_get_highest_id("serial"); a53be6945f5123 Viken Dadhaniya 2025-03-27 272 8a8a66a1a18a1d Girish Mahadevan 2018-07-13 273 if (line < 0 || line >= nr_ports) a53be6945f5123 Viken Dadhaniya 2025-03-27 @274 line = ida_alloc_range(&port_ida, max_alias_num + 1, nr_ports, GFP_KERNEL); ida_alloc_range() range parameters are inclusive so this should be ida_alloc_range(&port_ida, max_alias_num + 1, nr_ports - 1, GFP_KERNEL); a53be6945f5123 Viken Dadhaniya 2025-03-27 275 else a53be6945f5123 Viken Dadhaniya 2025-03-27 276 line = ida_alloc_range(&port_ida, line, nr_ports, GFP_KERNEL); same here a53be6945f5123 Viken Dadhaniya 2025-03-27 277 a53be6945f5123 Viken Dadhaniya 2025-03-27 278 if (line < 0) c4f528795d1add Karthikeyan Ramasubramanian 2018-03-14 279 return ERR_PTR(-ENXIO); 8a8a66a1a18a1d Girish Mahadevan 2018-07-13 280 c3e7966c60745f Zong Jiang 2025-08-12 281 port = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL); c3e7966c60745f Zong Jiang 2025-08-12 282 if (!port) c3e7966c60745f Zong Jiang 2025-08-12 283 return ERR_PTR(-ENOMEM); c3e7966c60745f Zong Jiang 2025-08-12 284 c3e7966c60745f Zong Jiang 2025-08-12 285 port->uport.iotype = UPIO_MEM; c3e7966c60745f Zong Jiang 2025-08-12 286 port->uport.ops = &qcom_geni_uart_pops; c3e7966c60745f Zong Jiang 2025-08-12 287 port->uport.flags = UPF_BOOT_AUTOCONF; c3e7966c60745f Zong Jiang 2025-08-12 288 port->uport.line = line; a53be6945f5123 Viken Dadhaniya 2025-03-27 289 } 8a8a66a1a18a1d Girish Mahadevan 2018-07-13 290 return port; c4f528795d1add Karthikeyan Ramasubramanian 2018-03-14 291 } -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D050E26AE4 for ; Mon, 18 Aug 2025 00:36:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755477393; cv=none; b=Q2o6RLrxlGLbXU0QLuuC3cvskC/isgw6B/oBRcgDildPm/g0cBnxwYtSHk1pTZjadKxJiFUDObdKXuZXFujS6hQXHFqNbBnq8E+8qefdrJmHT3ABf8wH9fZgQCXWIminiFqt4ZM6MV1Ybvz2TAMrO4Gc+KkV+KDg9DaDU7g2hho= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755477393; c=relaxed/simple; bh=BMETpxBssu/dPOhJyuwb/m3Ty/oZkasLsCHbZi0qv6I=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=lvydzSfOLCszKoy1BMe8dd6TLgjk51QXM9emvUdR9kYdF6HEHlaKskKyoCi29etbyAnIDby541aqaUSHeKd63coPbVc6NirQcHysLMpaxTxUHtX1GV0tG74fmd7EEGQZE2f3x2k1wuuz1l4WbtHJCnpRdGWHG1FCMCkZoCbb7bI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=RG+XOGaS; arc=none smtp.client-ip=198.175.65.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="RG+XOGaS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1755477392; x=1787013392; h=date:from:to:cc:subject:message-id:mime-version; bh=BMETpxBssu/dPOhJyuwb/m3Ty/oZkasLsCHbZi0qv6I=; b=RG+XOGaSDZx0NOpILyI9qSC5tVL1bj8yKZ8Au1S0uVNeXJxDYeC6H8Ix LL2jWtufye1METiwwY2k+aDZaniL2GCHKQ6dMp3IkMOcbFMp3xnyUvLZO koT7BE+SXltrZK817pF5I+JWo3LS2ZSA4PXw6NF4vKZtT/V6EBtifB++1 Vq3RbLTZtbZNJx6rdMfa66bmdCC06WFkR256VetfuUpOBZmKKH9W0PWx+ XZtqrvaxMQqgJqnOyx8inO8CNN4jV/c3pjL0HBssT1eWrKMuu3galLkpK nClubNnXwkJbe91rVK77yWnLkqjc2gglI5m47I2B6MpEw/0op47VAKdML w==; X-CSE-ConnectionGUID: 8Wgo1Yb9T8+hoF+QDRGzLQ== X-CSE-MsgGUID: fud/8cn+QjiIEc4E78qkMA== X-IronPort-AV: E=McAfee;i="6800,10657,11524"; a="75148701" X-IronPort-AV: E=Sophos;i="6.17,293,1747724400"; d="scan'208";a="75148701" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2025 17:36:32 -0700 X-CSE-ConnectionGUID: HuLHAKnKRsq2l/nLWMcHnQ== X-CSE-MsgGUID: lw3XamFESpGtD/KSNH10JQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.17,293,1747724400"; d="scan'208";a="171689313" Received: from lkp-server02.sh.intel.com (HELO 4ea60e6ab079) ([10.239.97.151]) by orviesa003.jf.intel.com with ESMTP; 17 Aug 2025 17:36:31 -0700 Received: from kbuild by 4ea60e6ab079 with local (Exim 4.96) (envelope-from ) id 1unnrQ-000Dnt-0S; Mon, 18 Aug 2025 00:36:28 +0000 Date: Mon, 18 Aug 2025 08:35:39 +0800 From: kernel test robot To: oe-kbuild@lists.linux.dev Cc: lkp@intel.com, Dan Carpenter Subject: [tty:tty-testing 8/24] drivers/tty/serial/qcom_geni_serial.c:274 get_port_from_line() error: Calling ida_alloc_range() with a 'max' argument which is a power of 2. -1 missing? Message-ID: <202508180815.R2nDyajs-lkp@intel.com> Precedence: bulk X-Mailing-List: oe-kbuild@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline BCC: lkp@intel.com CC: oe-kbuild-all@lists.linux.dev CC: linux-serial@vger.kernel.org TO: Zong Jiang CC: "Greg Kroah-Hartman" tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing head: 7cd9f5d6c5a3f31d2b282d31ddc4d78ff83a5c08 commit: 9391ab1ed9b3fe0d1af7d7858d9bf42f476628c8 [8/24] serial: qcom-geni: Make UART port count configurable via Kconfig :::::: branch date: 14 hours ago :::::: commit date: 4 days ago config: parisc-randconfig-r072-20250818 (https://download.01.org/0day-ci/archive/20250818/202508180815.R2nDyajs-lkp@intel.com/config) compiler: hppa-linux-gcc (GCC) 8.5.0 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 | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202508180815.R2nDyajs-lkp@intel.com/ New smatch warnings: drivers/tty/serial/qcom_geni_serial.c:274 get_port_from_line() error: Calling ida_alloc_range() with a 'max' argument which is a power of 2. -1 missing? Old smatch warnings: drivers/tty/serial/qcom_geni_serial.c:1931 qcom_geni_serial_probe() warn: missing unwind goto? vim +/max +274 drivers/tty/serial/qcom_geni_serial.c c4f528795d1add Karthikeyan Ramasubramanian 2018-03-14 259 c3e7966c60745f Zong Jiang 2025-08-12 260 static struct qcom_geni_serial_port *get_port_from_line(int line, bool console, struct device *dev) c4f528795d1add Karthikeyan Ramasubramanian 2018-03-14 261 { 8a8a66a1a18a1d Girish Mahadevan 2018-07-13 262 struct qcom_geni_serial_port *port; 9391ab1ed9b3fe Zong Jiang 2025-08-12 263 int nr_ports = console ? GENI_UART_CONS_PORTS : CONFIG_SERIAL_QCOM_GENI_UART_PORTS; 8a8a66a1a18a1d Girish Mahadevan 2018-07-13 264 a53be6945f5123 Viken Dadhaniya 2025-03-27 265 if (console) { a53be6945f5123 Viken Dadhaniya 2025-03-27 266 if (line < 0 || line >= nr_ports) a53be6945f5123 Viken Dadhaniya 2025-03-27 267 return ERR_PTR(-ENXIO); a53be6945f5123 Viken Dadhaniya 2025-03-27 268 a53be6945f5123 Viken Dadhaniya 2025-03-27 269 port = &qcom_geni_console_port; a53be6945f5123 Viken Dadhaniya 2025-03-27 270 } else { a53be6945f5123 Viken Dadhaniya 2025-03-27 271 int max_alias_num = of_alias_get_highest_id("serial"); a53be6945f5123 Viken Dadhaniya 2025-03-27 272 8a8a66a1a18a1d Girish Mahadevan 2018-07-13 273 if (line < 0 || line >= nr_ports) a53be6945f5123 Viken Dadhaniya 2025-03-27 @274 line = ida_alloc_range(&port_ida, max_alias_num + 1, nr_ports, GFP_KERNEL); a53be6945f5123 Viken Dadhaniya 2025-03-27 275 else a53be6945f5123 Viken Dadhaniya 2025-03-27 276 line = ida_alloc_range(&port_ida, line, nr_ports, GFP_KERNEL); a53be6945f5123 Viken Dadhaniya 2025-03-27 277 a53be6945f5123 Viken Dadhaniya 2025-03-27 278 if (line < 0) c4f528795d1add Karthikeyan Ramasubramanian 2018-03-14 279 return ERR_PTR(-ENXIO); 8a8a66a1a18a1d Girish Mahadevan 2018-07-13 280 c3e7966c60745f Zong Jiang 2025-08-12 281 port = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL); c3e7966c60745f Zong Jiang 2025-08-12 282 if (!port) c3e7966c60745f Zong Jiang 2025-08-12 283 return ERR_PTR(-ENOMEM); c3e7966c60745f Zong Jiang 2025-08-12 284 c3e7966c60745f Zong Jiang 2025-08-12 285 port->uport.iotype = UPIO_MEM; c3e7966c60745f Zong Jiang 2025-08-12 286 port->uport.ops = &qcom_geni_uart_pops; c3e7966c60745f Zong Jiang 2025-08-12 287 port->uport.flags = UPF_BOOT_AUTOCONF; c3e7966c60745f Zong Jiang 2025-08-12 288 port->uport.line = line; a53be6945f5123 Viken Dadhaniya 2025-03-27 289 } 8a8a66a1a18a1d Girish Mahadevan 2018-07-13 290 return port; c4f528795d1add Karthikeyan Ramasubramanian 2018-03-14 291 } c4f528795d1add Karthikeyan Ramasubramanian 2018-03-14 292 :::::: The code at line 274 was first introduced by commit :::::: a53be6945f5123c19d6fcc30783876705a2e0f00 serial: qcom-geni: Remove alias dependency from qcom serial driver :::::: TO: Viken Dadhaniya :::::: CC: Greg Kroah-Hartman -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki