Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13474173ybl; Sun, 29 Dec 2019 12:46:46 -0800 (PST) X-Google-Smtp-Source: APXvYqxF6xZHosyXgS5xp2MIAFQtZsApZONI9m8NP2TP9uu6vd/FSqlE3QH1M+VDYQYR+tgDjfNt X-Received: by 2002:a9d:6d10:: with SMTP id o16mr71968047otp.28.1577652406339; Sun, 29 Dec 2019 12:46:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577652406; cv=none; d=google.com; s=arc-20160816; b=IEBT0zNL4yy+QANpLgghONlWkEczK0q4jfzTRSNrpDxWFKE+cdc+ldjU4B3sBOWev3 E0Fj4JlSQNZNFwlKgsRSUczPxLD3pESvQPk4Payn611hLn9jMqRJzj0pKeHCDOG23WLn 2DIgawMVYfAC6Rb5yds8xyZGIWvmWkbWKfNGTwReMmTpTSGlzuafq93ZKlFrAh18LQE/ jk+uEp8y8Wumh2n5FRmk55soo7W6tKKsG3Bx9lB0c2qB6s8hmrLylar1mckdZ4FqL3wp O1ILkvdscjtnl2ydlVLI4D1zed2/9HUjEqRUvG1v7YUMpkfekFrjQWwO6dv5VPK7+m58 unsg== 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=bb2gvlb57BCphj7OeCE2dC2rw8/rq0nlQ48qJYvHYUOZCdUqI84cZSxvvqyUWJPFfh dH442zpxwKH5Lsvu8Ld/AV8T1s/KfBluSCmDCWSvVCyULtybySRH9PhNWDM5Q9zBzMY8 /V4poCcCKTGO3viOzvD+OgaJaVL0aii9UsVK8C9SwrlSSxnntE3nNaLwSS4ohy3gV1+9 IK/o1Z9oGmvdW6s66rF9ES9DN3dfKNv21dyIsHIphGmQz6SYPq2RXeNedcMdIWaDii8t rMBFWPQf2UNuhmmc0MBPr5EvB6CKJhl9RsHJ3Tu/Gtg0RgjMp9LfhjscWY7tVTtzDZMx ypuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CcLWT68g; 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 14si13734341oij.200.2019.12.29.12.46.34; Sun, 29 Dec 2019 12:46: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=CcLWT68g; 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 S1731237AbfL2RrR (ORCPT + 99 others); Sun, 29 Dec 2019 12:47:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:57646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731212AbfL2RrM (ORCPT ); Sun, 29 Dec 2019 12:47:12 -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 4A81220718; Sun, 29 Dec 2019 17:47:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641631; bh=JQavVVK4m8ATRA49WjZPbeYlVPVpntoS23ebp+Y/E8c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CcLWT68gJHp+Kt0EASKoaQ1bpCpOUKEuC9XvbMWUjt95i2q7jJ/9vjho0hWVPKs1U ZUndZCIKxap+tlP9DSAZ+091B8pr6rWwSCRDNdBhVigyjw1jSgzAImrY25ihJFWgd6 LY6Ot9k5+frb5iNvOj++BG+w+GIwLXM+px/BkIGg= 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 5.4 107/434] media: cec-funcs.h: add status_req checks Date: Sun, 29 Dec 2019 18:22:40 +0100 Message-Id: <20191229172708.732337880@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@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