From patchwork Thu Sep 24 14:00:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 7256901 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id ECB199F32B for ; Thu, 24 Sep 2015 14:06:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 19910207A4 for ; Thu, 24 Sep 2015 14:06:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 27840207CE for ; Thu, 24 Sep 2015 14:06:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756649AbbIXOBn (ORCPT ); Thu, 24 Sep 2015 10:01:43 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:61498 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755891AbbIXOBN (ORCPT ); Thu, 24 Sep 2015 10:01:13 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NV6008IHPLZQ270@mailout4.w1.samsung.com>; Thu, 24 Sep 2015 15:01:11 +0100 (BST) X-AuditID: cbfec7f5-f794b6d000001495-c6-560402271f26 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id D9.D8.05269.72204065; Thu, 24 Sep 2015 15:01:11 +0100 (BST) Received: from AMDC1061.digital.local ([106.116.147.88]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NV600IK6PLM8670@eusync4.samsung.com>; Thu, 24 Sep 2015 15:01:11 +0100 (BST) From: Andrzej Hajda To: linux-kernel@vger.kernel.org Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , "Lad, Prabhakar" , Mauro Carvalho Chehab , linux-media@vger.kernel.org Subject: [PATCH 05/19] media: am437x-vpfe: fix handling platform_get_irq result Date: Thu, 24 Sep 2015 16:00:13 +0200 Message-id: <1443103227-25612-6-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1443103227-25612-1-git-send-email-a.hajda@samsung.com> References: <1443103227-25612-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphluLIzCtJLcpLzFFi42I5/e/4NV11JpYwgzl/TCxurTvHarFxxnpW i8u75rBZ9GzYymqx9shddovVzyosXt5fwezA7rFz1l12jy39QKJvyypGj8+b5AJYorhsUlJz MstSi/TtErgyHnS3shZ0cFUcv+vcwLido4uRk0NCwERiweTLTBC2mMSFe+vZQGwhgaWMEnea S7oYuYDsJiaJv9OesYAk2AQ0Jf5uvglWJCKgILG59xkriM0s0M8kceYBmC0s4C9xb/15ZhCb RUBV4sixS2C9vALOEhvXnmaHWCYncfLYZLB6TgEXibdTNzFBLHaWOHFkFtsERt4FjAyrGEVT S5MLipPSc430ihNzi0vz0vWS83M3MULC6OsOxqXHrA4xCnAwKvHwztRhDhNiTSwrrsw9xCjB wawkwsvxHijEm5JYWZValB9fVJqTWnyIUZqDRUmcd+au9yFCAumJJanZqakFqUUwWSYOTqkG RqO0JT975gbHvPnYXD215amQ3XGpS1nvI6LElqrfv7MspTzb+KWsitini8GnOPzfSPAb36wo Kj8mf8mTx/T3v73/LTffTH/Jp1iRIZ/M/+bJySnSR+fNWt/445T14vmTd23d/CSj6dj5lxPj 9swx+/jaWUB5roOVS0737rs9WzxDJ7gXmCqfPK3EUpyRaKjFXFScCAAT27pwHwIAAA== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The function can return negative value. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107 Signed-off-by: Andrzej Hajda --- Hi, To avoid problems with too many mail recipients I have sent whole patchset only to LKML. Anyway patches have no dependencies. Regards Andrzej --- drivers/media/platform/am437x/am437x-vpfe.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/am437x/am437x-vpfe.c b/drivers/media/platform/am437x/am437x-vpfe.c index c8447fa..c9cbb60 100644 --- a/drivers/media/platform/am437x/am437x-vpfe.c +++ b/drivers/media/platform/am437x/am437x-vpfe.c @@ -2546,11 +2546,12 @@ static int vpfe_probe(struct platform_device *pdev) if (IS_ERR(ccdc->ccdc_cfg.base_addr)) return PTR_ERR(ccdc->ccdc_cfg.base_addr); - vpfe->irq = platform_get_irq(pdev, 0); - if (vpfe->irq <= 0) { + ret = platform_get_irq(pdev, 0); + if (ret <= 0) { dev_err(&pdev->dev, "No IRQ resource\n"); return -ENODEV; } + vpfe->irq = ret; ret = devm_request_irq(vpfe->pdev, vpfe->irq, vpfe_isr, 0, "vpfe_capture0", vpfe);