From patchwork Sun Jul 7 18:07:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 11034179 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 DF77D13A4 for ; Sun, 7 Jul 2019 18:10:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCD9327B13 for ; Sun, 7 Jul 2019 18:10:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C03BA1FF28; Sun, 7 Jul 2019 18:10:51 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6F38D1FF28 for ; Sun, 7 Jul 2019 18:10:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CBF1B89A62; Sun, 7 Jul 2019 18:10:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by gabe.freedesktop.org (Postfix) with ESMTPS id CFBA489A62 for ; Sun, 7 Jul 2019 18:10:49 +0000 (UTC) Received: from pendragon.nordic-sky.finnair.com (unknown [38.98.37.142]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id AA71EAF9; Sun, 7 Jul 2019 20:10:29 +0200 (CEST) From: Laurent Pinchart To: dri-devel@lists.freedesktop.org Subject: [PATCH 02/60] video: hdmi: Change return type of hdmi_avi_infoframe_init() to void Date: Sun, 7 Jul 2019 21:07:54 +0300 Message-Id: <20190707180852.5512-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190707180852.5512-1-laurent.pinchart@ideasonboard.com> References: <20190707180852.5512-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1562523048; bh=VAKK6wbvtkp7nhf8qCFRCBNP67+c3koro8mAsB1+slE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vG/fpa3ADHeyQPXRlqOul6zrIP+fjHr1IS/3j7xCF1ICc1QnaeT/WY4N2Vw9FhhqA SNa4CnNHlN5abjWboh4v0aIlgX5BITBruuqJQnVcrkE1U+F5VVR81KRielVeMu7P7E ckTJD6DAjY9ehDOXpwmCix3gC/zWEwRA6YwuxHsQ= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxime Ripard , Sebastian Reichel , Tomi Valkeinen , Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The hdmi_avi_infoframe_init() never needs to return an error, change its return type to void. Signed-off-by: Laurent Pinchart Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/drm_edid.c | 5 +---- drivers/video/hdmi.c | 9 ++------- include/linux/hdmi.h | 2 +- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index d2e7a5334c3f..a7d3189ea8f3 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -5086,14 +5086,11 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, const struct drm_display_mode *mode) { enum hdmi_picture_aspect picture_aspect; - int err; if (!frame || !mode) return -EINVAL; - err = hdmi_avi_infoframe_init(frame); - if (err < 0) - return err; + hdmi_avi_infoframe_init(frame); if (mode->flags & DRM_MODE_FLAG_DBLCLK) frame->pixel_repeat = 1; diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c index b939bc28d886..54fb7cf11d1a 100644 --- a/drivers/video/hdmi.c +++ b/drivers/video/hdmi.c @@ -56,15 +56,13 @@ static void hdmi_infoframe_set_checksum(void *buffer, size_t size) * * Returns 0 on success or a negative error code on failure. */ -int hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame) +void hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame) { memset(frame, 0, sizeof(*frame)); frame->type = HDMI_INFOFRAME_TYPE_AVI; frame->version = 2; frame->length = HDMI_AVI_INFOFRAME_SIZE; - - return 0; } EXPORT_SYMBOL(hdmi_avi_infoframe_init); @@ -1553,7 +1551,6 @@ static int hdmi_avi_infoframe_unpack(struct hdmi_avi_infoframe *frame, const void *buffer, size_t size) { const u8 *ptr = buffer; - int ret; if (size < HDMI_INFOFRAME_SIZE(AVI)) return -EINVAL; @@ -1566,9 +1563,7 @@ static int hdmi_avi_infoframe_unpack(struct hdmi_avi_infoframe *frame, if (hdmi_infoframe_checksum(buffer, HDMI_INFOFRAME_SIZE(AVI)) != 0) return -EINVAL; - ret = hdmi_avi_infoframe_init(frame); - if (ret) - return ret; + hdmi_avi_infoframe_init(frame); ptr += HDMI_INFOFRAME_HEADER_SIZE; diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h index 9918a6c910c5..9613d796cfb1 100644 --- a/include/linux/hdmi.h +++ b/include/linux/hdmi.h @@ -207,7 +207,7 @@ struct hdmi_drm_infoframe { u16 max_fall; }; -int hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame); +void hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame); ssize_t hdmi_avi_infoframe_pack(struct hdmi_avi_infoframe *frame, void *buffer, size_t size); ssize_t hdmi_avi_infoframe_pack_only(const struct hdmi_avi_infoframe *frame,