From patchwork Fri May 4 15:23:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 10380859 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A04746038F for ; Fri, 4 May 2018 15:23:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DCA5294CE for ; Fri, 4 May 2018 15:23:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80ECB294D3; Fri, 4 May 2018 15:23:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CB18B294CE for ; Fri, 4 May 2018 15:23:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 22DD56E8EB; Fri, 4 May 2018 15:23:36 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fireflyinternet.com (mail.fireflyinternet.com [109.228.58.192]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0494D6E8EB for ; Fri, 4 May 2018 15:23:34 +0000 (UTC) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from haswell.alporthouse.com (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP id 11599832-1500050 for multiple; Fri, 04 May 2018 16:23:21 +0100 Received: by haswell.alporthouse.com (sSMTP sendmail emulation); Fri, 04 May 2018 16:23:20 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Fri, 4 May 2018 16:23:18 +0100 Message-Id: <20180504152318.23625-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180503105306.GA5315@mwanda> References: <20180503105306.GA5315@mwanda> X-Originating-IP: 78.156.65.138 X-Country: code=GB country="United Kingdom" ip=78.156.65.138 Subject: [Intel-gfx] [PATCH] drm/i915/dp: Silence static checkers for n_entries X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rodrigo Vivi , Dan Carpenter MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Smatch warns that n_entries isn't always set, so copy'n'paste the common response used in the other setup paths to silence gcc. The advantage of fixing it in situ (rather than use a zero initialiser) is that the analysers are quite capable of then spotting the absence. Reported-by: Dan Carpenter Signed-off-by: Chris Wilson Cc: Rodrigo Vivi Cc: Dan Carpenter --- drivers/gpu/drm/i915/intel_ddi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c index 8225d223f452..31f781bb73ca 100644 --- a/drivers/gpu/drm/i915/intel_ddi.c +++ b/drivers/gpu/drm/i915/intel_ddi.c @@ -888,6 +888,7 @@ icl_get_combo_buf_trans(struct drm_i915_private *dev_priv, enum port port, *n_entries = ARRAY_SIZE(icl_combo_phy_ddi_translations_edp_1_05V); return icl_combo_phy_ddi_translations_edp_1_05V; default: + *n_entries = 1; /* shut up gcc */ MISSING_CASE(voltage); return NULL; } @@ -903,6 +904,7 @@ icl_get_combo_buf_trans(struct drm_i915_private *dev_priv, enum port port, *n_entries = ARRAY_SIZE(icl_combo_phy_ddi_translations_dp_hdmi_1_05V); return icl_combo_phy_ddi_translations_dp_hdmi_1_05V; default: + *n_entries = 1; /* shut up gcc */ MISSING_CASE(voltage); return NULL; }