From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.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 0A4DA3C3428; Tue, 5 May 2026 07:04:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777964671; cv=none; b=KhUUHgBKDJeH3ztu69GgX3zWQQo8p9jfo2CuRR7ofu0ofo8njXmWwpvW9HqAEK0CZhDGpLibZgEniYtm6KUeFNttXNrVm3fSyqgw/G7opOmuBsSxpqKaUNYj5Xjb6jdF9miZ+4vazxxwhyicHfy02ieWlhImw8i0YbPdcXBUYvY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777964671; c=relaxed/simple; bh=RCueiAZeqWKSTn8xZ3SqLVQKJmm8J6WbOJ4p76ZcMRo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aFLbZsDdWF6UvXDse7dxdS8XOvF16cXczT+2hgtiKR19P5qBMVTFXEBj91h41YNAuJ+N0DDp+XP0FKTgT12XGMZR8uLZj6+3bJY4+s6RCcfOli8DqDFm00uHMujHhT9TuGLnjOmrsIGVHpuz1SlwpGSV3qRDuoje8oJPFwvMbCU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=FWLjfNP5; arc=none smtp.client-ip=192.198.163.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="FWLjfNP5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1777964670; x=1809500670; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=RCueiAZeqWKSTn8xZ3SqLVQKJmm8J6WbOJ4p76ZcMRo=; b=FWLjfNP5KDQFO26W4U3GStCPbCV7mavGK1QKOg6PVFlFDzUkgWNu7z7h Tc2o8oiznFVGnV5dqXgEOad25xyCGnRDiywdLRH20IioHjsdD7BeXOD+U 5qg9YZqrkSaXKR0hcrNTpBSlOQ1SIaWpSmdZOg2H67q43+vmQkHus37jt AXoLaj8VYw85xvGcENC2A92WbOrC+XCheecyr9oZ5UC4gWZyMTL8MYoZS GnckqdwDQR2ThDB1ZAPEkiRWIJzrBM5gHw6B62xNw4b+WXuxhfMGLSx8b 3gPMgHW7MnqIbH4P7tVTNpq8NUzFgRG2IrYrE8H3UcmeABse78lLSO9K6 g==; X-CSE-ConnectionGUID: gMTHnlQ1Sqy8UdbnBF0KrQ== X-CSE-MsgGUID: WJ46jm35QXiLqTZKah0OYg== X-IronPort-AV: E=McAfee;i="6800,10657,11776"; a="90201713" X-IronPort-AV: E=Sophos;i="6.23,217,1770624000"; d="scan'208";a="90201713" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2026 00:04:29 -0700 X-CSE-ConnectionGUID: FaF1Rt61RtShHMnDF5iqhw== X-CSE-MsgGUID: p7ipcwe1QHyF2uFu8M1fIQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,217,1770624000"; d="scan'208";a="240725300" Received: from vpanait-mobl.ger.corp.intel.com (HELO localhost) ([10.245.244.5]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2026 00:04:26 -0700 Date: Tue, 5 May 2026 10:04:24 +0300 From: Andy Shevchenko To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig_=28The_Capable_Hub=29?= Cc: Vinod Koul , Markus Schneider-Pargmann , Basavaraj Natikar , Frank Li , Manivannan Sadhasivam , Viresh Kumar , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] dmaengine: Consistently define pci_device_ids using named initializers Message-ID: References: <20260504102008.1996139-2-u.kleine-koenig@baylibre.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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Tue, May 05, 2026 at 10:01:35AM +0300, Andy Shevchenko wrote: > On Mon, May 04, 2026 at 06:38:51PM +0200, Uwe Kleine-König (The Capable Hub) wrote: > > On Mon, May 04, 2026 at 05:09:55PM +0300, Andy Shevchenko wrote: > > > On Mon, May 04, 2026 at 03:55:00PM +0200, Uwe Kleine-König (The Capable Hub) wrote: > > > > On Mon, May 04, 2026 at 01:29:12PM +0300, Andy Shevchenko wrote: > > > > > On Mon, May 04, 2026 at 12:20:06PM +0200, Uwe Kleine-König (The Capable Hub) wrote: ... > > > > > > static const struct pci_device_id pch_dma_id_table[] = { > > > > > > - { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_EG20T_PCH_DMA_8CH), 8 }, > > > > > > - { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_EG20T_PCH_DMA_4CH), 4 }, > > > > > > - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA1_8CH), 8}, /* UART Video */ > > > > > > - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA2_8CH), 8}, /* PCMIF SPI */ > > > > > > - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA3_4CH), 4}, /* FPGA */ > > > > > > - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA4_12CH), 12}, /* I2S */ > > > > > > - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA1_4CH), 4}, /* UART */ > > > > > > - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA2_4CH), 4}, /* Video SPI */ > > > > > > - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA3_4CH), 4}, /* Security */ > > > > > > - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA4_4CH), 4}, /* FPGA */ > > > > > > - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7831_DMA1_8CH), 8}, /* UART */ > > > > > > - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7831_DMA2_4CH), 4}, /* SPI */ > > > > > > - { 0, }, > > > > > > + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_EG20T_PCH_DMA_8CH), .driver_data = 8 }, > > > > > > + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_EG20T_PCH_DMA_4CH), .driver_data = 4 }, > > > > > > + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA1_8CH), .driver_data = 8 }, /* UART Video */ > > > > > > + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA2_8CH), .driver_data = 8 }, /* PCMIF SPI */ > > > > > > + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA3_4CH), .driver_data = 4 }, /* FPGA */ > > > > > > + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA4_12CH), .driver_data = 12 }, /* I2S */ > > > > > > + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA1_4CH), .driver_data = 4 }, /* UART */ > > > > > > + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA2_4CH), .driver_data = 4 }, /* Video SPI */ > > > > > > + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA3_4CH), .driver_data = 4 }, /* Security */ > > > > > > + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA4_4CH), .driver_data = 4 }, /* FPGA */ > > > > > > + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7831_DMA1_8CH), .driver_data = 8 }, /* UART */ > > > > > > + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7831_DMA2_4CH), .driver_data = 4 }, /* SPI */ > > > > > > + { }, > > > > > > }; > > > > > > > > > > Use PCI_DEVICE_DATA() instead. Same may apply to DesignWare, but one needs to > > > > > define the device IDs. I think I may help with that. > > > > > > > > I'm not a fan of PCI_DEVICE_DATA. While it could indeed be used to > > > > shorten the assignments here, it's less readable in my opinion. > > > > > > I'm not fun of these long unreadable lines with tons of repetitions :-) > > > > Seems to be subjective. > > > > > > Compare > > > > > > > > { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_EG20T_PCH_DMA_4CH), .driver_data = 4 }, > > > > > > > > with > > > > > > > > { PCI_DEVICE_DATA(INTEL, PCI_DEVICE_ID_EG20T_PCH_DMA_4CH, 4) }, > > > > > > First of all, with > > > > > > { PCI_DEVICE_DATA(INTEL, EG20T_PCH_DMA_4CH, 4) }, > > > > Agreed. That doesn't considerably weaken my reasoning however. > > > > > > . For someone who doesn't know what PCI_DEVICE_DATA does, the latter is > > > > less understandable. > > > > > > Same applicable to many other macros. I don't consider this argument viable. > > > > Also agreed. But other bad macros don't justify using that (admittedly > > subjectively) bad PCI_DEVICE_DATA macro that mixes device identity > > (.vendor, .device, .subvendor and .subdevice) with a driver specific > > struct member. > > > > > > Also PCI_DEVICE_DATA has a cast which is something I want to get rid of. > > > > > > Yes, and you will get rid of in one place instead of tons of them. > > > > This would require another (subjectively bad) macro PCI_DEVICE_DATAPTR. > > I think I let someone else tackle that quest. > > No, it wouldn't. Since we support C11, we have _Generic(). It may be used. The example you probably want to look at is d7cdbbc93c56 ("software node: allow referencing firmware nodes") (yes, it's not a union there, but I think we can manage unions as well). > And please use PCI_DEVICE_DATA() in this driver. -- With Best Regards, Andy Shevchenko