From patchwork Wed Jun 5 21:53:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 10977939 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6E72E6C5 for ; Wed, 5 Jun 2019 21:54:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F31628AA5 for ; Wed, 5 Jun 2019 21:54:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4BC8928AAB; Wed, 5 Jun 2019 21:54:03 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham 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 E69A228AA2 for ; Wed, 5 Jun 2019 21:54:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726794AbfFEVyB (ORCPT ); Wed, 5 Jun 2019 17:54:01 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:35332 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726754AbfFEVx7 (ORCPT ); Wed, 5 Jun 2019 17:53:59 -0400 Received: by mail-it1-f193.google.com with SMTP id n189so10947itd.0 for ; Wed, 05 Jun 2019 14:53:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+MFyANsOfT2/dVaaB+yS4Zlbz3DsUe/iLn0n5jQfuhY=; b=c/+iPmc5OhjPBTC8fIGFRCsAv5tx4rbBrYosMDKZ8NdpwyG6jN+XuJWOsYqj/42nGI Fh9xT4wddK2o/2Z7qvXDX7pK1gLyHS5w7cmoEQGTCpDn40F4WkrLdMrKGI/EYYU4UmiN UJxeW6HmsjKDp99T3/4JaO4r86yGjtdQAsEK8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+MFyANsOfT2/dVaaB+yS4Zlbz3DsUe/iLn0n5jQfuhY=; b=uTLxaACKfcvFd+x1r1KxfSszHwt3VpcWp5EodkAu3kjgbVsNCE9TwwaR958LYxlM7E 0zCcqzMzmY9lbtCXH8N8zIDn1lufe8ZGG9tDespTm2NL2itHHTTtEr+0OWfaERT4Vl2m smps0ve+ItGzKKeEEBoaqxD7Pp3krF1zgPEVe4HFyMtd6Y2L0B/J+egJO03CJPalY1LU MYZTWOJ5dzYKNld61bHBKosdh468/Od0h15sb9yT+kCrWlzhaGDRFMrSXOPDRFlgmMYT i1NVMDu7tXIZOrPPkR0IBRIkqc/ZhTrnADr2bAsQvaNaEizTD9ar8Az+hFYVX4jhaGpp Mp6w== X-Gm-Message-State: APjAAAWrRjYIPd1EkSHGPdunxZNNqmiOIqV50Pw2agBztejupZ1qxq9z xukipE2XLLTlqLnfPP44O31R0A== X-Google-Smtp-Source: APXvYqxvQbbOCGSd5hhFsnMM4rfLypzKXLxd+LF3XfEkwiqqQQIsrXgSBq3EtDBtpnneODuE0ChWPg== X-Received: by 2002:a24:4a13:: with SMTP id k19mr28902699itb.5.1559771633929; Wed, 05 Jun 2019 14:53:53 -0700 (PDT) Received: from shuah-t480s.internal (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id e127sm37484ite.33.2019.06.05.14.53.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jun 2019 14:53:53 -0700 (PDT) From: Shuah Khan To: mchehab@kernel.org, hverkuil-cisco@xs4all.nl, sakari.ailus@linux.intel.com, niklas.soderlund+renesas@ragnatech.se, ezequiel@collabora.com, paul.kocialkowski@bootlin.com Cc: Shuah Khan , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] media: v4l2-core: Shifting signed 32-bit value by 31 bits error Date: Wed, 5 Jun 2019 15:53:47 -0600 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 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 Fix the following cppcheck error: Checking drivers/media/v4l2-core/v4l2-ioctl.c ... [drivers/media/v4l2-core/v4l2-ioctl.c:1370]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour Signed-off-by: Shuah Khan --- drivers/media/v4l2-core/v4l2-ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 6859bdac86fe..333e387bafeb 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1364,7 +1364,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) (char)((fmt->pixelformat >> 8) & 0x7f), (char)((fmt->pixelformat >> 16) & 0x7f), (char)((fmt->pixelformat >> 24) & 0x7f), - (fmt->pixelformat & (1 << 31)) ? "-BE" : ""); + (fmt->pixelformat & BIT(31)) ? "-BE" : ""); break; } } From patchwork Wed Jun 5 21:53:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 10977941 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 013E413AD for ; Wed, 5 Jun 2019 21:54:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7EA628880 for ; Wed, 5 Jun 2019 21:54:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC46E28AA7; Wed, 5 Jun 2019 21:54:04 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham 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 92BF128AA2 for ; Wed, 5 Jun 2019 21:54:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726754AbfFEVyD (ORCPT ); Wed, 5 Jun 2019 17:54:03 -0400 Received: from mail-it1-f196.google.com ([209.85.166.196]:36274 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726757AbfFEVx4 (ORCPT ); Wed, 5 Jun 2019 17:53:56 -0400 Received: by mail-it1-f196.google.com with SMTP id r135so2961ith.1 for ; Wed, 05 Jun 2019 14:53:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9I2SsjTdzTZEHUxAqiggwpUY+KXh/NOOkKtPa/yMzz0=; b=Co8iNK2a9A1fNqnfONf4EZtCkxCEMeflTY2RgMj5UAeX9iBMblNROUhk/7PG5sexsy nzG8Fv98QGykA6+rriBwqbVy0rVOOi2ziZ4kvB/jgrCQYuBIWbfiynEYLodGKBM3FuJM PlZIpqTQTTlpQ5Fnt2KEEwU8Sawk5YWXX4AcU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9I2SsjTdzTZEHUxAqiggwpUY+KXh/NOOkKtPa/yMzz0=; b=CJI8cASYFTYQy/qsbrT0dTyB8bHZB1NCUaC1dUFCuxYTeWQ5gBuJljUhvWs7AntkNN tcmFc8XPiL5oVhjhiLspEoPtSdXIjQO9HH4nhr8GTCGLwIPRAqTlyJwrZ7WVGMeEU5+L rbA0K3xY+MQpg+QCE3N9wMuIjH79177NNDm5ajL4j3nJkdE+1hAG13J5LgWYINf/Ucfe yU1RDf5ZWK1BClns6PPuZ5HqOW8vZuSAdo3pqyghMXxxBiBpe5HoCPw9T2sqt3luolRm t15J1z/HoynCCInPn3fNkJbMT4yHMAg6/x5JvBThihj6M66C2PhcIRRBz8NGLnje/krK n0Yw== X-Gm-Message-State: APjAAAWDEE+yJc9Lv7kJAZTOUJBsZI0X3GkVMrA7T0x46ODVay8OOaBi q1Y+gyvzs/y/eGcjsb0tRpNMPA== X-Google-Smtp-Source: APXvYqwo7/OmYdJk0f03BI8THXymBnnjXZ7LNUkEWfH3fKkYbTpt+yceqV3Fqxxri7hGr//wJpjDVw== X-Received: by 2002:a02:aa0d:: with SMTP id r13mr22403757jam.129.1559771635752; Wed, 05 Jun 2019 14:53:55 -0700 (PDT) Received: from shuah-t480s.internal (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id e127sm37484ite.33.2019.06.05.14.53.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jun 2019 14:53:55 -0700 (PDT) From: Shuah Khan To: mchehab@kernel.org, hverkuil-cisco@xs4all.nl, sakari.ailus@linux.intel.com, niklas.soderlund+renesas@ragnatech.se, ezequiel@collabora.com, paul.kocialkowski@bootlin.com Cc: Shuah Khan , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] media: v4l2-core: fix uninitialized variable error Date: Wed, 5 Jun 2019 15:53:48 -0600 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 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 Fix the following cppcheck error: Checking drivers/media/v4l2-core/v4l2-ioctl.c ... Checking drivers/media/v4l2-core/v4l2-ioctl.c: CONFIG_VIDEO_ADV_DEBUG... [drivers/media/v4l2-core/v4l2-ioctl.c:2470]: (error) Uninitialized variable: sd Signed-off-by: Shuah Khan --- drivers/media/v4l2-core/v4l2-ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 333e387bafeb..205addb949ce 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -2445,7 +2445,7 @@ static int v4l_dbg_g_chip_info(const struct v4l2_ioctl_ops *ops, #ifdef CONFIG_VIDEO_ADV_DEBUG struct video_device *vfd = video_devdata(file); struct v4l2_dbg_chip_info *p = arg; - struct v4l2_subdev *sd; + struct v4l2_subdev *sd = NULL; int idx = 0; switch (p->match.type) {