Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4276007pxf; Tue, 23 Mar 2021 07:07:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzaumYd/EPiqtPEsPF5brioELmV0vOIhUgE7kQ37t0jyvN0J7yn6Pz5K3XzyiM3zF7CdTei X-Received: by 2002:a17:907:7664:: with SMTP id kk4mr5364840ejc.352.1616508446922; Tue, 23 Mar 2021 07:07:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616508446; cv=none; d=google.com; s=arc-20160816; b=uMqkEaOJTvcho7YcdNKYpYtfBN8QFiZCPyKfdwbKqn+zqv4avXqp8YyfVBf8AzaVlz VWLAKYfRAJdu/gRfs5iLOgih27YbU2jFW3DX5fvzxD3FKy5tfX0zGQIAlD/GssdRlYFQ faw7xuss0ylEabjoWFbS0tR0ml/p9ztdJkOYNMqNjrdlmT/zlKNVbO+0fxUepOfm9EP/ ogDa4qJGYQmCXHbLLs7pxpYOV25PHizKMElF0GGQaHS1FPg+36McckjND5Jfgwkeg9wz s2OvoweLjPhrEycDlVxQ/5RwZHGw+MBvRHyygZAcgQHPqCBdNZe3I76i8ypYfCYQsxgg vd3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Ku+levvVxBeqKSuHI7QAU6DJ1TT9V2yW8FV3fTDnwwo=; b=b4njTWNvHVBHeNmovjyGIpue3as3iiLvlQQVPd/wKlM04tpOvxNqiarGuLJQyXiVj7 0sK2GfGEeY0Fnv1FlHeStn4WuPOGHO/deb3EWYRiGcapRdROSs9tQY0+ofgFUTggfQa6 q609DnEoDw2NdjWylph2JrbXvrlXKZ41T5bucc3CWjyDO088GXoe1Rl4n7raFH/KAPEh uDK5tiFNxy5vxP2Io1PK6G8v2o1B6hxCwY5CFEMl2S6Re21qB9AwjGJvfc+UM6Ii6VJB V68CC3zlyDEGfylX7SVEbWMuhuBVPlZzOzmc+U2H2RnUlUiYWNZ/giM20OgWnwYyCPcs R9Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y4sDWZnW; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hd31si11892282ejc.257.2021.03.23.07.06.58; Tue, 23 Mar 2021 07:07:26 -0700 (PDT) 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 header.i=@gmail.com header.s=20161025 header.b=Y4sDWZnW; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232111AbhCWOCl (ORCPT + 99 others); Tue, 23 Mar 2021 10:02:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231839AbhCWOCZ (ORCPT ); Tue, 23 Mar 2021 10:02:25 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D595BC061574 for ; Tue, 23 Mar 2021 07:02:24 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id m12so26781391lfq.10 for ; Tue, 23 Mar 2021 07:02:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ku+levvVxBeqKSuHI7QAU6DJ1TT9V2yW8FV3fTDnwwo=; b=Y4sDWZnWLFkjeVLPKdcxZ9yafDLWRrvFZTzPiEKg8gxPfH70ZCk6lCglyy8tJqxPpm AU4lNcx4+faeYBwKzIlFF4T6qnIGRbykR42u3VFqxtPO6JWxnNVvInx9PdC3LF06Ts+6 DKLmuVRW3PKiaxdZjTm3r+/OS+peiAm9T0HuWfdibI8MUHClff3qHkYl3gLpx35sgFUV AugfY7kpJMUBLhaJrR0nfZ24txNcRqwFz2+Tu948DmtkSPGT3zsHP0iaQlibIA+4VTm7 VMWQTj+XtpOKOy7fsBkZYAsUp9saldvz1XzJaer6qj266b4DYlaqDf0unUa+0cftwsFy wCJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ku+levvVxBeqKSuHI7QAU6DJ1TT9V2yW8FV3fTDnwwo=; b=HzXCazIs7IPnp9iTpDqluWEWqtm4JAgWER3X/lFAs+ulucIgZAqBaeR+lVDfAcE4HC l8zetdHw7LGqCbbLZnEf9dfg1u3hYo2B56K05oenGcjB1o4/wjDe8/6p/WIFaZqnk+mk N4/roDed/nYpPpYmx7TvaDgSF6r8KYcoBxKdvJacxebwN8EfppiLTpyC0qjAIyAu6W+C ovE31VYrMhWd2aY5IW45vbnZAk+I9PpLaABAacK84YWz9j1GE8PUYc00MKOR/vv4ujN+ kqje4MpBPr79jcjEtAY0xWep5F5xbGd0GNktBXpn073x9o973wswmCvXSgJxf5LXiWi+ VHtw== X-Gm-Message-State: AOAM532uG1pSkh6OMbNVvU9eKL9t7+iAVZZ8dgNLYHC8NYq5LhVZuN0u k/XdQmYJbfBFKE8ew8jeK6Wta7/Ko3GsECL1Y1I= X-Received: by 2002:a05:6512:3996:: with SMTP id j22mr2564356lfu.443.1616508143271; Tue, 23 Mar 2021 07:02:23 -0700 (PDT) MIME-Version: 1.0 References: <20210323130550.2289487-1-arnd@kernel.org> In-Reply-To: <20210323130550.2289487-1-arnd@kernel.org> From: Fabio Estevam Date: Tue, 23 Mar 2021 11:02:12 -0300 Message-ID: Subject: Re: [PATCH] drm/imx: fix out of bounds array access warning To: Arnd Bergmann Cc: Philipp Zabel , David Airlie , Daniel Vetter , Shawn Guo , Sascha Hauer , Arnd Bergmann , Pengutronix Kernel Team , NXP Linux Team , Marco Felsch , Joe Perches , Laurent Pinchart , Liu Ying , Thomas Zimmermann , DRI mailing list , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, On Tue, Mar 23, 2021 at 10:05 AM Arnd Bergmann wrote: > > From: Arnd Bergmann > > When CONFIG_OF is disabled, building with 'make W=1' produces warnings > about out of bounds array access: > > drivers/gpu/drm/imx/imx-ldb.c: In function 'imx_ldb_set_clock.constprop': > drivers/gpu/drm/imx/imx-ldb.c:186:8: error: array subscript -22 is below array bounds of 'struct clk *[4]' [-Werror=array-bounds] What about making the driver depend on OF instead (like it is done in DRM_IMX_HDMI) ? --- a/drivers/gpu/drm/imx/Kconfig +++ b/drivers/gpu/drm/imx/Kconfig @@ -27,7 +27,7 @@ config DRM_IMX_TVE config DRM_IMX_LDB tristate "Support for LVDS displays" - depends on DRM_IMX && MFD_SYSCON + depends on DRM_IMX && MFD_SYSCON && OF depends on COMMON_CLK select DRM_PANEL help