Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13369137ybl; Sun, 29 Dec 2019 10:14:46 -0800 (PST) X-Google-Smtp-Source: APXvYqw82GsP8nROQcpCjE3kfyiBqjIwOwk5ApMUtcn+EUPknN9G0jhlmPKw6auIWZz4ORVR4VL5 X-Received: by 2002:a05:6830:1353:: with SMTP id r19mr70979268otq.288.1577643286643; Sun, 29 Dec 2019 10:14:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577643286; cv=none; d=google.com; s=arc-20160816; b=h7Eu3aHy8aYmsoxWBnQ+UlWnE2KJD9heD6icm6kjyKo7ZHzlCCMUF5IWZoJ6X87Cyu Hdhe7W+yNHURPVtBTu0fsX55TVSVNdp+XrrM+cEQqicBpYKG5a05O8a0gVNZdPnW2ays 8gFLRm8YrnTXFQT70ClRRsBH/FPnUHDx3B70ogTnVMc2ZYdi2BGFpy9HrCM2tiRGrPH4 +nba1clNhYiCKkpSMO36nb0eJ+u796hUQRIS4RpMUPmnOdrzVJsDoWaOE2318tWPMaQD 6zaAjph0tCs7+lUdVLcV5oyu0gOhQSzSVFrtxDaWEuYzua9pl8cIf4ZCjgX0M1ai0rbS RqGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ROhnAj4qR5e/SQ7iIDv1wNqbKCAd8wCl+3yWLUP7JvA=; b=QmoIln2bn6RdY8GMhrVdjaRnSyHoXIYnmLhvyUK21WncRJ6/JuWMeDV+Ctbn1rI7av ud3QB3K/v5FINSJiUuAle/hjVYM5VQ4lpdC2wplk5nrl8DimaOSn3zjlGjKWMEEabKXh bfpIVpG6SerzSEpp58jhpCtQ8xMbpWYhioC5c+z6zquAh2a8656ZLBq6Dfg1+JMmxvDd AiWM0wt0gQ2DHK9ZL78f7aSAZAa+iewKyJsRgKVI4Stgqt8FLt72JOUAoRDCGyETYFMd UnUBRDThMj01SY+HYxn38saeJC3y0b+KkrE3xnMCIO4rOo8it4pLIZxdnpatnUQrdpuY NLEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RYBD0G1c; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v3si2684661oth.104.2019.12.29.10.14.34; Sun, 29 Dec 2019 10:14:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RYBD0G1c; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730563AbfL2SMg (ORCPT + 99 others); Sun, 29 Dec 2019 13:12:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:54708 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728804AbfL2R3o (ORCPT ); Sun, 29 Dec 2019 12:29:44 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2174C20409; Sun, 29 Dec 2019 17:29:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640583; bh=JQavVVK4m8ATRA49WjZPbeYlVPVpntoS23ebp+Y/E8c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RYBD0G1cwZ0s7XmaKmtxtozNePCwPS9SJyTTk2p7Fx5MpNoouc+hwh810v0lDY1tk hDlyOsh/1sBnK1eEWVIdwLEzTU5fSY47LEwRNpFUHmRv7UzHVd8ypja+r3hstqI3JE ZUfHx9Mzya7IztLEAK3EkMaA6EvLELwAPzv9T1tM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.19 056/219] media: cec-funcs.h: add status_req checks Date: Sun, 29 Dec 2019 18:17:38 +0100 Message-Id: <20191229162515.579611996@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162508.458551679@linuxfoundation.org> References: <20191229162508.458551679@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans Verkuil [ Upstream commit 9b211f9c5a0b67afc435b86f75d78273b97db1c5 ] The CEC_MSG_GIVE_DECK_STATUS and CEC_MSG_GIVE_TUNER_DEVICE_STATUS commands both have a status_req argument: ON, OFF, ONCE. If ON or ONCE, then the follower will reply with a STATUS message. Either once or whenever the status changes (status_req == ON). If status_req == OFF, then it will stop sending continuous status updates, but the follower will *not* send a STATUS message in that case. This means that if status_req == OFF, then msg->reply should be 0 as well since no reply is expected in that case. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- include/uapi/linux/cec-funcs.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/cec-funcs.h b/include/uapi/linux/cec-funcs.h index 8997d5068c08..4511b85c84df 100644 --- a/include/uapi/linux/cec-funcs.h +++ b/include/uapi/linux/cec-funcs.h @@ -923,7 +923,8 @@ static inline void cec_msg_give_deck_status(struct cec_msg *msg, msg->len = 3; msg->msg[1] = CEC_MSG_GIVE_DECK_STATUS; msg->msg[2] = status_req; - msg->reply = reply ? CEC_MSG_DECK_STATUS : 0; + msg->reply = (reply && status_req != CEC_OP_STATUS_REQ_OFF) ? + CEC_MSG_DECK_STATUS : 0; } static inline void cec_ops_give_deck_status(const struct cec_msg *msg, @@ -1027,7 +1028,8 @@ static inline void cec_msg_give_tuner_device_status(struct cec_msg *msg, msg->len = 3; msg->msg[1] = CEC_MSG_GIVE_TUNER_DEVICE_STATUS; msg->msg[2] = status_req; - msg->reply = reply ? CEC_MSG_TUNER_DEVICE_STATUS : 0; + msg->reply = (reply && status_req != CEC_OP_STATUS_REQ_OFF) ? + CEC_MSG_TUNER_DEVICE_STATUS : 0; } static inline void cec_ops_give_tuner_device_status(const struct cec_msg *msg, -- 2.20.1