From patchwork Thu Dec 3 23:07:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 336961 Delivered-To: patch@linaro.org Received: by 2002:a92:5e16:0:0:0:0:0 with SMTP id s22csp696334ilb; Thu, 3 Dec 2020 15:09:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJx4JPb9GakQV2TbRw1MNQmenIzwRBwh9i2OlbsQ36QukKrOvXHiYTmceHZvPb5DusfCarMf X-Received: by 2002:a17:906:2818:: with SMTP id r24mr4469506ejc.100.1607036999837; Thu, 03 Dec 2020 15:09:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607036999; cv=none; d=google.com; s=arc-20160816; b=cK8ionLfrQV5bxHsewdsppIX4kF7nWJ0WwGWytC/Jk+dQLL1+w+HlPRt4BHoFDDzog dPgrcRchaosCN+ijzRfWfR3nzIhhD8vqk1v7k9pI3nuzVWZS47+4FMg0OWCjZud4WM/T Tg7US6EQ6WLn/Bc5p2CNW+VVvmRDJASmJyDKX+scLBxWRYHjYCJGYCx2oH4Vserh9ZBp cmR5II/y+APFdHedC5xUswy+eN89a5m/bcPvJW9/jDS8tFD5HDYra5MOfktCIKCbKFTy bUEMGPhsUnxfqK+OAORIn2XcmgJPohGtR7S/Ypzb9LDvukFvbtkm2WbZV7BWy/SsiATG tGXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=G0W69syK3bRpc+Q/cxu5S3KVNxTP8SlTpY4YLPJUzkg=; b=IvrPxLDeiWCjf1FawCAjXtQSH4Xes+pTToJVc2PIeweo3NSwGHzE3LRXjnaZa4dKvH CZsATpM10NCmVJ1T6pdmJ8lkdfVuhyejYXHUPhL27OKoOA1dyqGHtSS7gBTZzlSosrAH 2fE8xM6DV1WdMCpWicfBcb2Z8P5EgLzfhrdYcYl85JzOflXvrgZeOMPc1R3KM0mmrYUl QdWugz5AxHchR42SFtuGkOIrN3/CT2pvuZPQlNKdUIdHbhwxLRvJlAjXFFJAROTa27NA TcPOVVU5yq8btQxPAP/HKpIjsuWOwFvAJb+ktvD1Khf1fTPWl7PgX1qZEhhuiK3a/9u6 nIdA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nx22si272888ejb.503.2020.12.03.15.09.59; Thu, 03 Dec 2020 15:09:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728922AbgLCXIX (ORCPT + 4 others); Thu, 3 Dec 2020 18:08:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:33834 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726179AbgLCXIX (ORCPT ); Thu, 3 Dec 2020 18:08:23 -0500 From: Arnd Bergmann Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: Benoit Parrot , Mauro Carvalho Chehab Cc: Arnd Bergmann , Hans Verkuil , Laurent Pinchart , Sakari Ailus , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: ti-vpe: cal: avoid FIELD_GET assertion Date: Fri, 4 Dec 2020 00:07:30 +0100 Message-Id: <20201203230738.1481199-1-arnd@kernel.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Arnd Bergmann FIELD_GET() must only be used with a mask that is a compile-time constant: drivers/media/platform/ti-vpe/cal.h: In function 'cal_read_field': include/linux/compiler_types.h:320:38: error: call to '__compiletime_assert_247' declared with attribute error: FIELD_GET: mask is not constant include/linux/bitfield.h:46:3: note: in expansion of macro 'BUILD_BUG_ON_MSG' 46 | BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask), \ | ^~~~~~~~~~~~~~~~ drivers/media/platform/ti-vpe/cal.h:220:9: note: in expansion of macro 'FIELD_GET' 220 | return FIELD_GET(mask, cal_read(cal, offset)); | ^~~~~~~~~ The problem here is that the function is not always inlined. Mark it __always_inline to avoid the problem. Signed-off-by: Arnd Bergmann --- drivers/media/platform/ti-vpe/cal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.27.0 Reviewed-by: Laurent Pinchart diff --git a/drivers/media/platform/ti-vpe/cal.h b/drivers/media/platform/ti-vpe/cal.h index 4123405ee0cf..20d07311d222 100644 --- a/drivers/media/platform/ti-vpe/cal.h +++ b/drivers/media/platform/ti-vpe/cal.h @@ -215,7 +215,7 @@ static inline void cal_write(struct cal_dev *cal, u32 offset, u32 val) iowrite32(val, cal->base + offset); } -static inline u32 cal_read_field(struct cal_dev *cal, u32 offset, u32 mask) +static __always_inline u32 cal_read_field(struct cal_dev *cal, u32 offset, u32 mask) { return FIELD_GET(mask, cal_read(cal, offset)); }