Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2018632pxu; Sun, 6 Dec 2020 16:01:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJwLJTMMeyFvApTMHDkwb+74sH9IqEEl4dBrurFBvD6sXOWuWyNPnHHH8v/psI8m+hso3fAX X-Received: by 2002:a50:ff05:: with SMTP id a5mr17594704edu.43.1607299313985; Sun, 06 Dec 2020 16:01:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607299313; cv=none; d=google.com; s=arc-20160816; b=vkASbQkk+UCf03FOF2A5MsV8PG8bn6QdNvyUykU3P3945rtXGVvNkJw3V3LsQlRJ7c r4TymI8yx5llJtCXlpFMPHqRkJAQ0fi+tnv8X86fCES5M1URGu9RlK4eQMC2a5HljdYx /bZBQDfFElhtswZPzfOdclzAQtcF1SZX5qIg29mUaKJquf2hgdYxSBrhreiOwMSry//t JQeAa1uB/6jKTC5KaClkfx3qtcEYfCPHC8aBF+HcUOUU3SOWcSk0TgMCtyKGYZtPP+g2 fCKpxVa8HLvEegBk68xWyTXQJT9Mn3v7MFm5HUDSv1Gqw8P87Ml0WG0zqW/AcuNX6z0E seuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9HmcBPykNrunOy+yb944Y1spgPOamX4jEtBKfWXIEgw=; b=z5pNtWWwEWsFq/P2jQsnYDuHksFRMqIDDxKRIL6Go6ZElASIrqpPkfBLjWzHjqAwmr w1vDLYNRqiWT8H9iwFz4dGjWNnSeVI4XvH1woAiL1eVT3Hgt40jX5JzO18HqOjGx2Mzo g1h7qq0XpHB8Gf/alULocbQcfxeXnO3GqmQJ7ZBHjUFFAk2EHuPYiNONoyD+TmNFFN7t F6Z/4+Yz9UmQVUDxp8RV2QqgWWP2xThLPXTDm0XpYgW3nWN7AW6hagXcMHNymnH8QgDV xa9VAWS/fyczpIc7X6hF+NeXZYDJUSxyvLmCNkzP324GMAcelrh6iX1izrW3K8fWLN+r 4Dnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=lPEhUDlL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j1si7035328edf.417.2020.12.06.16.01.17; Sun, 06 Dec 2020 16:01:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=lPEhUDlL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728722AbgLFX6d (ORCPT + 99 others); Sun, 6 Dec 2020 18:58:33 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:60442 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728444AbgLFX6d (ORCPT ); Sun, 6 Dec 2020 18:58:33 -0500 Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1D4548D; Mon, 7 Dec 2020 00:57:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1607299037; bh=QSm/E6q7vVOxUbgsbatzp26B17I1fQagq5MN3nK7sVg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lPEhUDlLwn+waXpxNBHUdtMfISTdy4vAQpPMiKlaCNIRROhYzLbUs84ws8fCgOIv5 w6HUR64n3cVPeKUePf57VHZPV4+uR0xNB7kdx7p6CpmaDU9J4bu5V47Ye5b14OOnn7 qn6Yzqz23IyO80W5NZVBJqSe9+ZFvlIWluWUVMs4= Date: Mon, 7 Dec 2020 01:57:15 +0200 From: Laurent Pinchart To: Arnd Bergmann Cc: Benoit Parrot , Mauro Carvalho Chehab , Arnd Bergmann , Hans Verkuil , Sakari Ailus , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] media: ti-vpe: cal: avoid FIELD_GET assertion Message-ID: References: <20201203230738.1481199-1-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201203230738.1481199-1-arnd@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, Thank you for the patch. On Fri, Dec 04, 2020 at 12:07:30AM +0100, Arnd Bergmann wrote: > 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 Reviewed-by: Laurent Pinchart This doesn't conflict with the series I've just sent for the CAL driver, and can thus be applied first or on top. Hans, can I let you handle this ? > --- > drivers/media/platform/ti-vpe/cal.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > 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)); > } -- Regards, Laurent Pinchart