Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1017166ybl; Wed, 29 Jan 2020 13:46:56 -0800 (PST) X-Google-Smtp-Source: APXvYqwneKjX1IgMwhyQ4f5axPRaHPZOwODUy1ICOZ1LI0g+1nyYSy9IyKqBkFU0e7SPBI1Ae/vy X-Received: by 2002:aca:1e0f:: with SMTP id m15mr771089oic.58.1580334416335; Wed, 29 Jan 2020 13:46:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580334416; cv=none; d=google.com; s=arc-20160816; b=wURaEzuAwQ292orVE1kShrgKv+3cO21b3JXOG6cH3fHnrPq0gIelAALEJpsM3Smdlv PxLgWUYAJJiX29Lsf7+1RuFKX8z6RAqFddf5kOod2b+l5bBXUrakfmbiHUoc0EIhkRIj aODKHx7KuqFi6ykKXV/9WPDKIt7fFZsr18Hk8GfLLXdQ0OVuMXQZ+XznAk/MX4QSslBZ g5SPzlYxL89nn6t6lUzRA8YvKQ9NQp9s7jOCuCA3LOCIRL38joKJARCx++S+h2jYHlGX nnvNaGqp0+eZX3FLH5viVF7hwbOVp9l2uZDjQtWsFYAJ+p3md248llMokCGIDl3qaBxy WtKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=nclDQAc57fGVBDFTZcvntg/YEiVwsYbbmEE1VCKKHLg=; b=AqZLSEowSw5sqn9WWlCgpVLnYHCALbrz3A8bFJahx7y7PQIiWno6gVAAYBF5hU69HD hbXYEtoS04YdT5LuICcQL00014HaF0e0HNZGjB1q/f7SJcz+Yu5xygN0dnQPy2eDXFu4 hDOeOZxIdo9Y+XTjAP3DSXeTtJkJIIyBK5xHEtw0R0l81dUnt9tgTzVkTT9GMeVkzqdb O8hoNUAMYmi+vQT2iIYfgPoMLhAht2vGA6e2lOj8DKZM5fPiS2ABf82NY4KEq8GvCCo6 aoMVmUF9fG06B6xPaFtmmCE4j//5BTPnpSYdR4qnt4EJgHg5Z6eUGcNwqDEadl7AJe21 Jh9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ZwMaTKzu; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l5si1817197otn.35.2020.01.29.13.46.38; Wed, 29 Jan 2020 13:46:56 -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=@google.com header.s=20161025 header.b=ZwMaTKzu; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726558AbgA2Vph (ORCPT + 99 others); Wed, 29 Jan 2020 16:45:37 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:42449 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726283AbgA2Vpg (ORCPT ); Wed, 29 Jan 2020 16:45:36 -0500 Received: by mail-pg1-f196.google.com with SMTP id s64so475567pgb.9 for ; Wed, 29 Jan 2020 13:45:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nclDQAc57fGVBDFTZcvntg/YEiVwsYbbmEE1VCKKHLg=; b=ZwMaTKzujzRvsoOYh4RoVaxZqJcaDKslwpdjnDms9u/KmNgAXwun1IqcFfAiO+gq1i mX9dIMgPRPLi/SsGh4rboYXE+P83RWPLszMjStuactkkeBOxADTViB237qKrw+zH1LqX ZwMJmGfgoTt1OXiQeWv1VcSSYlMYwCe9Ds5Un6Bl1gJzcZtXxnSR6twaVUzw9PBYsjKR J0Ptii7KP0h/aELgFOoCRE2Q/JOsK/obCwC3hOMvL7yGNDRrJKqSN4V2JaTAENG4/XKM jCta6txXwdOK1SaPsone8HpNOVpOj3cEL9sOPK7fXVejm+MnK1sACZmkS7sIDqOAR3O5 Ec5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nclDQAc57fGVBDFTZcvntg/YEiVwsYbbmEE1VCKKHLg=; b=XEbbD+uTD0FALVfBR6nPOU1Py9LQqJBdpNW1+ni49rDLm4/ptVXqey40/XES6z4sBv c+v25Rry6/dH5ZM2kGIY6lxuzq714Ad5G8dDP5OdR9LGh9O1GyuSlwfyRrCb+lvlpZlS 1k2tTcyE3rbMkHbYDS54vHtG4mEjqIVvrHdGCnCnIaYQFOby/TPW63jmMi8JH5f7bFaS k+I/lgPmltMYV4WwHNtZDODKjJEa2Ekm5BadVa2RCnhG5iRDvztvZMC0HPYpx6zudZ85 7rqo2Y7VcOXn5TGxPEDIh6zUVKBTkJbcmvE1keK7TBclAJabHzd9gT8Ylk3hrj8C5w1i dOiQ== X-Gm-Message-State: APjAAAXKosYnf1D5ZwMWRePXbMp9SysF4On/ilLKIwM/3eEfGtcI8EWe Sig7tpxZ3+zmaN+gmyNye/eaAlDsVCcAouHhwftxLdER0M4= X-Received: by 2002:a62:38c9:: with SMTP id f192mr1625175pfa.165.1580334334643; Wed, 29 Jan 2020 13:45:34 -0800 (PST) MIME-Version: 1.0 References: <20200129201244.65261-1-john.stultz@linaro.org> In-Reply-To: <20200129201244.65261-1-john.stultz@linaro.org> From: Nick Desaulniers Date: Wed, 29 Jan 2020 13:45:23 -0800 Message-ID: Subject: Re: [PATCH] drm: msm: Fix return type of dsi_mgr_connector_mode_valid for kCFI To: John Stultz Cc: lkml , Rob Clark , Sean Paul , Sami Tolvanen , Todd Kjos , Alistair Delva , Amit Pundir , Sumit Semwal , freedreno@lists.freedesktop.org, clang-built-linux Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 29, 2020 at 12:12 PM John Stultz wrote: > > I was hitting kCFI crashes when building with clang, and after > some digging finally narrowed it down to the > dsi_mgr_connector_mode_valid() function being implemented as > returning an int, instead of an enum drm_mode_status. > > This patch fixes it, and appeases the opaque word of the kCFI > gods (seriously, clang inlining everything makes the kCFI > backtraces only really rough estimates of where things went > wrong). > > Thanks as always to Sami for his help narrowing this down. > > Cc: Rob Clark > Cc: Sean Paul > Cc: Sami Tolvanen > Cc: Todd Kjos > Cc: Alistair Delva > Cc: Amit Pundir > Cc: Sumit Semwal > Cc: freedreno@lists.freedesktop.org > Cc: clang-built-linux@googlegroups.com > Signed-off-by: John Stultz John, thanks for fixing this. Our inliner is a point of pride (inlining indirect function calls; you're welcome). ;) Indeed, the function pointer member `mode_valid` in `struct drm_connector_helper_funcs` in include/drm/drm_modeset_helper_vtables.h returns an `enum drm_mode_status`. Reviewed-by: Nick Desaulniers > --- > drivers/gpu/drm/msm/dsi/dsi_manager.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c > index 271aa7bbca925..355a60b4a536f 100644 > --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c > +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c > @@ -336,7 +336,7 @@ static int dsi_mgr_connector_get_modes(struct drm_connector *connector) > return num; > } > > -static int dsi_mgr_connector_mode_valid(struct drm_connector *connector, > +static enum drm_mode_status dsi_mgr_connector_mode_valid(struct drm_connector *connector, > struct drm_display_mode *mode) > { > int id = dsi_mgr_connector_get_id(connector); > -- -- Thanks, ~Nick Desaulniers