Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2919979rdb; Tue, 6 Feb 2024 01:31:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IEcIgPrLM2YI4dGpCvHIWKZF7JB1Z7KhAlh371uFJ2e3MneyCNLTfXmN7YTjBv0//8ziMMY X-Received: by 2002:a05:6a21:7883:b0:19d:e644:7c9 with SMTP id bf3-20020a056a21788300b0019de64407c9mr1562895pzc.22.1707211880979; Tue, 06 Feb 2024 01:31:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707211880; cv=pass; d=google.com; s=arc-20160816; b=EZ16Sn0ny3GUaFFIMRD3dWGMF44WMpKaPL6aU3NI74LgFZqCDc3cfjutDGs/f0QCIQ gwvhOQ2FB89NeqgAtz2VNRuJ5MoMuU5GmwVrx0N2GljdclOFSQbNbwujVFmZiuZnNUnp a5+ly4EIe4O6wQG9sXbM9PCe1n0Mysv6Y2eJhU4UzRcP9FI0gWxMrXFqMyI7pp65qpNG mP/bXI2RWbmrwKGC8WNtkfNQdpWIsqm/AsfA2PgAW5lFzSyizwhBBjQruVolON9r0VWA JvnTVBSa0MwCp2uWgQoLuF+iAukeoYDusuZstPjgglmi24FAyjel4tzR/KvZifI74jrq FewA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=qhPBiLJAtXhRRRHzCQWeeO8j655s5ICFl+JAPaUXxsA=; fh=RZvmQ0b+F2yFx6aeX1y1oxdqy+NLUaLwviQ4P3n3TXE=; b=vAeWKXJkdC4J+wgNLP0L087TQm73RE87yUhtVbwecm7nzemmygdvdQKbnup7K094W9 AQOPXKlepOud0SKsM8mICBjWZ/AsoTGr4oq0aXRThuZkYlBQGm4ULAhhumtJ9JWEuu0i peLHaN4jspHBaXtrJnxdordKSdufqM+IxAfm40Y+soOIUw3B2NVhPRPappmQiDnOlLuw flP/loV+WHRwU2xTsH11N6tqPbIiU3hJP/gxRSthKYXRcmn2w2S3l1pcimn9P8BBPSwV UKf3EJD14o7pdANIoCug89TVUPOpT2H2t5t6gfTp1yOmrxkqilvYV8xWVwjtamr7VqNt 04GA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=4NSspz4x; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-54582-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54582-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com X-Forwarded-Encrypted: i=1; AJvYcCU82dCnpNmGgbXSwlqNO1hyPhJ/uGx6cewOrzMGD7nWUDc3UTf44REtZre9ugNo0Uc/RVFwDQix43VZYnS8+bPvk9ded7T3OW/WHcH9Fw== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id b33-20020a631b61000000b005cf1b38bae1si1390739pgm.546.2024.02.06.01.31.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 01:31:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54582-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=4NSspz4x; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-54582-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54582-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 55012B24478 for ; Tue, 6 Feb 2024 09:24:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4EA8412D761; Tue, 6 Feb 2024 09:24:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="4NSspz4x" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8B1A12C541; Tue, 6 Feb 2024 09:24:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707211446; cv=none; b=ssVLGPJf1jFvH3ZBTUkLLDbSYxp0M4QYiIxXAAAjZ3o8/1FoC7CkQotJXpwA94eoiNmx0Pk2/tScPgmSXVB8TgCNftOBox+xEnaVT2LIIngociWRRnc2KEvjQJ75NI/HXF9qP140tb0Q5FtCzh186iEzcaEBBR+9LdQP8+AXkIk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707211446; c=relaxed/simple; bh=5YvgUqR61QNjvLXdS55FaX2N2Q7jHdFaH5GUQL62KZg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=u7BgZJ8kFV4UnzN6+M9Iefoe13/NQPFmv700BudEYtFnOEJmbnQIhcaXeDH6K0ZaLm0FIKC1DtkLB1wpi4NLrIzQlFt9WoY5ygU4ihiMCxcMIW5wao1udFU1giP7BnTkVmkHQhJQkW6zBJaKKgZHFtEK/4UqT7ODniiuS0TwTy8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=4NSspz4x; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1707211443; bh=5YvgUqR61QNjvLXdS55FaX2N2Q7jHdFaH5GUQL62KZg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=4NSspz4xXg6LEVrBIlDgheuDmBBoXGi39H8gT9MzESdQR4gzeVP2C0PkXzQTgiM1I 9CaTnVrim/1ezdaqUNH3EMRlkWA4YWDh9xmVxaU5QgFLZTtwbF96cOg+3Q1aHhZ5Jp qWpDnh5r/3EsiPM7YG5K1oZOrju9bR2gt5B+P+X+Agxncasic+/kN8p1R6ZJrQ+wJd fIWWDU9mzwthw8JODnUjvoP8odQkQnzKVeerBML3eNEpI7kYEFeMjfPvfvFzzdprTF xTvi6M0o9GkKizt/T/4XP7AkMjR5uQtv+7IAtKuVx6yLcpkS4te0R48mUMMajDg6Z4 Cwj63bdYjq3EA== Received: from [100.113.186.2] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 7925E3782051; Tue, 6 Feb 2024 09:24:02 +0000 (UTC) Message-ID: Date: Tue, 6 Feb 2024 10:24:01 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] pmdomain: mediatek: Use devm_platform_get_and_ioremap_resource() in init_scp() Content-Language: en-US To: Geert Uytterhoeven , Markus Elfring Cc: linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, kernel-janitors@vger.kernel.org, =?UTF-8?Q?Heiko_St=C3=BCbner?= , Jernej Skrabec , Matthias Brugger , Rob Herring , Ulf Hansson , LKML References: From: AngeloGioacchino Del Regno In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Il 05/02/24 17:31, Geert Uytterhoeven ha scritto: > Hi Markus, > > On Mon, Feb 5, 2024 at 3:23 PM Markus Elfring wrote: >> From: Markus Elfring >> Date: Mon, 5 Feb 2024 15:08:27 +0100 >> >> A wrapper function is available since the commit 890cc39a879906b63912482dfc41944579df2dc6 >> ("drivers: provide devm_platform_get_and_ioremap_resource()"). >> Thus reuse existing functionality instead of keeping duplicate source code. >> >> This issue was detected by using the Coccinelle software. >> >> Signed-off-by: Markus Elfring > > Thanks for your patch! > >> --- a/drivers/pmdomain/mediatek/mtk-scpsys.c >> +++ b/drivers/pmdomain/mediatek/mtk-scpsys.c >> @@ -441,8 +441,7 @@ static struct scp *init_scp(struct platform_device *pdev, >> >> scp->dev = &pdev->dev; >> >> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); >> - scp->base = devm_ioremap_resource(&pdev->dev, res); >> + scp->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); > > Given res is further unused, please use devm_platform_ioremap_resource() > instead, and remove the local variable res. > Agreed: res will never be used. Cheers, Angelo