From patchwork Sat Aug 10 11:44:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Young X-Patchwork-Id: 11088531 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 D2D3314F7 for ; Sat, 10 Aug 2019 11:45:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C32B5209CE for ; Sat, 10 Aug 2019 11:45:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B718022A68; Sat, 10 Aug 2019 11:45:05 +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=-7.9 required=2.0 tests=BAYES_00,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 1F83522A68 for ; Sat, 10 Aug 2019 11:45:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726132AbfHJLpA (ORCPT ); Sat, 10 Aug 2019 07:45:00 -0400 Received: from gofer.mess.org ([88.97.38.141]:36489 "EHLO gofer.mess.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726094AbfHJLpA (ORCPT ); Sat, 10 Aug 2019 07:45:00 -0400 Received: by gofer.mess.org (Postfix, from userid 1000) id 9584F600AF; Sat, 10 Aug 2019 12:44:58 +0100 (BST) From: Sean Young To: linux-media@vger.kernel.org Subject: [PATCH 2/3] media: imon_raw: prevent "nonsensical timing event of duration 0" Date: Sat, 10 Aug 2019 12:44:57 +0100 Message-Id: <20190810114458.8883-2-sean@mess.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190810114458.8883-1-sean@mess.org> References: <20190810114458.8883-1-sean@mess.org> 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 Sometimes the device sends IR data which is all space, no pulses whatsoever. Add the end of this the driver will put the rc device into idle mode when it already is in idle mode. The following will be logged: rc rc0: nonsensical timing event of duration 0 rc rc0: two consecutive events of type space Signed-off-by: Sean Young --- drivers/media/rc/imon_raw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/rc/imon_raw.c b/drivers/media/rc/imon_raw.c index e6723993b466..d4aedcf76418 100644 --- a/drivers/media/rc/imon_raw.c +++ b/drivers/media/rc/imon_raw.c @@ -85,7 +85,7 @@ static void imon_ir_data(struct imon *imon) offset = bit; } while (offset > 0); - if (packet_no == 0x0a) { + if (packet_no == 0x0a && !imon->rcdev->idle) { ir_raw_event_set_idle(imon->rcdev, true); ir_raw_event_handle(imon->rcdev); }