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: 13890956 Received: from mail-ua1-f53.google.com (mail-ua1-f53.google.com [209.85.222.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6073747A5C for ; Mon, 2 Dec 2024 15:47:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733154444; cv=none; b=qxJfz1p0fIa7C69hUD/wle/tlduTENYVDpDXB4+qkmTaQguHACGnwemO6YYixfjsvGL6fJWJlJ7U7GFjTG4g2gptnhAn+rsf8ET3tHcBPrf0EPa7PCPzQgVlud+6EXxp14LkS+BhddE7cAUsXbrfp2gga15Hm6P82rIjNuwVFvg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733154444; c=relaxed/simple; bh=mtiQtlXyI3b6sJIsjA4TwpaNavz3zj9aF+MIz5P2kic=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jYSJ/i9whFZU+JwKKo2n0wyELKAEYeKmotu9mqpjc0V5w5NnE5Hm56duyxpCfMWAaYCRrXsPEH05+jERCtx5WmKhv2q6n0CLckT6lPGUuJwDCO91HV9S/HPGCmywFliMY875risOGNYIM9SaU4XkdK2stWm9d+WwCBkY5PL1RGo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=OEhgyWGc; arc=none smtp.client-ip=209.85.222.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="OEhgyWGc" Received: by mail-ua1-f53.google.com with SMTP id a1e0cc1a2514c-85bc6a1a48cso750533241.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=vger.kernel.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=OEhgyWGcKXzsgFxQ5qCx3Qve3IiYC8Tcdya5BUHVAlcLvExGxT4hLwlBAA53vHG+fc ICMI1w4R6nH4/27DtxQZEHDyqGmuS5/JEMHTy9w6Tvl4m5shGwUWY1X7Yf3LW+gN59dT F+gcfmO4Q2sBal5m7xgJ2aAo7b22Y1Y+itZuw= 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=i+nlIQU5Q4Q+5yqV54CJ9EfsreolC7pvz3GF0Ss3P3bdOfPw8/Z9KyCtvldQbtCGdX SvmGEClgozoG7n45QIpaHtQFCwu8EJzCYyJ+Nk2V36V+0wE+uc+au0d+fUU2jIZDQpbn XihgS2PqvuE/BTrUa8ZctD9pQwhNUJQXm3OuxsxrLV3CYAGlOzt5q/IEYd2u0vo7l70q OivhB+CqEteeLAxD8DcLQ8lvBq06rpYk6KHDpNYegnQZWSbN7NYNbjbquLDhUIr9M3nG 3QOMA2pwGxhKl8DljH9zyAQ9QF0kw4F55yEYA/EibgFecN3ClHDsbxYu8Aop1EMfJhcb ifQg== X-Gm-Message-State: AOJu0YytatvEnMeg/lsazLywQ0hfBew1TJIFRwxiSQWn2EhGE1Rd0Xk2 HhyedisSTXkcHT8Rw3zQcWdemrOpdMsrC9hHzp9bYw7b9abP1x1LTuwGzE/ZaA== X-Gm-Gg: ASbGncuPQEGx4Bjv0yb6XfVHGANpvBknqwI1j05Z48PMUVbxSp7YMIzVHWktFQKxXVB fc3VHfNcGjUByU+3zZfR1NP5aIOMwktViy3BkWxJ3+321gbefgKg6uzi07wNH10l+yiWFmK1TWB WG+pu2WD2RTKML49DANlnqp6MsOfCQofjJwSCdLk17FVG05UY3CFlWWH1mb08brlzqFPSymhM2f F5QbiTbdVnd/N1zGSoPsNRp7Voer4XighIebFgTmkwMTy+SSpdt47lzSCJDG701Ivyj/KAVuNGi zsmcAkPfwvMXtDvMggHTAyP9 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 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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, From patchwork Mon Dec 2 15:47:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13890957 Received: from mail-ua1-f49.google.com (mail-ua1-f49.google.com [209.85.222.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F693126C13 for ; Mon, 2 Dec 2024 15:47:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733154446; cv=none; b=fncGV7L2Z+sgHI4sQ1NvvjwSZoSby43OudRSlSSNzrJEYLxw7dh0jvTiM/MpSeXYOj3FekGjDqpbhTqGQJ0biMq9pjGCxVdH/Fsy9+6W2D1AYZA3YJn47wtWYeREsRco8kedjtwLKGH09ZG/vmw5dmSts8FJhBejJ3tGddzV8rI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733154446; c=relaxed/simple; bh=rjvM8q19fcbBsiIYtenn0hKh0vxaDX+5kJuh6tcl068=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=siJ88f/XQpePwp21GaecryP6TeUrFZKnSIoB3sVjgvm0K58S3qpiL8Qm5AEfZKFfbx0vE3ppRkBzJy9B5E01LjiMT91KYeYO/lNptjJhLnTEKqLhK6ttUbUHN+mjGaze/sTi2gvNZRCc4gmN7psUEhF/X3lS4CR5dvuanpYw3yc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=YqqnGscm; arc=none smtp.client-ip=209.85.222.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="YqqnGscm" Received: by mail-ua1-f49.google.com with SMTP id a1e0cc1a2514c-85bafa89d73so309516241.2 for ; Mon, 02 Dec 2024 07:47:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733154443; x=1733759243; darn=vger.kernel.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=4pxSoz1ajcI3n8y8uPzRsEcpmfNX2HaWKguXvR+KRDQ=; b=YqqnGscmJ2HFm+aU/E53L8QmkLzpSc5bLPhTe0GeXcHOfQwkFy4QjhbwzNlwXr2BRt 6gBnvHToqw7pXxW1/KnR8Su/9TjeFRDj3xbqtNLm8qwBuqt6vduXJMMUmjd1dsQFRN0j 3uF3WGeWGZRksIeAraBkdqr09H6YMW/Y5ho5Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733154443; x=1733759243; 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=4pxSoz1ajcI3n8y8uPzRsEcpmfNX2HaWKguXvR+KRDQ=; b=r+hMgctTdP1s15AKTZHG3qqnrHGYDlBuc71VwbNWdOWlx8gIwuAKchTNUIjfLkYCj9 0DwTzja58d4lAbam8/g6WtCCGaBW3lPNKL09cbPAi5itt17ajAEkujsfDAIdbDyFDh7g AVLqIfWax5XUJEvUiSgNXY3leRRRmV8eyeh0OrWaON1h+7M+riDKhStLNKq/DWtbxW/O BaVsZBiVRPiOnbCGavLzwH8MRDkWsC+XNV2PycFAZLAhlCHyB3KOBOqXDfskmw1/6sFF QbIR5voX7Vxx5naTG8TNQIta1/zb3H6Whv0dgmEFRnNsHgSBbOP1+MyDUyEXgspMdCQw ixBw== X-Gm-Message-State: AOJu0YyEHEURw+PEGBt8W7GU+pEoMAh8jP6oiKypvGkfMgqSHdlrpHL2 sWO2WcdkWE9sxUnRwizSAGgb6lirtji/lFQowNOYlCIdmHZ7yLwd6JgG8QMmxg== X-Gm-Gg: ASbGnctyzXq5xwoVtOfac3YktmgeOvZr3XNc0cXEERHhu/Ub+4K3CblZF9l2MaxP8Ov yYjpt6+sy2HFT8j1B9zFTnbEJaSft4jo/96R9uHArfUYVjKwERSbiZjWH2ijdzsdOcWkerj1Ic3 yjTjLSqR+UgYQukQZ/RCeJe473bOS0Gh9dLhIzD3tekO9rtgRscyNIIj7Tl3/SRC6xL94ub9uOD mE5SQlGaiiPw6wRQjJhQIGu1TIbTlhmaXZHw+jktMCc94yqrhVt5JDkH3ClXofA0/2mJvxMctjP 7PBY2R9wHRhnfydy1mNSiOTe X-Google-Smtp-Source: AGHT+IGaWcZbV6qtojnjaBkX2eRGECUPG2dd+i3FQicKN4gnW5JGkqWcKAek6j+Ilms9M2b0vFq/qA== X-Received: by 2002:a05:6122:3c4f:b0:515:3bfb:c7b7 with SMTP id 71dfb90a1353d-515568dab17mr30842699e0c.3.1733154443629; Mon, 02 Dec 2024 07:47:23 -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.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2024 07:47:22 -0800 (PST) From: Ricardo Ribalda Date: Mon, 02 Dec 2024 15:47:16 +0000 Subject: [PATCH 2/3] media: atomisp: Use the actual value of the enum instead of the enum Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241202-fix-llvm9-v1-2-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 hrt_isp_css_irq_sw_pin_0 has a different enum type than irq_sw_channel_id_t. Replace it with the actual value of hrt_isp_css_irq_sw_pin_0 to avoid arithmetic operations between different enum types (and make the compiler happy). It is required to build with llvm 9 without these warnings: drivers/staging/media/atomisp/pci/sh_css_hrt.c:68:19: warning: arithmetic between different enumeration types ('irq_sw_channel_id_t' and 'enum hrt_isp_css_irq') [-Wenum-enum-conversion] drivers/staging/media/atomisp/pci/sh_css.c:1233:40: warning: arithmetic between different enumeration types ('irq_sw_channel_id_t' and 'enum hrt_isp_css_irq') [-Wenum-enum-conversion] drivers/staging/media/atomisp/pci/sh_css.c:1237:40: warning: arithmetic between different enumeration types ('irq_sw_channel_id_t' and 'enum hrt_isp_css_irq') [-Wenum-enum-conversion] ro Signed-off-by: Ricardo Ribalda Reviewed-by: Andy Shevchenko --- drivers/staging/media/atomisp/pci/hive_isp_css_common/irq_global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_common/irq_global.h b/drivers/staging/media/atomisp/pci/hive_isp_css_common/irq_global.h index 2c47e7820bd7..69e68ecd6bc3 100644 --- a/drivers/staging/media/atomisp/pci/hive_isp_css_common/irq_global.h +++ b/drivers/staging/media/atomisp/pci/hive_isp_css_common/irq_global.h @@ -18,7 +18,7 @@ #endif /* The IRQ is not mapped uniformly on its related interfaces */ -#define IRQ_SW_CHANNEL_OFFSET hrt_isp_css_irq_sw_pin_0 +#define IRQ_SW_CHANNEL_OFFSET HIVE_GP_DEV_IRQ_SW_PIN_0_BIT_ID typedef enum { IRQ_SW_CHANNEL0_ID = hrt_isp_css_irq_sw_pin_0 - IRQ_SW_CHANNEL_OFFSET, From patchwork Mon Dec 2 15:47:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13890958 Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6921770ED for ; Mon, 2 Dec 2024 15:47:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733154449; cv=none; b=SrGla+XC44CRl2TEHT5n8SjUJqZLebyoUWz4HxUxNJdmzxkZYBZdecMJppabfsuBuOiRt8kBdXFoduOCuldzHPII0RuFSTVNLBZ4zgTP+A5Y1h+vY6VJygZn1aTxgOjquW6F5edMMKl/EUVZDa/2JQJBmHuNZY4H7SHa6im1MZk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733154449; c=relaxed/simple; bh=NQt98Z0M5QNA/TsO8gh1YDS9GMK76KynhZ9aabRaUlg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=E9NJHh2KZIEPjMhvYz/nfRScaeWL1O2eNl+ulQcBtuUttNzWJD/zsbPdmpSVmmpjERQDUUB5tjZnYSunBWNgsBcRibT9gfj+iikx7Y1Fc8cwax4Q/449xqr9o2kGy/btLYFlCFhl+VLKu3dW9CyYDO69LbLDc//qCo5Rt+GEDGc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=L7Gmv2zv; arc=none smtp.client-ip=209.85.219.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="L7Gmv2zv" Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-6d88cb85987so22641596d6.1 for ; Mon, 02 Dec 2024 07:47:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733154445; x=1733759245; darn=vger.kernel.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=l2F2lVT/48t59mZz2zC2oH5sxyMbSECeGcR5hkq1C/k=; b=L7Gmv2zvrBkVAJTmF5xBrM9r0j/frnToHTvotHEjxhCbFDhji/SvvD+8eNb2A5NCoN CgGDzV9PuCJ2uw0j+L3rT3rDawUrPBOJvUKbVNYwStlfEWluY7vYbtFBR+eVJ+5/0JeX JITPQD0mClFdKEgs2jmct8LMMnXjJ9WWBRWcY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733154445; x=1733759245; 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=l2F2lVT/48t59mZz2zC2oH5sxyMbSECeGcR5hkq1C/k=; b=aVqNGp042KwbGeDE0H/EHGdXf18Y/4cLTFsa5LECuE5yChdGz3srPx8ggDT9g6br7v 1kETa0rZ6RED+Wx2fKlZ8jT3dpFg9dpfPekcWSnlz2+1Eg4S+imwG+Y9Q0SE4iNfcSnV VvepyapJWuDifdM3IkjrHJWDDNe51TrzF5cAFmgvS9fNF8OhTfzdgSeGrxMtpUsV9DQo 7mkMN5hNgDh5nscBW7YbeyhMIdc+hL33GzcGoBPzkjEjhCIYP3ONldDiuMQZaH5wb17T HGo9WOSkDgMcl9fu/zq5NY/RP0QK7Z7gMexhYCyV4wy9o71Hea3ZR9YYTv45HiGuz2nw SSLg== X-Gm-Message-State: AOJu0Yxh1jZKtVeNg6MnU6lD/J6U3Cw1VtSLpF4l74ov7h1AwVePTsbR 0vXHHCFPDeGLf9D+uNpnOedgI2G9TbACz5dRdhXo6EvVoPegvqXFNbIIXT+Pag== X-Gm-Gg: ASbGnctCCobahSkv+t3uiNUGBsQe+ef1IpAgj1/hB1OyjAZGeKxAcy6KEYQzTGEZ6CO oDEhSfbNeM0iO44xw24BXtFGYHcrwvh1n5VbqbafZ8wYJPybqD72CsJk60VIFANjlplGQKuP2a5 ExuGLniPRwSKqs2GTuiKGQiAx63pHeRATik3Ya6gB11BuBzq2DVJpm6DyEgooXy6i0qRucAQyVA thGnCvCYbatYIs6v29CETJdojSOzcdJzWuld3UGSxKKpDi0Fhz8ppkWXPDfpiQl+Xk/npYs5Bv7 4knZX/Tvsn95TiHnm3zMX1dG X-Google-Smtp-Source: AGHT+IGi/PMi7HKxN0drYRNoeMrQehkEDZgCgHDgtdOzyjj8HEWJDMxx4Dj3/iwSYHFuTdJy9nQktg== X-Received: by 2002:a05:6214:626:b0:6d8:a1b4:b58f with SMTP id 6a1803df08f44-6d8a1b4bb2amr99633466d6.11.1733154445272; Mon, 02 Dec 2024 07:47:25 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2024 07:47:24 -0800 (PST) From: Ricardo Ribalda Date: Mon, 02 Dec 2024 15:47:17 +0000 Subject: [PATCH 3/3] media: mediatek: vcodec: Workaround a compiler warning Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241202-fix-llvm9-v1-3-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 llvm identifies that the SCP_IPI_VENC_H264 and IPI_VENC_H264 are from the same enum type, but their are part of the same ternary operator. vpu_inst.id is of type int, so we can just rewrite a bit the code and avoid the following llvm9 warning: drivers/media/platform/mediatek/vcodec/encoder/venc/venc_h264_if.c:597:29: warning: conditional expression between different enumeration types ('enum scp_ipi_id' and 'enum ipi_id') [-Wenum-compare-conditional] Signed-off-by: Ricardo Ribalda Reviewed-by: Nathan Chancellor --- drivers/media/platform/mediatek/vcodec/encoder/venc/venc_h264_if.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/encoder/venc/venc_h264_if.c b/drivers/media/platform/mediatek/vcodec/encoder/venc/venc_h264_if.c index f8145998fcaf..4786062e879a 100644 --- a/drivers/media/platform/mediatek/vcodec/encoder/venc/venc_h264_if.c +++ b/drivers/media/platform/mediatek/vcodec/encoder/venc/venc_h264_if.c @@ -584,7 +584,6 @@ static void h264_encode_filler(struct venc_h264_inst *inst, void *buf, static int h264_enc_init(struct mtk_vcodec_enc_ctx *ctx) { - const bool is_ext = MTK_ENC_CTX_IS_EXT(ctx); int ret = 0; struct venc_h264_inst *inst; @@ -594,7 +593,10 @@ static int h264_enc_init(struct mtk_vcodec_enc_ctx *ctx) inst->ctx = ctx; inst->vpu_inst.ctx = ctx; - inst->vpu_inst.id = is_ext ? SCP_IPI_VENC_H264 : IPI_VENC_H264; + if (MTK_ENC_CTX_IS_EXT(ctx)) + inst->vpu_inst.id = SCP_IPI_VENC_H264; + else + inst->vpu_inst.id = IPI_VENC_H264; inst->hw_base = mtk_vcodec_get_reg_addr(inst->ctx->dev->reg_base, VENC_SYS); ret = vpu_enc_init(&inst->vpu_inst);