From patchwork Tue Feb 28 21:14:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9596875 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 0345860574 for ; Tue, 28 Feb 2017 21:19:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB83D28597 for ; Tue, 28 Feb 2017 21:19:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E07122858F; Tue, 28 Feb 2017 21:19:08 +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=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FACB2858F for ; Tue, 28 Feb 2017 21:19:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751778AbdB1VSd (ORCPT ); Tue, 28 Feb 2017 16:18:33 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:65161 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751531AbdB1VQr (ORCPT ); Tue, 28 Feb 2017 16:16:47 -0500 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.129]) with ESMTPA (Nemesis) id 0M9L3K-1cbdaH2euE-00CiMu; Tue, 28 Feb 2017 22:14:59 +0100 From: Arnd Bergmann To: Bluecherry Maintainers , Andrey Utkin , Mauro Carvalho Chehab Cc: Arnd Bergmann , Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [media] tw5864: use dev_warn instead of WARN to shut up warning Date: Tue, 28 Feb 2017 22:14:37 +0100 Message-Id: <20170228211453.3688400-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:J9gcQ0aiTgnXz4R8IQJ6iMZ8mcymHYJOegAQLdv0JjSgvOYRkm8 Xpl5XhL5m/UTcu+HfN0QHOpqKMgV+hQU0mk/IlwVKWDWh71sOaCefjGJf7/kZgWwd/Ehd8S DDTXSBmcg6rqIADNGVzrSolg/aX+jS1Lb0BboBB3FQUCTZI64oaDBNeONxglQArItxrUoC/ C0zORKGS6GB7Suj7Mbc9Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:om0xzImTG+Q=:pl4GB0aRktbfe0QPNg0kYA jNmxQdOD70ehMoroU8bTHr8bX90C2+n+ZV+lcUm/Zdg784WJaf/QguzqlnNc599HSXTTCQGGy g+/Pzk2Lx0pOMA+QLYQj8a0ZlF9hFsuPtTzCPny29urd+iHZqMWesvAPX8A+H4aPxQ7MaItou TyE1aBAVHZB1ReYbNuMN8oiB9aecses7GhwKI/8zQyzuqAXP4CWX6QZvd4IhbWsGg1JpSC9ol rwpqr99Oi9B4+vFFfWFiXdp2OuwfsRhCugcGk91oTNtjIXLxnDIIAqnktnB4uiaQcMjaNF9cC 04tXcLW5aCkUCR6OH3RQFKcjXhVcGqGd1nBHi0FV7nFcIztuwAzHLoEGoC+JdtsUP9zDLsrDw LBeARLI4FsKSrgfs2lHmfOcUnZolPRTpqkJ+pJ2xcEbFngSc/9xzHCUhTWpR8Tz9pGRdy+uDx tjCzgRWsFWo2LLQcz32ASMNUeJ420YzuKmCNgtltkECr93LkrbECNHBRKHQdmUU2F06brdH6x E9ila+1/n/OzKilMd2CUvVfwFzJP3O666m7YQOlokeMHebyaSTrRIymTWfcSW2aiE5rC9bYbj g1P5anM8lUh4t0xvb8AIcmjscHVuWsVueA6ElXeILHk9vxagxhERG7NvBJM2xMKB7cE8w7kAv 9NeSOtk5ux2FVAa85s4FHtJRpj0Qzeemaoak6VHj/T4CZvjlqmaUurqDO55eMjZz93z4= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/media/pci/tw5864/tw5864-video.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/tw5864/tw5864-video.c b/drivers/media/pci/tw5864/tw5864-video.c index 9421216bb942..4d9994a11c22 100644 --- a/drivers/media/pci/tw5864/tw5864-video.c +++ b/drivers/media/pci/tw5864/tw5864-video.c @@ -717,6 +717,8 @@ static void tw5864_frame_interval_set(struct tw5864_input *input) 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; @@ -728,8 +730,8 @@ static int tw5864_frameinterval_get(struct tw5864_input *input, 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; }