From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 30BB332A3C2 for ; Mon, 15 Dec 2025 08:56:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765788965; cv=none; b=LfTQBChh7DiVSP2Bi0ooMdB/NKJKqN4gnjw6MbTyXhYDprZD4pcjQ6A9OUA96JdRnUrVjBXxE63hRyzTd05dturLIg5GL+FUZRizxtp7Hb3EJwBR+w1wQcOiMbRukD/wIwUdqeEgZOCfYDNXj7CdlQWyqbwYBJtqOcgiyd/fDqU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765788965; c=relaxed/simple; bh=g/2Wxfy4EvsBb8UMJq1GZ6pC8hScpvDATZW2h+f56hw=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=jLvya1zHgs2EzX4NzDqLAA7/8Q27HHuIm+hStbs0/YzzBiHMf15wC55NXVg1EraD1Hp0q0YNypfyhzJGXm9jtlqlzLecceUDh4+GJGCejK5pqJSqjiEOQ3Tvsz1Wol9mtYYys/yBjiHNq8l2vi5KW0ZceT9b0jqI0ifehE45DOs= 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=Yw8GmtAo; arc=none smtp.client-ip=209.85.128.50 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="Yw8GmtAo" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4779a637712so21067725e9.1 for ; Mon, 15 Dec 2025 00:56:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765788961; x=1766393761; 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=VpxYPL0HdtCrqLqGF5zUwqpO5ote7rY6HHFj6ESSu4k=; b=Yw8GmtAoAB5OYij0XzWYVvINrtC2b5hgSyzaXGOhtpVOGIrVgog6nsw5tCzB3LFIiI c9OlnMauZHb6y+PNVZXmbaBStANWl2elB+5vEKcR2hFh5sfXYvscvjfH1iWSvxWvbrGw XEainkfb07tznoAsc6SrwLcyuC9IGCXUEKzWrOVC0U+w6vJhBV7kXeA5By4lyEhR7bvU uQ5m7DqmykJE1PB7eduP1Mjs24JBD4RSOmYthpHXCGvmQxz8SWCxmcKV0G0GrSHMmB7j V5RQ5wcdCRpeIyAx4nXW0aO5j6OZjzWW7Qr3s8aAwxfoUsR+L65l0eWJlXiqh1tWBYvy yklQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765788961; x=1766393761; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VpxYPL0HdtCrqLqGF5zUwqpO5ote7rY6HHFj6ESSu4k=; b=HAB/LcBj59EXmZ1jv/Iu5jSu7VUKv3gymuTimEi+XB97Gg5kc1muvL38zCEjSJ9Tsr YvzAd3CxzqiEwCpNc6KfaCMfPq3tTkgqEC8TWAFh00zbDrTvuUDGgaorbtJa0LOqwKzy jw8QeiLREvBgnG1wc5aNmG/CzbkprhBJimdC1gDyAWenfoMjkEdxjSZOyInSk3t+LrCO L/Iauq5RPvrQMHlCFbZaGNY6pTpdmdMuZTGR9Oft1LB5SGqDSOvSgVqpRw6aXFi/7K5b BqvPbmE/TGHFlUznnmWVKuLfWnkC6YkNM7/Jtd5e5ilfxDmX1iexqoiM1bmBydO7m101 t2iA== X-Forwarded-Encrypted: i=1; AJvYcCV4S1/aU9mRmdjnoyhq+J0rxw8FOTqCMN9LXXoSx4unh0dC4FeB8doG4kI0sIGMXikhXOMp8QF6PqoYgv0=@vger.kernel.org X-Gm-Message-State: AOJu0YyW9UVbFfSXNe0PJedYOphS2Vg8ZnkLEncjoKuAfpZcRkkYdraM KFTM/OXkSsmHst0tswQisSSDty3/B9+bGb1/1T56l9Xy4Py6R36fQ9uua0IhvBA34WatKOkpfMX 6bkEN X-Gm-Gg: AY/fxX64PnfgDT+xrvVpQ7+3DWyTzDAjvGgO1ndQSFiMnve94mZNMh3bh0jqFF3mpm5 gy4YblLL4EAqlPwp9hRsEty3Nzkq8So40q8qPnddhBkY93ElO955zbixuzZeG9ogNuHkiiOXQsn UcaV9b3TUKxzPWUAw0danmIhpLu0s+23TphF5YKfpOP2bFyVZ2nBRYbAmMy+05Ehzo3yClPOuWb bQ7+vvNiSO+wKAyj4N0wGPZWX/C9HE05VEnl5juu++dP5OA2kdmQRpWWCWESpgo4bZV9igj3chr MSQBcc6S9qBnsclnvjfnFO9sbQy5q1LTerXJdeByVwKy+XunXODgR/xY6Ab00p2akulDcBbGY9c DWheD979VV7WjHsBH3+R8UL6Xo82YS926g1/T5yJdM6L/+QC0z+kKnDXj+PSQqmd2w09BWI+HHr 9o55+4eim16wNiGPxgHt08xfaTVio= X-Google-Smtp-Source: AGHT+IH9Vx9lRYuyM4i2CiUhArv9FtRXYRfsNl/RiYjV6a4nRnO+2fem7eDPYCjb74HIPXI2vc9U0Q== X-Received: by 2002:a05:600c:4f90:b0:477:9dc1:b706 with SMTP id 5b1f17b1804b1-47a8f9055bfmr92419345e9.19.1765788961213; Mon, 15 Dec 2025 00:56:01 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47a8f721a61sm62296135e9.20.2025.12.15.00.56.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Dec 2025 00:56:00 -0800 (PST) Date: Mon, 15 Dec 2025 11:55:57 +0300 From: Dan Carpenter To: oe-kbuild@lists.linux.dev, Charles Keepax Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Vinod Koul , Pierre-Louis Bossart Subject: drivers/soundwire/bus_type.c:108 sdw_drv_probe() error: Calling ida_alloc_max() with a 'max' argument which is a power of 2. -1 missing? Message-ID: <202512131339.LMMvaF5G-lkp@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@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/torvalds/linux.git master head: 9551a26f17d9445eed497bd7c639d48dfc3c0af4 commit: aab12022b076f0b385b7a9a78e1161bd2df5d1e3 soundwire: bus: Add internal slave ID and use for IRQs date: 7 months ago config: i386-randconfig-r073-20251212 (https://download.01.org/0day-ci/archive/20251213/202512131339.LMMvaF5G-lkp@intel.com/config) compiler: gcc-14 (Debian 14.2.0-19) 14.2.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/202512131339.LMMvaF5G-lkp@intel.com/ smatch warnings: drivers/soundwire/bus_type.c:108 sdw_drv_probe() error: Calling ida_alloc_max() with a 'max' argument which is a power of 2. -1 missing? vim +/max +108 drivers/soundwire/bus_type.c 9251345dca24b6 Vinod Koul 2017-12-14 81 static int sdw_drv_probe(struct device *dev) 9251345dca24b6 Vinod Koul 2017-12-14 82 { 9251345dca24b6 Vinod Koul 2017-12-14 83 struct sdw_slave *slave = dev_to_sdw_dev(dev); 9251345dca24b6 Vinod Koul 2017-12-14 84 struct sdw_driver *drv = drv_to_sdw_driver(dev->driver); 9251345dca24b6 Vinod Koul 2017-12-14 85 const struct sdw_device_id *id; 9251345dca24b6 Vinod Koul 2017-12-14 86 int ret; 9251345dca24b6 Vinod Koul 2017-12-14 87 fcb9d730be1d30 Srinivas Kandagatla 2020-09-24 88 /* fcb9d730be1d30 Srinivas Kandagatla 2020-09-24 89 * fw description is mandatory to bind fcb9d730be1d30 Srinivas Kandagatla 2020-09-24 90 */ fcb9d730be1d30 Srinivas Kandagatla 2020-09-24 91 if (!dev->fwnode) fcb9d730be1d30 Srinivas Kandagatla 2020-09-24 92 return -ENODEV; fcb9d730be1d30 Srinivas Kandagatla 2020-09-24 93 fcb9d730be1d30 Srinivas Kandagatla 2020-09-24 94 if (!IS_ENABLED(CONFIG_ACPI) && !dev->of_node) fcb9d730be1d30 Srinivas Kandagatla 2020-09-24 95 return -ENODEV; fcb9d730be1d30 Srinivas Kandagatla 2020-09-24 96 9251345dca24b6 Vinod Koul 2017-12-14 97 id = sdw_get_device_id(slave, drv); 9251345dca24b6 Vinod Koul 2017-12-14 98 if (!id) 9251345dca24b6 Vinod Koul 2017-12-14 99 return -ENODEV; 9251345dca24b6 Vinod Koul 2017-12-14 100 9251345dca24b6 Vinod Koul 2017-12-14 101 /* 9251345dca24b6 Vinod Koul 2017-12-14 102 * attach to power domain but don't turn on (last arg) 9251345dca24b6 Vinod Koul 2017-12-14 103 */ 9251345dca24b6 Vinod Koul 2017-12-14 104 ret = dev_pm_domain_attach(dev, false); 29ffcc88f2065f Ulf Hansson 2018-04-26 105 if (ret) 29ffcc88f2065f Ulf Hansson 2018-04-26 106 return ret; 29ffcc88f2065f Ulf Hansson 2018-04-26 107 aab12022b076f0 Charles Keepax 2025-04-29 @108 ret = ida_alloc_max(&slave->bus->slave_ida, SDW_FW_MAX_DEVICES, GFP_KERNEL); The SDW_FW_MAX_DEVICES macro is used here and also in sdw_irq_create(). bus->domain = irq_domain_create_linear(fwnode, SDW_FW_MAX_DEVICES, ... The ida_alloc_max() function an inclusive max so probably this should be "SDW_FW_MAX_DEVICES - 1". aab12022b076f0 Charles Keepax 2025-04-29 109 if (ret < 0) { aab12022b076f0 Charles Keepax 2025-04-29 110 dev_err(dev, "Failed to allocated ID: %d\n", ret); aab12022b076f0 Charles Keepax 2025-04-29 111 return ret; aab12022b076f0 Charles Keepax 2025-04-29 112 } aab12022b076f0 Charles Keepax 2025-04-29 113 slave->index = ret; aab12022b076f0 Charles Keepax 2025-04-29 114 9251345dca24b6 Vinod Koul 2017-12-14 115 ret = drv->probe(slave, id); 9251345dca24b6 Vinod Koul 2017-12-14 116 if (ret) { 9251345dca24b6 Vinod Koul 2017-12-14 117 dev_pm_domain_detach(dev, false); aab12022b076f0 Charles Keepax 2025-04-29 118 ida_free(&slave->bus->slave_ida, slave->index); -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki