From patchwork Mon Dec 2 15:47:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13890964 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CAB67D78332 for ; Mon, 2 Dec 2024 15:52:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RkEW/0Y6zT4/Atf/d+puMl0WcNDtT8U8UDsIe65uvgE=; b=GaB71jhEvGJ6p77znjww8dmF1n +oORKsGFpRhH1iL8FtY4d0Jddq4bsN44XzqhWYTMVb73ecYuVX/749FVorNzC1IsIoU56uajHbj4X zppuMc1bjIicEWVV69pzXIJ7sqrkDm0WN5UH/HrnaW2JHJ+MgmURJSSGfg2jUYf9dpaIRHhfLIbPc Q2dvH14QGoILULwWtCQIYLPukWiRxiEic36t2Dtykx2wjf/iwgHws37gAfyz6ueN7ZO/lQkxZW/uc 2pyzMv5QyHhj5c1jPuitHSfnarYC3iokWX1lxXaTGpyVvtyS2eMU1LcCyX85D9p9VGmsORdej3F4v qPsRUNqw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tI8iN-00000006jNy-1Uqv; Mon, 02 Dec 2024 15:51:59 +0000 Received: from mail-ua1-x932.google.com ([2607:f8b0:4864:20::932]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tI8du-00000006iJS-3Iki for linux-arm-kernel@lists.infradead.org; Mon, 02 Dec 2024 15:47:23 +0000 Received: by mail-ua1-x932.google.com with SMTP id a1e0cc1a2514c-85bc9b60bc8so678176241.0 for ; Mon, 02 Dec 2024 07:47:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733154441; x=1733759241; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=RkEW/0Y6zT4/Atf/d+puMl0WcNDtT8U8UDsIe65uvgE=; b=FDRJubqaJtiS8vV27eNmwvZaeFLSAADr3R6RC2Yntf/BLrSAZU/SNvESescSS7K1pZ wKBQ+Ebaoyizm6NjIyuzATTZVM/r4Rmux6fW1Z9Cf0pnLpgL2wtHr3xL4pjuaYd2999E jXKt3ihKnfCZTX9uwNJ3uQu2SHvFBB8fc0xDk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733154441; x=1733759241; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RkEW/0Y6zT4/Atf/d+puMl0WcNDtT8U8UDsIe65uvgE=; b=eGk8caxPrEwSR3F1FoDeaWZ4bTg9TNxvlSsu3USOXLkK6f9WhuT9bNT1kH6guVUKm+ WotxlUHqsNfnaGhKdkvrHHzOTnnWSWh5XKBLxn6QTdfBJKK77unIguwh5uPJnWb4bw5M 85d9yiDhWq37ZMaXAf9Fu1GpzyTdAN0TKKMIzicIi2fb6a5gRQne1pwP7C7err2ch9ut DlGy551uaibymbzktEwtfXBFJoe3woMD8nawpTFYVWpTe1qnaFJqgodmVgnkW9SU5sdD NEwIOrWHc03iHXj+8gTOxoCAKVG2ikx/MhuBGDdSS4z5J66aA1HH9aDHQ7p64228J3oR 3Y8w== X-Forwarded-Encrypted: i=1; AJvYcCVlXScJ3Zzl8+rRpyjuvAtBqpfb8rIFxL7rziQozfAb5BFUxBp6vl4d8qkHZxryZ1D11vwUP31GQ0efeG+9m2SZ@lists.infradead.org X-Gm-Message-State: AOJu0YzAr+Lv9IU6htTqG0IyDkNuLpNNHoUBzD+ib3r46a9S3O/ODv6/ 6QTwCqvQhUMJZSrStjlym07UoOwxYly7NLY285qRBfwWAdwCp2r2SCIOuJgp3w== X-Gm-Gg: ASbGnctx9AflT9Ae5XiP5unTqZi/71tSfbB3p3byYsCkXY4e42GQokprDCCZCjvlvlG Mk6TU5HeCCUq3SV57Kga6e3z/QALVKlCPqU2tgvxOzql/KG0JV3uNdzjaYc2mRbb/Aiqdq5KuRJ y8HIEdZUL6wynYpiC/ClpXyDvw3jAUKenXuL4TEu5AK7KJy2SyMsX9QsDzt8FI4y29ychqa2W9j HvSXC1XCGWtTe26959P3u4T9MkY+w+IRCbSOU6oh2QzELPwM18hTDgPy8UJvLA9P0ziC2/oM2Ec M/0tXEvIWhHynC0dNnFl71Em X-Google-Smtp-Source: AGHT+IGBHPCXG9TwBD4LE/oxUh/BqCKafbDdQlV9UV4NbH/ohrUS+/WPS+6wYQbT3toO5YK2KCH6Sw== X-Received: by 2002:a05:6122:500e:10b0:515:20e6:7861 with SMTP id 71dfb90a1353d-5156a8069d4mr18897232e0c.2.1733154441340; Mon, 02 Dec 2024 07:47:21 -0800 (PST) Received: from denia.c.googlers.com (5.236.236.35.bc.googleusercontent.com. [35.236.236.5]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-5156d0f8ad6sm1159729e0c.49.2024.12.02.07.47.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2024 07:47:20 -0800 (PST) From: Ricardo Ribalda Date: Mon, 02 Dec 2024 15:47:15 +0000 Subject: [PATCH 1/3] media: cx231xx: Convert enum into a define MIME-Version: 1.0 Message-Id: <20241202-fix-llvm9-v1-1-2a50f5acfd0b@chromium.org> References: <20241202-fix-llvm9-v1-0-2a50f5acfd0b@chromium.org> In-Reply-To: <20241202-fix-llvm9-v1-0-2a50f5acfd0b@chromium.org> To: Mauro Carvalho Chehab , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Hans de Goede , Sakari Ailus , Andy Shevchenko , Greg Kroah-Hartman , Tiffany Lin , Andrew-CT Chen , Yunfei Dong , Matthias Brugger , AngeloGioacchino Del Regno Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Ricardo Ribalda X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241202_074722_828848_53A704C7 X-CRM114-Status: GOOD ( 12.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The code is running arithmentics with the enum, which when not done with care makes the compiler a bit nervous. Because those enums are only used as defines (no argument or variable from that enumeration type), convert it into a define and move on. It is required to build with llvm 9 without these warnings: drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c:673:17: warning: bitwise operation between different enumeration types ('enum TS_PORT' and 'enum POWE_TYPE') [-Wenum-enum-conversion] drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c:680:21: warning: bitwise operation between different enumeration types ('enum AVDEC_STATUS' and 'enum POWE_TYPE') [-Wenum-enum-conversion] drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c:687:21: warning: bitwise operation between different enumeration types ('enum AVDEC_STATUS' and 'enum POWE_TYPE') [-Wenum-enum-conversion] drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c:702:17: warning: bitwise operation between different enumeration types ('enum TS_PORT' and 'enum POWE_TYPE') [-Wenum-enum-conversion] drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c:709:21: warning: bitwise operation between different enumeration types ('enum TS_PORT' and 'enum POWE_TYPE') [-Wenum-enum-conversion] drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c:718:21: warning: bitwise operation between different enumeration types ('enum AVDEC_STATUS' and 'enum POWE_TYPE') [-Wenum-enum-conversion] drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c:727:21: warning: bitwise operation between different enumeration types ('enum AVDEC_STATUS' and 'enum TS_PORT') [-Wenum-enum-conversion] drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c:737:21: warning: bitwise operation between different enumeration types ('enum AVDEC_STATUS' and 'enum TS_PORT') [-Wenum-enum-conversion] drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c:749:21: warning: bitwise operation between different enumeration types ('enum AVDEC_STATUS' and 'enum TS_PORT') [-Wenum-enum-conversion] Signed-off-by: Ricardo Ribalda --- drivers/media/usb/cx231xx/cx231xx-pcb-cfg.h | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/media/usb/cx231xx/cx231xx-pcb-cfg.h b/drivers/media/usb/cx231xx/cx231xx-pcb-cfg.h index 5bc44f194d0a..62ffa16bb82c 100644 --- a/drivers/media/usb/cx231xx/cx231xx-pcb-cfg.h +++ b/drivers/media/usb/cx231xx/cx231xx-pcb-cfg.h @@ -57,19 +57,17 @@ enum USB_SPEED{ }; #define TS_MASK 0x6 -enum TS_PORT{ - NO_TS_PORT = 0x0, /* 2'b00: Neither port used. PCB not a Hybrid, +#define NO_TS_PORT 0x0 /* 2'b00: Neither port used. PCB not a Hybrid, only offers Analog TV or Video */ - TS1_PORT = 0x4, /* 2'b10: TS1 Input (Hybrid mode : +#define TS1_PORT 0x4 /* 2'b10: TS1 Input (Hybrid mode : Digital or External Analog/Compressed source) */ - TS1_TS2_PORT = 0x6, /* 2'b11: TS1 & TS2 Inputs +#define TS1_TS2_PORT 0x6 /* 2'b11: TS1 & TS2 Inputs (Dual inputs from Digital and/or External Analog/Compressed sources) */ - TS1_EXT_CLOCK = 0x6, /* 2'b11: TS1 & TS2 as selector +#define TS1_EXT_CLOCK 0x6 /* 2'b11: TS1 & TS2 as selector to external clock */ - TS1VIP_TS2_PORT = 0x2 /* 2'b01: TS1 used as 656/VIP Output, +#define TS1VIP_TS2_PORT 0x2 /* 2'b01: TS1 used as 656/VIP Output, TS2 Input (from Compressor) */ -}; #define EAVP_MASK 0x8 enum EAV_PRESENT{ @@ -89,10 +87,8 @@ enum AT_MODE{ }; #define PWR_SEL_MASK 0x40 -enum POWE_TYPE{ - SELF_POWER = 0x0, /* 0: self power */ - BUS_POWER = 0x40 /* 1: bus power */ -}; +#define SELF_POWER 0x0 /* 0: self power */ +#define BUS_POWER 0x40 /* 1: bus power */ enum USB_POWE_TYPE{ USB_SELF_POWER = 0,