Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4617039rwb; Mon, 21 Nov 2022 09:39:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf6K9U2vVZgDhyt4xcGOcJppyM6jpiocy+KjT+VuO2nLB8Z6YTKGjuwmnM4H3hY7q8Z8IxkO X-Received: by 2002:a17:906:19d6:b0:7ac:9917:c9c6 with SMTP id h22-20020a17090619d600b007ac9917c9c6mr16503353ejd.325.1669052362697; Mon, 21 Nov 2022 09:39:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669052362; cv=none; d=google.com; s=arc-20160816; b=aqBk2uyVn8NQFjV4OXstzYG+FmsEeiOdF49rdvnpMfXsDlpA+mj7jfIOz/GdDhszhG YWC/YqpCbyGPcvbsmr3mUMFWFb06cmJSHCITaEapt9cd4gb5fXL1a2E5JTU06JTsOR8B XbMwmdaFmy+dRnkjIZhfSeBtiOVXFzKOgYBKnehFsI1qT8PuxrjNDrhtVWZlRkf5QWa4 iTpFfupBz5FyUgAQbzg/3pkln38xhCpUufQrKmeTY6IuYzkkcNNA/Oriq0NjUZPuf3Vs dqN7n41JVbzNSxaE/iZKcvJgZG+zvnKmbP7gBb1I+DaJ2mpcXQpaIdXVRtcWe3gOe3e/ i0uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=gHlfylBzHyxuRrCu5Gd5N0EZtslgI+tXadFm3xqwgLc=; b=lJH6aUrbN6CRNxWWZTWB3TBMcwbwYhwKSpzxxzlzbCFRuGeAQzx5Bc6w6VXeRKoP1q ysiahPi2X+bIIjuVJyn+zHpwde8NcDuXUVIkd19vx8t8D1/pilR2d2L2vyPS3Firh4M/ VCdPpnpow4qsmNzMwKcG/VbHtA1Yd9hvMKflYPZN1tLOEfzKyj4G1AP4qFRs98FQFHS9 nF3JlLz8wzNjVf6qW7tJx224qjyKBF8lPPLBxqDZum+W4nUO7vPNg5AExAKdkZczOZdb VOolUZ7ujcDztjOS3dvnZXgQaEviA4JM18xbaBTvdKbH5QKOISyQLG+2puJSvZvxVuc7 gv/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GPa1o3Rc; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b20-20020aa7c914000000b004690be1cef0si7840261edt.84.2022.11.21.09.38.59; Mon, 21 Nov 2022 09:39:22 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=GPa1o3Rc; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230222AbiKURar (ORCPT + 91 others); Mon, 21 Nov 2022 12:30:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230161AbiKURan (ORCPT ); Mon, 21 Nov 2022 12:30:43 -0500 Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8388C6945 for ; Mon, 21 Nov 2022 09:30:42 -0800 (PST) Received: by mail-ot1-x329.google.com with SMTP id 46-20020a9d0631000000b00666823da25fso7784262otn.0 for ; Mon, 21 Nov 2022 09:30:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=gHlfylBzHyxuRrCu5Gd5N0EZtslgI+tXadFm3xqwgLc=; b=GPa1o3Rcj+50tQvouk5qo5D5tCBoi+/yWwLq65jVuXNFSgRxVVPLP5nqeVsdQ6xDAV P343mNaxvkG83iWOVgBFwhnPT2mbkyiX4Keu0Xb85YdPLz6NFSpL+FvzA0KimKXYvCpN LgO1cT6yHmo9sYb0cVAdj5ARFQvxgRKoZ8dDDdzQOCHxV1DPNSYMztGo7C/38hH1GLai ics8varwttrOva3oHYcAj+zFs7bXM7Zlesu7y+79wyUBE2e5Nw1Wj76kDTShCcNk1ySI CdS77P8pfZ+V5KynFG0wL7Qlu+XiwI9bXAzKKZccMGNG2QwFjx6j9Vj1EXDcJML7gobH 8esA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gHlfylBzHyxuRrCu5Gd5N0EZtslgI+tXadFm3xqwgLc=; b=vFkxRyWTUfQi2lK1XXkCDARVBdBgPVVe24ZBHwg9pS6BgOM8C9dPrgq/zivrpw3hRe 0n9DNebTgRFj0WSCn70J9GyWnjFBKZSYDNXL6Uvdna0lkJQn1ynvngEKERoVdrmdgdpg Mxe0cUE5XZ7ZnmYzdILC8oVqmAp6seVsQO+rFv4VziTATG9INd4VNXWwtzM6zcEABOh5 FyXIEGf3tkDNhXpZ2HVD4vJ0d7ZjuB9N8QwrmkbcaEPVLQNuVkp642KTBKC7uixdOia7 2GPYZaevvsEFNExpQBcAVh7ek90b2wMbpQOt4IhoEPkncic+u7gbv/cgKGlyd4dbcZub o7YA== X-Gm-Message-State: ANoB5pmyHGGuvtopnM6fgod4IF+HaMTXGEPlqEr4OMKQJpPAn9SSF77a k3AbIgGMrft8ZAuKKIHQ9dMNQw1rTn+hTkOq+l4= X-Received: by 2002:a9d:628b:0:b0:66c:6afa:5006 with SMTP id x11-20020a9d628b000000b0066c6afa5006mr3585319otk.233.1669051842247; Mon, 21 Nov 2022 09:30:42 -0800 (PST) MIME-Version: 1.0 References: <20221121130418.53267-1-renzhijie2@huawei.com> In-Reply-To: <20221121130418.53267-1-renzhijie2@huawei.com> From: Alex Deucher Date: Mon, 21 Nov 2022 12:30:30 -0500 Message-ID: Subject: Re: [PATCH] drm/amdgpu: fix unused-function error To: Ren Zhijie Cc: alexander.deucher@amd.com, christian.koenig@amd.com, airlied@gmail.com, daniel@ffwll.ch, yusongping@huawei.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, weiyongjun1@huawei.com, amd-gfx@lists.freedesktop.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, 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 Applied. Thanks! Alex On Mon, Nov 21, 2022 at 8:09 AM Ren Zhijie wrote: > > If CONFIG_DRM_AMDGPU=3Dy and CONFIG_DRM_AMD_DC is not set, > gcc complained about unused-function : > > drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:1705:13: error: =E2=80=98am= dgpu_discovery_set_sriov_display=E2=80=99 defined but not used [-Werror=3Du= nused-function] > static void amdgpu_discovery_set_sriov_display(struct amdgpu_device *ade= v) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > cc1: all warnings being treated as errors > > To fix this error, use CONFIG_DRM_AMD_DC to wrap > the definition of amdgpu_discovery_set_sriov_display(). > > Fixes: 25263da37693 ("drm/amdgpu: rework SR-IOV virtual display handling"= ) > Signed-off-by: Ren Zhijie > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/= drm/amd/amdgpu/amdgpu_discovery.c > index 6b48178455bc..2509341df92d 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c > @@ -1702,11 +1702,13 @@ static int amdgpu_discovery_set_smu_ip_blocks(str= uct amdgpu_device *adev) > return 0; > } > > +#if defined(CONFIG_DRM_AMD_DC) > static void amdgpu_discovery_set_sriov_display(struct amdgpu_device *ade= v) > { > amdgpu_device_set_sriov_virtual_display(adev); > amdgpu_device_ip_block_add(adev, &amdgpu_vkms_ip_block); > } > +#endif > > static int amdgpu_discovery_set_display_ip_blocks(struct amdgpu_device *= adev) > { > -- > 2.17.1 >