Received: by 2002:a05:6512:2355:0:0:0:0 with SMTP id p21csp5525000lfu; Mon, 28 Mar 2022 15:59:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6osXKUuK7H55o8XHOlyLUwnodpjbJkT6JZVyXZIGGbTL8j9IofZUlGtvsPDqiCg1Pi7D6 X-Received: by 2002:a05:6870:5251:b0:de:da92:b5a4 with SMTP id o17-20020a056870525100b000deda92b5a4mr670530oai.171.1648508353021; Mon, 28 Mar 2022 15:59:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648508353; cv=none; d=google.com; s=arc-20160816; b=K92lnvQ8j/f15kY8Wr4ovv2Yehxp5fsAZJyuyn9PfgIiYRLJPmOnT7Fxko6kIlPBXK QhbrUMCoEHy9GpQUDOOvFF7pFafYzBn+CmGrR98dPnLeEvlM5OVzMbX788b0+g6cyRBF 0uMuPuu/F86wl5SaTQf1NXtRxFC3EfYhnowicyaB1x7mc5qKQ9/fUbGlAN9qaapOFKAl uIFG3hIGRkyLak5cfMhgTm6sdJFFeGlBvluPxaukwQUo7QPXCDEyU3InjlOy/2juqHtL +1E+yB8kiwTorNOg6gfeVzuH72dbRcw3SKUcnwDPVjgQ+cp7vRJ4GJn3TvFdVG4ySv6G I+Og== 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 :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=CMagTo2vvwQJE6pPioNyK2E0SM6MeVDpPi6N5+X0TCU=; b=EwMRKNvDPQi1EagjwL8TfMf5sNNxoILigu1gx2Lwi9ZW4hAB+5zZd/zqXmWCEuNuHs 05u/I2FcPENRRsbYITkliHwSiNkHE7jYF3S9inW5OQjPPI42Xicsc9Aslol+tud76czB LHUie3lVP3Dr3ScszfQHxO2qrCpAPeZ5J+n6s5mDTfmt9YHh/hEHW2fD30s1DX0x5XwU pp5ntQyY3QUp4Fupg1psrSvBZhB0Rj79cVuyXTuvKBTwrynQIxR1jXXXUnwC6f7BjDiX nmQzjGySKYcyzBfhWAeORjbjjsFCf75NolNH3IQn8eFbPRViRsbZO7OsWFGNWPQfbiyt boKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=QlkVJ9TT; 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 k10-20020a05687015ca00b000de035be321si10931291oad.236.2022.03.28.15.59.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 15:59:13 -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=QlkVJ9TT; 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 9B8DA275C8D; Mon, 28 Mar 2022 14:58:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242783AbiC1Up4 (ORCPT + 99 others); Mon, 28 Mar 2022 16:45:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345680AbiC1Un1 (ORCPT ); Mon, 28 Mar 2022 16:43:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E76C67D3C; Mon, 28 Mar 2022 13:41:46 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 5DE0F614E2; Mon, 28 Mar 2022 20:41:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC2B5C341D8; Mon, 28 Mar 2022 20:41:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648500103; bh=Mq/3q2HPn+lLhZOCSw6V5fK6FkDgJ6aTbZK5JZLvons=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QlkVJ9TTb7ibxxkWfR5u0Bk1y3V8E1KXwHnFn+OyB4DHxn7J12kUwAMaLTFyBwsUM evLjrFaet6OSW4fq1wtwdALOTeYhN9rhzagGar/6SRCNxNNew0AIzdmB0pj1+2XWDR ZeYGmZHpeUSQDB+0Pf4FQHUbGgJqkIw3OrAn1Ez/6mfA8dL/w7x1e5KdHXPQwSeb9u AhYrRljb6nP04TJsP0/UsHPC2qSfJDXf+D9TVzFESVaFYk/WAl1hiyq3Jerzq8kWmG 415fp4kFBceJVi+lyFvvoQnbrJ61X6ITnwzMeC5KW9IAb+ljqkxYacegpfg44M7z2G GAcp4ednTd4EA== Received: from mchehab by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1nYwBI-000lc8-37; Mon, 28 Mar 2022 22:41:40 +0200 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 05/26] media: dvb-usb: a800: use an enum for the device number Date: Mon, 28 Mar 2022 22:41:17 +0200 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 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 The device number is currently a value that needs to be the same on two separate tables, but the code doesn't actually enforce it, leading to errors as boards get added or removed. Fix it by using an enum. Signed-off-by: Mauro Carvalho Chehab --- To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover. See [PATCH 00/26] at: https://lore.kernel.org/all/cover.1648499509.git.mchehab@kernel.org/ drivers/media/usb/dvb-usb/a800.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/media/usb/dvb-usb/a800.c b/drivers/media/usb/dvb-usb/a800.c index 36b5b6227412..5f294784923c 100644 --- a/drivers/media/usb/dvb-usb/a800.c +++ b/drivers/media/usb/dvb-usb/a800.c @@ -72,11 +72,17 @@ static int a800_probe(struct usb_interface *intf, } /* do not change the order of the ID table */ -static struct usb_device_id a800_table [] = { -/* 00 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_DVBT_USB2_COLD) }, -/* 01 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_DVBT_USB2_WARM) }, - { } /* Terminating entry */ +enum { + AVERMEDIA_DVBT_USB2_COLD, + AVERMEDIA_DVBT_USB2_WARM, }; + +static struct usb_device_id a800_table[] = { + DVB_USB_DEV(AVERMEDIA, AVERMEDIA_DVBT_USB2_COLD), + DVB_USB_DEV(AVERMEDIA, AVERMEDIA_DVBT_USB2_WARM), + { } +}; + MODULE_DEVICE_TABLE (usb, a800_table); static struct dvb_usb_device_properties a800_properties = { @@ -132,8 +138,8 @@ static struct dvb_usb_device_properties a800_properties = { .num_device_descs = 1, .devices = { { "AVerMedia AverTV DVB-T USB 2.0 (A800)", - { &a800_table[0], NULL }, - { &a800_table[1], NULL }, + { &a800_table[AVERMEDIA_DVBT_USB2_COLD], NULL }, + { &a800_table[AVERMEDIA_DVBT_USB2_WARM], NULL }, }, } }; -- 2.35.1