Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13386438ybl; Sun, 29 Dec 2019 10:38:29 -0800 (PST) X-Google-Smtp-Source: APXvYqyE60XtS+186U4yWzmlzkB6NhnoBRm7f7laTa/ZFPOsjpcDaGkX1WTsKwx1bvWt4Nb7QeBg X-Received: by 2002:a9d:6e03:: with SMTP id e3mr54585937otr.46.1577644709228; Sun, 29 Dec 2019 10:38:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577644709; cv=none; d=google.com; s=arc-20160816; b=nKwD3SaV4AI30Nbjnh++eC5uWE0g4JnIH+TwL/7j9D61IDyW8rXd2hKQkQY/ii2RNe 7NEPhO3ZDnG8OrPv45zl5w0jnXKbbdSFHkd9Bod72/3lfBotuNBvJEhm/1br7KuTsN7+ eyXTXgZwASuIV3RfJfo/PyKHz8hD4m5v713m37iL2omHQPnigHIaKUZ/CIdlX00tfIJz GR8KDwNPXFqGwea6JR1GL/XQgu0bimjyC/2bYm7UA1aWpVnpVOw4ycFIhaGTzOx9Dinz jNSv7JfZBjkwQrVKHsKorE3JOpNU/NL3yE6p8tepCFsEl13eAlaoAgaht1OzWhXiLvO5 zV1Q== 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=5IgmGSnq1g+lqugNfyQMUGd5H66BYac6AOD4XbRJ5F8=; b=gS2VISF12R+ix+jKRcgg8SkkuIOQYKNa9wfjLabMeZ4z5eSi3JIfUq1ZD0hg76xPFd 5ZDzFb7efCHzvUfRXC0Ps3svKPCT3pwQpheoqyAKqT4Yza3C//HmC7tG/JhvZYl3yvFa HZ7jo+YLrqH7XBm59bJnHjf5ZTHYybfaOM6edOJd+B3NcumRJLaqVCby6UOmV/Vtciv/ V/oVbdBBnH1tA6XI5VFXrFsVSVlyqlKBigvUuBVgnKeT0H0fk9JeQs+F6ugzbq8ca48i byhxsRX+DBL0DYltTf/bikEKnoJRL5LiawcdGn9YULsg7GHFRHCFOg14FO+GH0E1UFC9 2e1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=paclyhDg; 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 r202si20088177oie.247.2019.12.29.10.38.17; Sun, 29 Dec 2019 10:38:29 -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=paclyhDg; 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 S1727406AbfL2RYT (ORCPT + 99 others); Sun, 29 Dec 2019 12:24:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:42764 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727695AbfL2RYQ (ORCPT ); Sun, 29 Dec 2019 12:24:16 -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 12DA6207FF; Sun, 29 Dec 2019 17:24:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640255; bh=D1wtFluasl5+UmyL4vX/pT5cQ3Sg6l/9xApuXsUflfk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=paclyhDgu47c99FU4iyHbNH/so94mGPuKkSD2z3IGFvZDLFWeN4f2BaVMIyB42Bqk 2gRh1fHIKhtJ387yYm7nedjWLy6gv8HPMpunQfFBos3IpHbjRpKM5ZT9Y9oWBYPwIr 8+5hoANaC3SOtzzbXKJe9ViJ2rxPiCqUiPC6PGYU= 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.14 044/161] media: cec-funcs.h: add status_req checks Date: Sun, 29 Dec 2019 18:18:12 +0100 Message-Id: <20191229162413.065474939@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162355.500086350@linuxfoundation.org> References: <20191229162355.500086350@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 28e8a2a86e16..2a114f7a24d4 100644 --- a/include/uapi/linux/cec-funcs.h +++ b/include/uapi/linux/cec-funcs.h @@ -952,7 +952,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, @@ -1056,7 +1057,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