Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp1482149rwi; Mon, 31 Oct 2022 17:36:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5COPZPzrIBfqvcBofdELWyxLTiZuBgkF+S2iaz0BEq3KLOclLh+dugWhVcOxhB+VFcLQoL X-Received: by 2002:a17:90a:6909:b0:212:f535:a34b with SMTP id r9-20020a17090a690900b00212f535a34bmr18034746pjj.6.1667262993368; Mon, 31 Oct 2022 17:36:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667262993; cv=none; d=google.com; s=arc-20160816; b=bJKORDKVnEMSNV4476ln0EibPDKB+6MEewIW+KpOkLdCl/nlytBjQxqeyHZbhNp9T1 wVgDQPi2H986KLjnhmtEVfkiCN0/2ppwupXDUwtS4yB23RPaZFpHxpyK8rhbq/K0un1i UWoPSLhmIrwXDAZgClvS3wvg8V8seE6MsDnTJBXQtAGMrIe8QtJwETr3kNraw6LUeTac SyRf9uyw0hjOtnvbThXaJq5ubo2N3jXqnH5VCSgCJy701LuM51sxlkcfv1jf+a183z4T 9nPJaLNLfDn3lDhTpg1eZHMw5KM4Qp7nK37tyUdRCX+SgWufIfgT0nfEw9vW2CZObx6F yJlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=+exwCng/IdD1MhFa/UI62X8vLjy6a/cFPmc8Y4Cwpo4=; b=ahpxLwdac37KlGdznm4aWtwJ1mCVCBoyHc6jtc7q4IfxA4i8rE5naawMshkYnYY3po apfQpqQg0FiDpWW0yEeqKpXAgT1qJo/HxncDhtRCp/mbP1ydb8Ofl8Q0hJltLYZZjD15 Pc6Yq+OjEEeNCGmitVaC6/wp/NvnM+URuORmCB4XeKamOmZBNbscOjNvWNBLcicBfrHL aUluYqKs+2lbUgOnJNqpy7mx5U8r20wIF/F9UwFxkuhzld3kXwxfgZbnE2xZzsXcqC+t ZYLNZZ3KkBkN2H50mi68zd3R574jR2g5W/HSMoKMRNblf72YUgV36hr/pNPiQ3+V16Qd qKbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZX7Wbo7q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 9-20020a630f49000000b0046f72960502si11046455pgp.420.2022.10.31.17.36.16; Mon, 31 Oct 2022 17:36:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZX7Wbo7q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229757AbiKAAYf (ORCPT + 98 others); Mon, 31 Oct 2022 20:24:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbiKAAYc (ORCPT ); Mon, 31 Oct 2022 20:24:32 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7B99B57 for ; Mon, 31 Oct 2022 17:24:31 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id be13so21652381lfb.4 for ; Mon, 31 Oct 2022 17:24:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=+exwCng/IdD1MhFa/UI62X8vLjy6a/cFPmc8Y4Cwpo4=; b=ZX7Wbo7qBX7YrGpC53w7yJrjIeHSz5R/Q0JB3s0DrLXFyyMcsZWhvz9kxFc1fTRGVX 1UNr/sAcfCjkOTxQqFPG/oDt1/Pl70qKWKlHCTtVW0MZidYgelZ/Oc1L57iM1xmpUJlD Wt1smVGbaTFzvNMbZDEzWTKzMpx0fGzb5MHujwCEi1k5ZLafxxEj11bmqfMwKjvGluMq YGeeVufSU21qY5TptNFTLgAwTW8kw5VJuuR6Qe3uh1tqpzRxxUtqL4HatzNxeZEEsP9N LVzPIaCqLPro4g7RHObvDLerXGEnAMbi3OBBu1Q2l1ltFMkyDwtFDo/MSwAoaOWqiUOT yi4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+exwCng/IdD1MhFa/UI62X8vLjy6a/cFPmc8Y4Cwpo4=; b=jMQ0DDSFlOiYy30Ra6SpwpZscyvcuf4v9HzLgBUzrY9IOKzUK6Cat2ENN56GZ9znsC q+Xz3BcpAHdYbQmU0WKucbucr2EjbuZ7ywdsPEoLf39Yfz8w60NX2/mG2aPI6j/sZifP hlLmXTKK0KGYaMd8G+O8JsCrayuh8Y0PwJHcCSir8/PavAvZVPlSa5/SzngpByaXaBi8 drEAvE2/ZqYGdQBDZ0DJxIa5RMOxFF1JHk8dhXdgc/UkgeNLmgKlTkSt6t4x7PZSve4k nBLWIMHNV+EVUGir/vQuVMC6qSsy0ioSSPiVv+WEdcbq5KeMfTbprTBcVSPXG5IXMn10 G9KQ== X-Gm-Message-State: ACrzQf1YMxas/AaYHSmZNEn/BaDcHcnrOJbCoGOdAgwRJ5iedpJXmUqo I8ozFLHhG/DGoTR3zZJY1IzaWw== X-Received: by 2002:a05:6512:2314:b0:4a2:6c4a:4fb9 with SMTP id o20-20020a056512231400b004a26c4a4fb9mr6853631lfu.482.1667262270310; Mon, 31 Oct 2022 17:24:30 -0700 (PDT) Received: from [10.10.15.130] ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id d2-20020ac244c2000000b004a27d2ea029sm1472345lfm.172.2022.10.31.17.24.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 Oct 2022 17:24:29 -0700 (PDT) Message-ID: <1c735bcc-d4f7-333f-58a5-e3f463bab10d@linaro.org> Date: Tue, 1 Nov 2022 03:24:29 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH] drm/msm: Fix return type of mdp4_lvds_connector_mode_valid Content-Language: en-GB To: Nathan Chancellor , Nathan Huckleberry Cc: Dan Carpenter , llvm@lists.linux.dev, Rob Clark , Abhinav Kumar , Sean Paul , David Airlie , Daniel Vetter , Nick Desaulniers , Tom Rix , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20220913205551.155128-1-nhuck@google.com> From: Dmitry Baryshkov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/11/2022 01:10, Nathan Chancellor wrote: > On Tue, Sep 13, 2022 at 01:55:48PM -0700, Nathan Huckleberry wrote: >> The mode_valid field in drm_connector_helper_funcs is expected to be of >> type: >> enum drm_mode_status (* mode_valid) (struct drm_connector *connector, >> struct drm_display_mode *mode); >> >> The mismatched return type breaks forward edge kCFI since the underlying >> function definition does not match the function hook definition. >> >> The return type of mdp4_lvds_connector_mode_valid should be changed from >> int to enum drm_mode_status. >> >> Reported-by: Dan Carpenter >> Link: https://github.com/ClangBuiltLinux/linux/issues/1703 >> Cc: llvm@lists.linux.dev >> Signed-off-by: Nathan Huckleberry >> --- >> drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c >> index 7288041dd86a..7444b75c4215 100644 >> --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c >> +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c >> @@ -56,8 +56,9 @@ static int mdp4_lvds_connector_get_modes(struct drm_connector *connector) >> return ret; >> } >> >> -static int mdp4_lvds_connector_mode_valid(struct drm_connector *connector, >> - struct drm_display_mode *mode) >> +static enum drm_mode_status >> +mdp4_lvds_connector_mode_valid(struct drm_connector *connector, >> + struct drm_display_mode *mode) >> { >> struct mdp4_lvds_connector *mdp4_lvds_connector = >> to_mdp4_lvds_connector(connector); >> -- >> 2.37.2.789.g6183377224-goog >> >> > > Did this patch get lost somewhere? I do not see it picked up. It is > needed to avoid a new WIP warning from clang for catching these CFI > failures: > > drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c:89:16: error: incompatible function pointer types initializing 'enum drm_mode_status (*)(struct drm_connector *, struct drm_display_mode *)' with an expression of type 'int (struct drm_connector *, struct drm_display_mode *)' [-Werror,-Wincompatible-function-pointer-types-strict] > .mode_valid = mdp4_lvds_connector_mode_valid, > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 1 error generated. It will be picked into 6.1-rc and then propagate through the stable kernel updates. Anyway: Fixes: 3e87599b68e7 ("drm/msm/mdp4: add LVDS panel support") Reviewed-by: Dmitry Baryshkov -- With best wishes Dmitry