Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4036570ybe; Mon, 16 Sep 2019 05:48:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwT/ndstFSHtpx7/udXrbfTn6Qk5qAuq7+DIH/tvb5o9K37ZmSVdOieN0jxRExanqnmKECN X-Received: by 2002:a17:906:5c49:: with SMTP id c9mr51969557ejr.78.1568638129616; Mon, 16 Sep 2019 05:48:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568638129; cv=none; d=google.com; s=arc-20160816; b=jmbi649xzICS+V3wp1T/uLghCvWQHmGn3zcEbq4tozwTqI2m/QtuG5EcTumUJCkm7q O6x9CHq52gXZfdZJ2baTaPCh6vCBv/gyjSfLK/uBPY6Dl2nKnqCj8xJylPlIj9MKwOPf iz/0ta4BZMKqz6+F5gEfqCixhNJDNHrKpDVB/2EQVBm4U6ZHIVJfxJy9DIYgp/WBXtT5 KKv7Vxmz/XttyJ9C3aLoDia0A/DXgJsaSG2HpE8hgUD/9DOqLEajhD4/F/lVXr4ZFwEV nrDed1TKVHlmkoImhe4/+GJTfHIyeFQuOCkI9preMq+/6hL6HxSTOOeCSwlpq6MaIOP3 FlTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=S5XgkH0113tFj+/s5PpoRYUffdZlb4I6gXX5bZlF+hA=; b=mIMKYp5Tuy3LBaoyTlBaJgUPW+E9dJJgyJTri7cjoLQCsa+aVBq+kd9xynEMsFGeGw gfALFS2eC+TylyKvZlwk4lmJauCgxlNSrAAONPxmxRoBPfEIMqxsjgB6zL5L8hYB3Z8/ d4o2L8i4iYiVcSy3dqo2/YW0zlDWKe6J+L10AyyB68gdQlNkXEZcgGnp3BXnrdfTHX1O q10jm9x2CPwKB31gwIDFhk3O5zQorMPkXTGrELbMRb7KLcjXT5HXbRaRXRJVywn/+okC 0RPgCp6jm6YihDhP0UIrwlzB62BlKAIrGdqf4XzkfcklJE7HhZaaA3eaqOCgQF/FJppI SAhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si3716296eju.78.2019.09.16.05.48.25; Mon, 16 Sep 2019 05:48:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732742AbfIPMnr (ORCPT + 99 others); Mon, 16 Sep 2019 08:43:47 -0400 Received: from mga18.intel.com ([134.134.136.126]:33211 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727874AbfIPMnr (ORCPT ); Mon, 16 Sep 2019 08:43:47 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Sep 2019 05:43:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,512,1559545200"; d="scan'208";a="193426829" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by FMSMGA003.fm.intel.com with SMTP; 16 Sep 2019 05:43:40 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 16 Sep 2019 15:43:40 +0300 Date: Mon, 16 Sep 2019 15:43:40 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Dan Carpenter Cc: Jani Nikula , kbuild@01.org, kbuild-all@01.org, linux-kernel@vger.kernel.org, Chris Wilson , intel-gfx@lists.freedesktop.org Subject: Re: drivers/gpu/drm/i915/display/intel_display.c:3934 skl_plane_stride() error: testing array offset 'color_plane' after use. Message-ID: <20190916124340.GF1208@intel.com> References: <20190914040858.GT20699@kadam> <87lfuou27c.fsf@intel.com> <20190916075913.GZ20699@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190916075913.GZ20699@kadam> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 16, 2019 at 10:59:13AM +0300, Dan Carpenter wrote: > On Mon, Sep 16, 2019 at 10:31:35AM +0300, Jani Nikula wrote: > > On Sat, 14 Sep 2019, Dan Carpenter wrote: > > > tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux.git master > > > head: a7f89616b7376495424f682b6086e0c391a89a1d > > > commit: df0566a641f959108c152be748a0a58794280e0e drm/i915: move modesetting core code under display/ > > > date: 3 months ago > > > > > > If you fix the issue, kindly add following tag > > > Reported-by: kbuild test robot > > > Reported-by: Dan Carpenter > > > > > > New smatch warnings: > > > drivers/gpu/drm/i915/display/intel_display.c:3934 skl_plane_stride() error: testing array offset 'color_plane' after use. The code looks fine to me. int color_plane is 0 or 1 so we know the color_plane[] array is has enough elements. But if fb->num_planes==1 we don't actually want to look at color_plane[1]. > > > drivers/gpu/drm/i915/display/intel_display.c:16328 intel_sanitize_encoder() error: we previously assumed 'crtc' could be null (see line 16318) If crtc_state!=NULL then crtc!=NULL. Looks safe to me. > > > > Odd, what changed to provoke the warnings now? Or is the smatch test > > new? > > > > It looks like the cross function DB is out of data slightly. Maybe > because the file moved? On my system Smatch knows that color_plane is > 0-1 and plane_state->color_plane[] is a two element array so it doesn't > print the warning. > > This is just a sanity check which is never triggered. Should the sanity > check be move? What was originally intended? It's hard to say. > > regards, > dan carpenter -- Ville Syrj?l? Intel