Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp5625688pxb; Mon, 28 Mar 2022 15:08:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIladU65JNtiryYE5vPk3qpQxp4P24YXnkw8QD8ArRGFPBbgdI4dl2wLww6rYBSUPtuazr X-Received: by 2002:a17:90b:1b4d:b0:1c6:bd9e:a63d with SMTP id nv13-20020a17090b1b4d00b001c6bd9ea63dmr1267386pjb.56.1648505325594; Mon, 28 Mar 2022 15:08:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648505325; cv=none; d=google.com; s=arc-20160816; b=DNenlenn3UfggopYMh2XHyGUMnlT0JAV9oQThmoKVYL6vQaQ+xgJslY+3cNFFUxv3/ GCzZKCgGnVnbQYf7MDKig97sVje1cASbKvmVdccEP4KVvNyhfjOZXd+OFD21rzwvrET5 xnnpOy78P+rEwLQWrHw8ENd5RDVwqvrC3NOoqL5ctKTAx9qr4NAx/yzgjgd8mL2UD+gf o7FML2UEHNqYfUfZdLpDgjWro+qzTFrfRP/m0KfGdMZeb2ZO/gltlVmn+7Urfb3gGajI Vcr+ReN/YzufWN/O4IXgKDVaK9WWT4f1rWAkQtuDI5DrZBjyktUbFycuWJWPxoIxcTag +0/Q== 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=hQ1+NSeaGJOuLTtr/RMYwbJ47XfS3F0c+egPYBsaD0U=; b=fcgm1BUaZUH6qMqo3T+FhRE9grj0eve6iubFhH5JbgvmriKE9p/o2cS1PVqvXIb7Ir n3WALiornbrfigb7PCWk26fgLLjb8zKQTeHdb/iVFL0hFKIbpCjaeJR/jSd6C3qaIGmZ nloYpxQh83F+Y1oEYPWF5Vn7/0RhZv0PaDZeF/L03D2q7VexUbyf8WzAnazBTjmM+gTL dvj18qq/2nWdmjAnDnM+LJkMdb96Cn1MXD7WFbBmdeTfuiDlWRjZMKbCgJWOD86sIhU9 7yBX9Wn4t8GQtR0KlziCiPQAlRH0ggpkcBhvE/UAxG69+yiapO8Ndeuz9GyRDBOcHbaG Y5Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=rtGzrvJs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id v12-20020a17090a00cc00b001bd6b5b192csi711873pjd.22.2022.03.28.15.08.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 15:08:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=rtGzrvJs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (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 985781557C8; Mon, 28 Mar 2022 14:29:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346305AbiC1Usb (ORCPT + 99 others); Mon, 28 Mar 2022 16:48:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345663AbiC1Un0 (ORCPT ); Mon, 28 Mar 2022 16:43:26 -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 4956C66ADF; 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 dfw.source.kernel.org (Postfix) with ESMTPS id D37D8614D7; Mon, 28 Mar 2022 20:41:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 466F0C341CD; 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=ZMqRsVWH7Xix4Ul67rXjIZoC7fsabNACSNqXpoa4wzA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rtGzrvJs1iMpmwB+D4nDRkpYksccEbAcQtw7mnEZFASfZQl5TkYtS98q9TqdXvKMP 54R408zJoCQ9qg/WguoUbTa82GGIRLJb7YFVUe+faI+62qNH1y1UaGCg1eusDeaggF L9i7SvK9QtxjuQn/jv7RHLY95v6G+3NJkPDycADPTZWwq9/hfoMP2jo+jjPARaT2NM nRZ9z1gppNwAIrGr0IjfZoi4W5TxF4ckwQLYoE8ow6WT0ZDkzgvisD7w/XdvorZ9qR OApcb7uaDI4BpTLE4KUnpLYPzrHRlei6VvHq4FisH40qfr2mtkIhrxHArwwCjvMz3Q D6eWw7kIoC/KQ== Received: from mchehab by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1nYwBI-000ldA-V1; 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 21/26] media: dvb-usb: umt-010: use an enum for the device number Date: Mon, 28 Mar 2022 22:41:33 +0200 Message-Id: <5fd3c469faa115856f48037019e607edcb41d458.1648499509.git.mchehab@kernel.org> 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/umt-010.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/media/usb/dvb-usb/umt-010.c b/drivers/media/usb/dvb-usb/umt-010.c index 2181993771ae..464699b0b75b 100644 --- a/drivers/media/usb/dvb-usb/umt-010.c +++ b/drivers/media/usb/dvb-usb/umt-010.c @@ -81,11 +81,17 @@ static int umt_probe(struct usb_interface *intf, } /* do not change the order of the ID table */ -static struct usb_device_id umt_table [] = { -/* 00 */ { USB_DEVICE(USB_VID_HANFTEK, USB_PID_HANFTEK_UMT_010_COLD) }, -/* 01 */ { USB_DEVICE(USB_VID_HANFTEK, USB_PID_HANFTEK_UMT_010_WARM) }, - { } /* Terminating entry */ +enum { + HANFTEK_UMT_010_COLD, + HANFTEK_UMT_010_WARM, }; + +static struct usb_device_id umt_table[] = { + DVB_USB_DEV(HANFTEK, HANFTEK_UMT_010_COLD), + DVB_USB_DEV(HANFTEK, HANFTEK_UMT_010_WARM), + { } +}; + MODULE_DEVICE_TABLE (usb, umt_table); static struct dvb_usb_device_properties umt_properties = { @@ -127,8 +133,8 @@ static struct dvb_usb_device_properties umt_properties = { .num_device_descs = 1, .devices = { { "Hanftek UMT-010 DVB-T USB2.0", - { &umt_table[0], NULL }, - { &umt_table[1], NULL }, + { &umt_table[HANFTEK_UMT_010_COLD], NULL }, + { &umt_table[HANFTEK_UMT_010_WARM], NULL }, }, } }; -- 2.35.1