Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp358078lqh; Sat, 4 May 2024 04:26:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUTjPR1MB1P47Z5VcW9fmFjdr1QkOuaKVFVcw3bV6YjxXOAzq+zCoJ7r4Cj0FhHzL0LxViZM0l0EKztLeI4QLV2IYXJtqZ7jfivCE01wg== X-Google-Smtp-Source: AGHT+IHsgxfNDWbRoxIKzcPKEQqkOvGJi+fAT1XZKEZNNo5rVkgaeTXZZkLq3UyQMDS9Et8YbaaK X-Received: by 2002:a05:620a:4625:b0:790:ac9e:ccfc with SMTP id br37-20020a05620a462500b00790ac9eccfcmr6804230qkb.49.1714821987351; Sat, 04 May 2024 04:26:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714821987; cv=pass; d=google.com; s=arc-20160816; b=Ce5O7LuifXtH1KIjqnNP84/dUQeG1xg3Scj6RzKNcrt1ViTu5qF8YUeLpHSmDPn1z5 Z2xey7152CHuL8wGmTbHJuSaB1Rm2kFgdbu+koY2MlYDb03a+eN16JJSF6P2UtMXEE69 4/0vzkkYQSSJgPXD+F8ZP0wQcBptOBQ10EbggjSz2bFqLte5bx9JkhaTNn09fhZn73sN 9aTtDTaEmTDbkIbz5J5UYAy6LXrs0EwEtDzAXCanVfH6xcMf6byeByWDkZz10LrH+yZ9 KuCZ1/23XSJ/czJeHuj/mx4TnG+WAtoAmZH6ORfJn4y4Mf3MZw4Kd5+ggoHIo20ZiRta fDJw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=acScVzoT0UgSxQf+NXyCSZ3pQCph88n8DycCWGq+e7Q=; fh=bFtGCbpyr/W64j3GgoAq9rrIAuIQs/o/ZKn3xF946Uk=; b=Ch2X2Z8QseO+Glnz2MeNSNZhiQY7AcoE/myhSDYQTOmJ2ngFjhirbyWm1IECJDXNc9 U7An25gv2LstCLWPnBLp54ySOVlaqQ6MJrZsNXQU0ojNskXsJuVBP06dASonCfz+n4HD 0+qV1Uaad255ChWAqiXU8Kzaew+ROKnXkm0WZc2zuPkHK02wCRqYBTqDVNqpTy3VhAZW 9jGmX8LrGBi1fbTTb87aoH346TpZHip3nhWEBvLf5e9+YlfTQ0AhMmpeJ7syTDWJ1Rkq rjFrGVHxcnXMz3NQamdV+rJYhGi2rgkaQ0F+BKKd5CcE0Huex7nLTyHMxdnTT0IOKjqs W3pQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u8tIGbUm; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-168603-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168603-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id pi26-20020a05620a379a00b00790636a4436si4821600qkn.374.2024.05.04.04.26.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 04:26:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168603-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u8tIGbUm; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-168603-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168603-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id F3A611C20F98 for ; Sat, 4 May 2024 11:26:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8941F1CD15; Sat, 4 May 2024 11:26:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="u8tIGbUm" Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C2F618C3D for ; Sat, 4 May 2024 11:26:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714821979; cv=none; b=RcpEMTfe47hCsAeebcfYvEeW5yPIXPc5EOcIY2UVS6311u8qA2AIozXat8u4ZU8fnpI7sa93AlroKLAfaoHs31lNWNSHOjaQOAEjGKmGY4H51D8wa/DwPo5TmyH7qUX8OjH9JahUFXdj8iwf7o125X8QwzSovkTJrbL4NbNUHVI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714821979; c=relaxed/simple; bh=q9hMV1BT9OJQ7HePS+PG9LFG1oZyrdoizmQncp9kOz8=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=klZL0h/8pWkC4Ifxbvw41ibUS0Fb0HV1kkW0JCYQcPqOdpDC/dBekf4y+9PO786HV4aMpGQcUhv6LUliGni1O2iSN/Nx3grb5hVCNkBNaUQ+HnGupzaLDxtKLx1+kM5GwgUUi+RpPZcyGka39PHIIrXHrJpeSBYgO05N/5NwBeQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=u8tIGbUm; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-34d0aa589a4so358780f8f.1 for ; Sat, 04 May 2024 04:26:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714821976; x=1715426776; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=acScVzoT0UgSxQf+NXyCSZ3pQCph88n8DycCWGq+e7Q=; b=u8tIGbUmyYcGQntLcsxP8rRqauFoGukkjBqCzpRqW9uRldZbIUV5I8z4Vw3Y1sOrm2 v/5KfgeKMXyeSr+KF6zRcAEfPPaWEJ98zJfPHs5Lb0Dz8GHuBLjinsgGQyjzlvfPAUQr eXO/wIe3RmpkS3vshAl1DswEtuuruCd6kmIema1I5HR8fYhNaqpraYsYh6i0y9E7/aU7 RPMcGGFvKVckpEjynT/KTuQXdM4JI3wPR4B/iidowQmfD5T6i814X1hxeS7nLVcK87pQ aQk8GqMVT1xMITFfppPUVR3Hch1JOAYh2Dq776UCQbOJj0Qim/Y7ywG7OO4HjLvDICkF kF2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714821976; x=1715426776; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=acScVzoT0UgSxQf+NXyCSZ3pQCph88n8DycCWGq+e7Q=; b=wN8xwdeEH2LSQ4UIPVPPDxuaR0bH2lTm9Ol9J4A+74bQFk3KUdUENJAQ27yORK1W9E xaU5nO1dE4yk3kgsIidDuPRznelG9I7VFovMRHL5F5+RwZXLHxt0NrqN87cxSqyavHVT 5o1+EkkNdSxxSAVMFFFbNSk4dddDPqUuuVPhRr7rUMbPV8ICVVIj7X37X+9UlsWIqOeC YnITQoAwzHipLEJ14J6kI3ycyp6fAeSdtpq1JGP1VVRwYArM9u1L/J01FJM3G0Z/trIp mTv5dR4gVkA4cDb2FqK4wXKDERYuEvVVEjy5JY0K+dWXx8XnbvAjxYnXO/QmtGmxT7zn 7z/A== X-Forwarded-Encrypted: i=1; AJvYcCVvE9OY+kWIkgu0YsnrmShcMOZ1qu7MQfqtZi1kUlqCWM0eqJqnMqrCkAi0q8BE6gRujXwHhQWKJT4PWVDTj+9G++SObofWKIqYTTZY X-Gm-Message-State: AOJu0YwIx4zfKqULcMIu1SZdX8Aprpc1mPLqgUPmQlRqm9Gfqbk38Fkv PuUgEftA2Xgnd8z8zLprbRL5JOVG+RGlGcdjXKGbnKeKN7UJRMMFl5NIRiJq72U= X-Received: by 2002:a5d:5542:0:b0:34d:1d09:f06d with SMTP id g2-20020a5d5542000000b0034d1d09f06dmr4990315wrw.13.1714821976417; Sat, 04 May 2024 04:26:16 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id p8-20020a5d4588000000b00341ce80ea66sm6013320wrq.82.2024.05.04.04.26.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 04:26:16 -0700 (PDT) Date: Sat, 4 May 2024 14:26:04 +0300 From: Dan Carpenter To: Evan Quan Cc: Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , Tim Huang , Lijo Lazar , Jesse Zhang , Ma Jun , Ruan Jinjie , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] drm/amd/pm: Fix error code in vega10_hwmgr_backend_init() Message-ID: <502fda28-fde7-4851-b17f-4d48848955bc@moroto.mountain> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding Return -EINVAL on error instead of success. Also on the success path, return a literal zero instead of "return result;" Fixes: e098bc9612c2 ("drm/amd/pm: optimize the power related source code layout") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c index 37c915d7723c..9b9f8615070a 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c @@ -924,7 +924,7 @@ static int vega10_hwmgr_backend_init(struct pp_hwmgr *hwmgr) data->total_active_cus = adev->gfx.cu_info.number; if (!hwmgr->not_vf) - return result; + return -EINVAL; /* Setup default Overdrive Fan control settings */ data->odn_fan_table.target_fan_speed = @@ -947,7 +947,7 @@ static int vega10_hwmgr_backend_init(struct pp_hwmgr *hwmgr) "Mem Channel Index Exceeded maximum!", return -EINVAL); - return result; + return 0; } static int vega10_init_sclk_threshold(struct pp_hwmgr *hwmgr) -- 2.43.0