From: Philip Li <philip.li@intel.com>
To: kernel test robot <lkp@intel.com>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>,
<linux-acpi@vger.kernel.org>, <oe-kbuild-all@lists.linux.dev>,
<linux-media@vger.kernel.org>, <rafael@kernel.org>,
<andriy.shevchenko@linux.intel.com>,
<heikki.krogerus@linux.intel.com>
Subject: Re: [PATCH v4 2/8] ACPI: property: Parse _CRS CSI-2 descriptor
Date: Thu, 9 Feb 2023 10:43:45 +0800 [thread overview]
Message-ID: <Y+Rd4d11fYSJbkSK@rli9-mobl> (raw)
In-Reply-To: <202302090459.kIM95vle-lkp@intel.com>
On Thu, Feb 09, 2023 at 05:04:11AM +0800, kernel test robot wrote:
> Hi Sakari,
>
> I love your patch! Perhaps something to improve:
>
> [auto build test WARNING on rafael-pm/linux-next]
> [also build test WARNING on sailus-media-tree/streams linus/master v6.2-rc7 next-20230208]
> [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#_base_tree_information]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Sakari-Ailus/ACPI-property-Parse-data-node-string-references-in-properties/20230208-233112
> base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
> patch link: https://lore.kernel.org/r/20230208152807.3064242-3-sakari.ailus%40linux.intel.com
> patch subject: [PATCH v4 2/8] ACPI: property: Parse _CRS CSI-2 descriptor
> config: x86_64-rhel-8.3-syz (https://download.01.org/0day-ci/archive/20230209/202302090459.kIM95vle-lkp@intel.com/config)
> compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
> reproduce (this is a W=1 build):
> # https://github.com/intel-lab-lkp/linux/commit/d78f47f2d5051c50bdcea131da1779ec0fc8e266
> git remote add linux-review https://github.com/intel-lab-lkp/linux
> git fetch --no-tags linux-review Sakari-Ailus/ACPI-property-Parse-data-node-string-references-in-properties/20230208-233112
> git checkout d78f47f2d5051c50bdcea131da1779ec0fc8e266
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> make W=1 O=build_dir ARCH=x86_64 olddefconfig
> make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/acpi/
>
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <lkp@intel.com>
> | Link: https://lore.kernel.org/oe-kbuild-all/20230208152807.3064242-3-sakari.ailus@linux.intel.com
Sorry that the link is wrong, it should be
Link: https://lore.kernel.org/oe-kbuild-all/202302090459.kIM95vle-lkp@intel.com/
>
> All warnings (new ones prefixed by >>):
>
> >> drivers/acpi/mipi.c:205:6: warning: no previous prototype for 'acpi_crs_csi2_alloc_fill_swnodes' [-Wmissing-prototypes]
> 205 | void acpi_crs_csi2_alloc_fill_swnodes(size_t ports_count, acpi_handle handle)
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
> vim +/acpi_crs_csi2_alloc_fill_swnodes +205 drivers/acpi/mipi.c
>
> 200
> 201 /*
> 202 * Allocate memory and set up software nodes for an ACPI device with given
> 203 * number of CSI-2 ports.
> 204 */
> > 205 void acpi_crs_csi2_alloc_fill_swnodes(size_t ports_count, acpi_handle handle)
> 206 {
> 207 struct acpi_device_software_nodes *ads;
> 208 struct crs_csi2_swnodes *swnodes;
> 209 size_t alloc_size;
> 210 unsigned int i;
> 211 bool overflow;
> 212 void *end;
> 213
> 214 /*
> 215 * Allocate memory for ports, node pointers (number of nodes +
> 216 * 1 (guardian), nodes (root + number of ports * 2 (for for
> 217 * every port there is an endpoint)).
> 218 */
> 219 overflow = check_mul_overflow(sizeof(*ads->ports) +
> 220 sizeof(*ads->nodes) * 2 +
> 221 sizeof(*ads->nodeptrs) * 2,
> 222 ports_count, &alloc_size);
> 223 overflow = overflow ||
> 224 check_add_overflow(sizeof(*ads) + sizeof(*ads->nodes) +
> 225 sizeof(*ads->nodeptrs) * 2,
> 226 alloc_size, &alloc_size);
> 227 if (overflow) {
> 228 acpi_handle_warn(handle,
> 229 "too many _CRS CSI2 resource handles (%zu)",
> 230 ports_count);
> 231 return;
> 232 }
> 233
> 234 swnodes = kzalloc(sizeof(*swnodes), GFP_KERNEL);
> 235 ads = kzalloc(alloc_size, GFP_KERNEL);
> 236 ads->ports = (void *)(ads + 1);
> 237 ads->nodes = (void *)(ads->ports + ports_count);
> 238 ads->nodeptrs = (void *)(ads->nodes +
> 239 ports_count * 2 + 1);
> 240 end = ads->nodeptrs + ports_count * 2 + 2;
> 241 if (!swnodes || !ads || WARN_ON((void *)ads + alloc_size != end)) {
> 242 kfree(swnodes);
> 243 kfree(ads);
> 244 acpi_handle_debug(handle,
> 245 "cannot allocate for %zu software nodes\n",
> 246 ports_count);
> 247 return;
> 248 }
> 249
> 250 ads->num_ports = ports_count;
> 251 for (i = 0; i < ports_count * 2 + 1; i++)
> 252 ads->nodeptrs[i] = &ads->nodes[i];
> 253 ads->nodeptrs[i] = NULL;
> 254 for (i = 0; i < ports_count; i++)
> 255 ads->ports[i].port_nr = NO_CSI2_PORT;
> 256 swnodes->handle = handle;
> 257 swnodes->ads = ads;
> 258 list_add(&swnodes->list, &crs_csi2_swnodes);
> 259 }
> 260
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests
>
next prev parent reply other threads:[~2023-02-09 2:48 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-08 15:27 [PATCH v4 0/8] ACPI _CRS CSI-2 and MIPI DisCo for Imaging support Sakari Ailus
2023-02-08 15:28 ` [PATCH v4 1/8] ACPI: property: Parse data node string references in properties Sakari Ailus
2023-02-08 15:28 ` [PATCH v4 2/8] ACPI: property: Parse _CRS CSI-2 descriptor Sakari Ailus
2023-02-08 16:43 ` Andy Shevchenko
2023-02-08 20:26 ` Sakari Ailus
2023-02-08 20:43 ` kernel test robot
2023-02-08 22:16 ` Sakari Ailus
2023-02-08 21:04 ` kernel test robot
2023-02-09 2:43 ` Philip Li [this message]
2023-02-08 15:28 ` [PATCH v4 3/8] device property: Add SOFTWARE_NODE() macro for defining software nodes Sakari Ailus
2023-02-08 15:28 ` [PATCH v4 4/8] ACPI: property: Generate camera swnodes for ACPI and DisCo for Imaging Sakari Ailus
2023-02-08 16:48 ` Andy Shevchenko
2023-02-08 15:28 ` [PATCH v4 5/8] ACPI: property: Dig "rotation" property for devices with CSI2 _CRS Sakari Ailus
2023-02-08 16:51 ` Andy Shevchenko
2023-02-08 20:56 ` Sakari Ailus
2023-02-08 15:28 ` [PATCH v4 6/8] ACPI: property: Rename parsed MIPI DisCo for Imaging properties Sakari Ailus
2023-02-08 16:56 ` Andy Shevchenko
2023-02-08 21:27 ` Sakari Ailus
2023-02-08 15:28 ` [PATCH v4 7/8] ACPI: property: Skip MIPI property table without "mipi-img" prefix Sakari Ailus
2023-02-08 15:28 ` [PATCH v4 8/8] ACPI: property: Document _CRS CSI-2 and DisCo for Imaging support Sakari Ailus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y+Rd4d11fYSJbkSK@rli9-mobl \
--to=philip.li@intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=rafael@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox