From patchwork Tue Oct 23 08:47:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas THERY X-Patchwork-Id: 1629471 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 68B9F3FCF7 for ; Tue, 23 Oct 2012 08:47:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756798Ab2JWIro (ORCPT ); Tue, 23 Oct 2012 04:47:44 -0400 Received: from eu1sys200aog113.obsmtp.com ([207.126.144.135]:59477 "EHLO eu1sys200aog113.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754227Ab2JWIrn convert rfc822-to-8bit (ORCPT ); Tue, 23 Oct 2012 04:47:43 -0400 Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob113.postini.com ([207.126.147.11]) with SMTP ID DSNKUIZZq6Joqf2XTgMC5qazkngst09pQ4c9@postini.com; Tue, 23 Oct 2012 08:47:43 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E1D05139; Tue, 23 Oct 2012 08:47:22 +0000 (GMT) Received: from Webmail-eu.st.com (safex1hubcas4.st.com [10.75.90.69]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9455F26D1; Tue, 23 Oct 2012 08:47:22 +0000 (GMT) Received: from SAFEX1MAIL2.st.com ([10.75.90.4]) by Safex1hubcas4.st.com ([10.75.90.69]) with mapi; Tue, 23 Oct 2012 10:47:22 +0200 From: Nicolas THERY To: "linux-media@vger.kernel.org" Cc: "pawel@osciak.com" , "hans.verkuil@cisco.com" , "s.hauer@pengutronix.de" Illegal-Object: Syntax error in Cc: address found on vger.kernel.org: Cc: "pawel@osciak.com" ^-illegal end of route address, missing end of address Date: Tue, 23 Oct 2012 10:47:19 +0200 Subject: [PATCH TRIVIAL for 3.7] mem2mem: replace BUG_ON with WARN_ON Thread-Topic: [PATCH TRIVIAL for 3.7] mem2mem: replace BUG_ON with WARN_ON Thread-Index: Ac2w+wPWFpX9Rv8LSby3QtBnqrdpkw== Message-ID: <50865997.7050401@st.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 acceptlanguage: en-US MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org See following thread for rationale: http://www.spinics.net/lists/linux-media/msg52462.html Tested by compilation only. Signed-off-by: Nicolas Thery --- drivers/media/v4l2-core/v4l2-mem2mem.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 1.7.11.3 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c index 3ac8358..017fed8 100644 --- a/drivers/media/v4l2-core/v4l2-mem2mem.c +++ b/drivers/media/v4l2-core/v4l2-mem2mem.c @@ -510,12 +510,10 @@ struct v4l2_m2m_dev *v4l2_m2m_init(struct v4l2_m2m_ops *m2m_ops) { struct v4l2_m2m_dev *m2m_dev; - if (!m2m_ops) + if (!m2m_ops || WARN_ON(!m2m_ops->device_run) || + WARN_ON(!m2m_ops->job_abort)) return ERR_PTR(-EINVAL); - BUG_ON(!m2m_ops->device_run); - BUG_ON(!m2m_ops->job_abort); - m2m_dev = kzalloc(sizeof *m2m_dev, GFP_KERNEL); if (!m2m_dev) return ERR_PTR(-ENOMEM);