Received: by 10.223.185.116 with SMTP id b49csp1087173wrg; Fri, 23 Feb 2018 11:41:57 -0800 (PST) X-Google-Smtp-Source: AH8x225hKgQOgLE4qNHbrAkYduGbJjywlzKtkzldyUtHR27YfjyOoU8ztg0P7/b4eNnxwEUgw/m+ X-Received: by 10.98.242.65 with SMTP id y1mr2742465pfl.232.1519414917649; Fri, 23 Feb 2018 11:41:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519414917; cv=none; d=google.com; s=arc-20160816; b=pUzAS791M+a/ucMmK1zJXOdnb4qo7Dk8RNoQu2xM7DNPsefkhjrDQxipV+jSRvOYAz k/Tk6JSXJoOzG6ZhqWjOTOCSoh/GR2VjThttOfEAYlYk1r1EL7kqfcBPuTNqzoV3KSbQ 4i2b4sV19rBlEi+ybltHBvfDFPCNVzswSoHTe/UyJJXwjJiE/sPRMfdNeQnsTfL2O81Q yXSlhPp8Wys4mXzgx42gcTfLsV0U2AhIAaQzrhiqr1aRxyAizTrmGylNEmpXGJr8UDRu 3oktRVxAdm46wT/TUl4zegx1r6Or2O1tEyJhwJ6t9oYVTe3oifLWW8YSEHnKV9nryuPr 7DDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=lH1f+YA/ZiMdkFsVtCSNltFmBrWKdSTQ1AbXBlNsWvY=; b=CwqBkhN1DLciUCcfyjpQvnGfJml3K0CWAUxtTdKzElmMnRo3GHyP1+DPcEWdte1EVu cjgiWjliqN4H5RiY6lyYNZvlehBcyPkuFejg5rYpaveeZvqXa1Q9s2XkKcb+m545Sxmh Lg7qDlgotkPYl9Qu1HPtp0Kba1I6CCKD+rAKRKPCo/bleMUDaOmNhkPPC2uM0jqb3bJX EwvjU+1FEH+Hw+USyRpRcP/wecxGe3Ox7uR+Gs1tHErDWairYdnPgIHTfGguQErl2Tp3 XavXBZnOpCAbvsH8gu1IkCQGZSPXQVTAn8cHkcKURyrsbj0Oz8weJ5eUrkYBlQ/Mn+Kf B+hQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o28si2273077pfa.209.2018.02.23.11.41.43; Fri, 23 Feb 2018 11:41:57 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754745AbeBWTlF (ORCPT + 99 others); Fri, 23 Feb 2018 14:41:05 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:45218 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934493AbeBWStP (ORCPT ); Fri, 23 Feb 2018 13:49:15 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id BA51B1175; Fri, 23 Feb 2018 18:49:14 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Andrey Utkin , Hans Verkuil , Mauro Carvalho Chehab Subject: [PATCH 4.9 130/145] [media] tw5864: use dev_warn instead of WARN to shut up warning Date: Fri, 23 Feb 2018 19:27:16 +0100 Message-Id: <20180223170741.602094154@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170724.669759283@linuxfoundation.org> References: <20180223170724.669759283@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann commit 27430d19a91615245babaa9b216d0807636903a0 upstream. tw5864_frameinterval_get() only initializes its output when it successfully identifies the video standard in tw5864_input. We get a warning here because gcc can't always track the state if initialized warnings across a WARN() macro, and thinks it might get used incorrectly in tw5864_s_parm: media/pci/tw5864/tw5864-video.c: In function 'tw5864_s_parm': media/pci/tw5864/tw5864-video.c:816:38: error: 'time_base.numerator' may be used uninitialized in this function [-Werror=maybe-uninitialized] media/pci/tw5864/tw5864-video.c:819:31: error: 'time_base.denominator' may be used uninitialized in this function [-Werror=maybe-uninitialized] Using dev_warn() instead of WARN() avoids the __branch_check__() in unlikely and lets the compiler see that the initialization is correct. Signed-off-by: Arnd Bergmann Acked-by: Andrey Utkin Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/pci/tw5864/tw5864-video.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/media/pci/tw5864/tw5864-video.c +++ b/drivers/media/pci/tw5864/tw5864-video.c @@ -708,6 +708,8 @@ static void tw5864_frame_interval_set(st static int tw5864_frameinterval_get(struct tw5864_input *input, struct v4l2_fract *frameinterval) { + struct tw5864_dev *dev = input->root; + switch (input->std) { case STD_NTSC: frameinterval->numerator = 1001; @@ -719,8 +721,8 @@ static int tw5864_frameinterval_get(stru frameinterval->denominator = 25; break; default: - WARN(1, "tw5864_frameinterval_get requested for unknown std %d\n", - input->std); + dev_warn(&dev->pci->dev, "tw5864_frameinterval_get requested for unknown std %d\n", + input->std); return -EINVAL; }