From patchwork Tue Aug 1 11:53:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 9874331 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 52D8D6037D for ; Tue, 1 Aug 2017 11:53:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EBE3286A3 for ; Tue, 1 Aug 2017 11:53:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3382B286A7; Tue, 1 Aug 2017 11:53:40 +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=-6.9 required=2.0 tests=BAYES_00,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 2CAC1286A3 for ; Tue, 1 Aug 2017 11:53:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751794AbdHALxh (ORCPT ); Tue, 1 Aug 2017 07:53:37 -0400 Received: from lb2-smtp-cloud9.xs4all.net ([194.109.24.26]:55788 "EHLO lb2-smtp-cloud9.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751612AbdHALxg (ORCPT ); Tue, 1 Aug 2017 07:53:36 -0400 Received: from [IPv6:2001:420:44c1:2579:f5a7:d408:62fc:a021] ([IPv6:2001:420:44c1:2579:f5a7:d408:62fc:a021]) by smtp-cloud9.xs4all.net with ESMTPA id cVjvdnmkKFVBQcVjzdq2WI; Tue, 01 Aug 2017 13:53:35 +0200 To: Linux Media Mailing List From: Hans Verkuil Subject: [PATCH] cec-funcs.h: cec_ops_report_features: set *dev_features to NULL Message-ID: <00e6e778-b475-3281-6b21-028a251d16c5@xs4all.nl> Date: Tue, 1 Aug 2017 13:53:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Content-Language: en-US X-CMAE-Envelope: MS4wfGSvgjPEPBNTBbM8rN5d1oFx9A/jGQgm6Jbu2Eq3VqK5C82uIZAXMOkpL9MfA9x4lQLnMMNlsOpRHk+kyCrJOPyD+BIItcasfjv7T8iKW68fO81ILqNZ NXYgVusr5StfenxwLAJ8IE7od+qyPSJVSDNB8UDWXm8a4S+1R7OKD6XbxyaB8+Ked59wmNi+aoxUxjVbPzz2S6ZEOLojCkLXBt58S5zQqNzT5dJHkpY7ivPw ehROXQHKNQc2HyIx91v9EzT1J+5hi1eUpbQB1t20f9ZBDo6GTE3/Mgye6OR3/KCP 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 gcc can get confused by this code and it thinks dev_features can be returned uninitialized. So initialize to NULL at the beginning to shut up the warning. Signed-off-by: Hans Verkuil diff --git a/include/uapi/linux/cec-funcs.h b/include/uapi/linux/cec-funcs.h index c451eec42a83..270b251a3d9b 100644 --- a/include/uapi/linux/cec-funcs.h +++ b/include/uapi/linux/cec-funcs.h @@ -895,6 +895,7 @@ static inline void cec_ops_report_features(const struct cec_msg *msg, *cec_version = msg->msg[2]; *all_device_types = msg->msg[3]; *rc_profile = p; + *dev_features = NULL; while (p < &msg->msg[14] && (*p & CEC_OP_FEAT_EXT)) p++; if (!(*p & CEC_OP_FEAT_EXT)) {