Received: by 2002:a05:6512:2355:0:0:0:0 with SMTP id p21csp5528537lfu; Mon, 28 Mar 2022 16:02:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrCEh8qHSgvQ3Y33wev/AyZfJ2T8wCoaODATIqP5lYNS8x3ofVGfIN9GF0C0MYT4h7IELk X-Received: by 2002:a63:7c0d:0:b0:386:5aa9:db93 with SMTP id x13-20020a637c0d000000b003865aa9db93mr11766950pgc.412.1648508570277; Mon, 28 Mar 2022 16:02:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648508570; cv=none; d=google.com; s=arc-20160816; b=XJissouvkwxHZKY49QgkCTjMx31n/XATZhX+6cyFs2zBfa59Tj5at4LVM+U7D5BH8I 6+UlIYQWT/bTW9Cs07z2eQjNXMByzbVAl8Z/kCA/Ioe6rEfzncC3HWm7MbFdxapCTWZ4 rMxO1aY3W4j8hVhJ+d5twYihAu6GHIlqmrkFA147RhmVh73g2aSWvhRPv6t+p1hgod1l QdCecgwg18mI6iDGxcWMffq2zX7SorlWAHSRzFC1fSL58s2kxBb24VVcAIm3pmx2iINd 4msGe9bp6fsKs2cEM6disavgKpE9uZyLLI9jYDJ9/WxuP58vkK30pInvLbPMvyhUwwqo sdHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=AUh4uI8pvxqJJN/3QwEXJpiD9mp95Tqlqb6OfS1ClyM=; b=ftWUGNt+UtaSowV6BKgkwhQRP0lBbIKWjodQRFgoMWNtzegxpbn3zBlEmW0Ood2IEg qpNczgEn0t7AdbVB2WvHbso86WwwcyUCFfU/D8m3y8u8szDwG6F18MNyGwa9W5n688kJ HuAX504yWYAgVKR1grEm/K6QMZ0wMRJ/p3V1PNH2bFBS6yUjA6PnT/H/lTLisK5kbTVr h10Nq3ZhZOibiqeyHu7gYqv5SkPEco6iFmnTM5v5iD61Vveg9ny6uL823Op7573GYFrN VCjTYfWppzpDRjOVApAMVsm8htP2ClGQKYQJI+3YnkYFNClCDgeYwt4PUb5vjfjWTqxI ff1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=GovG5HsD; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u8-20020a655c08000000b0038609ba1522si12976436pgr.122.2022.03.28.16.02.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 16:02:50 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=GovG5HsD; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 12CB81557F9; Mon, 28 Mar 2022 15:08:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345483AbiC1UqZ (ORCPT + 99 others); Mon, 28 Mar 2022 16:46:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345672AbiC1Un1 (ORCPT ); Mon, 28 Mar 2022 16:43:27 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91BC3674C4; Mon, 28 Mar 2022 13:41:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1B6AEB81212; Mon, 28 Mar 2022 20:41:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99DCFC3410F; Mon, 28 Mar 2022 20:41:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648500102; bh=bhjIYrP1LIUYHqVqwO9fRvylmwAunjFXsaJ23BiEGqA=; h=From:To:Cc:Subject:Date:From; b=GovG5HsDQ4D8az97d54Km7h5AMXTWG1jPG8BBqU4m7W8PKWIWQDaFv3KNilsJFu+w r6PT4f0ZHz1KMOwLZYHLXCFTezk981XP/jP4tpRP+lNSDedzrdVkNFWF8sLfFeCpWz yGcm+G7UnX4/Mmh+FSqycxBuc3HpVPO3S/UK5QX2SzH7oA2m52dJLAsOveXgJFFRpZ o0JOnOh1U2XjKNBI2HXO9ym/tr16EBpSnRA0fG8lcj1UUL8xDssF30NWcymiaYmmf6 t5rVUtXDpXdXSuzVNXzg/y+o0v7oYn1fS0UqHd3wwlx70A7y41aa54lyro8r09G4Ji ognzsVS/3DS4A== Received: from mchehab by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1nYwBH-000lbp-SV; Mon, 28 Mar 2022 22:41:39 +0200 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Michael Krufky , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 00/26] dvb-usb: use designated initializers Date: Mon, 28 Mar 2022 22:41:12 +0200 Message-Id: X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are two DVB USB cores on media. The new one (dvb-usb-v2) solves several problems with the previous one, but, unfortunately, there are several drivers that weren't migrated yet. One of the problems with dvb-usb is that, besides the common DVB USB table, it also uses a per-device table which require links to the USB ID table. This is done, on most drivers, using a magic number, which is easy to get outdated. Rewrite the drivers in order to use an enum and use designated initializers where needed. This patch series was inspired on this patch: https://patchwork.kernel.org/project/linux-media/patch/20220326165909.506926-16-benni@stuerz.xyz/ While it would be nice to also change the tables to be const, this is currently not possible, as a couple drivers that depend on the dvb-usb struct depend on it to not be const. Writing a patch series like that and making it properly referencing the right entries is not fun. That's most drivers were never fixed. So, I ended using a script to change it, adding several checks on it, in order to avoid the risk of problems. Even so, I needed to manually adjust some patches. This is the used script: Mauro Carvalho Chehab (26): media: dvb-usb-ids.h: sort entries media: dvb-usb: move USB IDs to dvb-usb-ids.h media: dvb-usb: vp702x: reference to usb ID table media: dvb-usb: Add helper macros for using USB VID/PID media: dvb-usb: a800: use an enum for the device number media: af9005: use the newer dvb-usb macros for USB device media: dvb-usb: az6027: use an enum for the device number media: cinergyT2-core: use the newer dvb-usb macros for USB device media: cxusb: use the newer dvb-usb macros for USB device media: digitv: use the newer dvb-usb macros for USB device media: dvb-usb: dtt200u: use an enum for the device number media: dtv5100: use the newer dvb-usb macros for USB device media: dw2102: use the newer dvb-usb macros for USB device media: dvb-usb: gp8psk: use an enum for the device number media: dvb-usb: m920x: use an enum for the device number media: dvb-usb: nova-t-usb2: use an enum for the device number media: dvb-usb: opera1: use an enum for the device number media: dvb-usb: pctv452e: use an enum for the device number media: technisat-usb2: use the newer dvb-usb macros for USB device media: dvb-usb: ttusb2: use an enum for the device number media: dvb-usb: umt-010: use an enum for the device number media: dvb-usb: vp702x: use an enum for the device number media: dvb-usb: vp7045: use an enum for the device number media: dvb-usb: dibusb-mb: use an enum for the device number media: dvb-usb: dibusb-mc: use an enum for the device number media: dvb-usb: dib0700_devices: use an enum for the device number drivers/media/usb/dvb-usb/a800.c | 18 +- drivers/media/usb/dvb-usb/af9005.c | 19 +- drivers/media/usb/dvb-usb/az6027.c | 45 +- drivers/media/usb/dvb-usb/cinergyT2-core.c | 10 +- drivers/media/usb/dvb-usb/cxusb.c | 88 +-- drivers/media/usb/dvb-usb/dib0700_devices.c | 428 +++++++------ drivers/media/usb/dvb-usb/dibusb-mb.c | 165 ++--- drivers/media/usb/dvb-usb/dibusb-mc.c | 88 +-- drivers/media/usb/dvb-usb/digitv.c | 13 +- drivers/media/usb/dvb-usb/dtt200u.c | 56 +- drivers/media/usb/dvb-usb/dtv5100.c | 11 +- drivers/media/usb/dvb-usb/dw2102.c | 84 ++- drivers/media/usb/dvb-usb/gp8psk.c | 36 +- drivers/media/usb/dvb-usb/m920x.c | 51 +- drivers/media/usb/dvb-usb/nova-t-usb2.c | 18 +- drivers/media/usb/dvb-usb/opera1.c | 15 +- drivers/media/usb/dvb-usb/pctv452e.c | 22 +- drivers/media/usb/dvb-usb/technisat-usb2.c | 11 +- drivers/media/usb/dvb-usb/ttusb2.c | 36 +- drivers/media/usb/dvb-usb/umt-010.c | 18 +- drivers/media/usb/dvb-usb/vp702x.c | 23 +- drivers/media/usb/dvb-usb/vp7045.c | 28 +- include/media/dvb-usb-ids.h | 632 +++++++++++--------- 23 files changed, 1071 insertions(+), 844 deletions(-) -- 2.35.1