Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp18082rdb; Mon, 22 Jan 2024 10:27:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGbNuW3zPNBxiV0GoOrarGSf8ltDdETCnATb06U8PFr2Jeka+S78G9qRkBSEqfeB6+9yNIN X-Received: by 2002:a05:620a:144f:b0:783:3457:a7e5 with SMTP id i15-20020a05620a144f00b007833457a7e5mr4552537qkl.53.1705948028970; Mon, 22 Jan 2024 10:27:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705948028; cv=pass; d=google.com; s=arc-20160816; b=N6vy4zyJco6Dolc+p+a220yAyk7ug1yiN7XwPODOTy+b4W5/pkzxdOUyE9llUVuDPm 0dK+Gr+qVum7TCjtgYGCQs7mK7y2do6be4jX2JTZsTsFxfMNFjugik9irlT3JQbP4OKy VwHsmsWm1tn7eLcLIY68a1p3oVG89dcwQYEX4/kvqxgzizdtoxGIBD4F6H7Ylyc6sYKK n7Oamr74sbAXd4ktOE3JtodqhyrUsFQ37bP7K3VlPONe1Hat1LPpmemeaACXiGIRBPdk tVilli7d65Qljyibx2XSwEUjXT85Nazq9YQvdQP8v1YSrDcvMIzETAPNwu5ZBq2FH5IF PVWA== 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:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=CHlsOFd028+jV0LAUMT3aaajLuOQehNM5ywoohsK5ko=; fh=gZPKhsU26GYu9Tf02I540l1l5rXPvpkVz51SFRjs29A=; b=kKoJBPBr/XtN1j2GukjUTtks6u8CouEzO71rZbt/gkNQcVT9vjUlPxpzXMKkqIS8nq rbu4cUSDKj3TJnuByhtNWBnVOYEB9FmOgTJ08bIm1gxDm3Um47B8/6+0NIKyP5QZQ9hW /S9nMMUO4DYwLTJG+Othok3z4cjROu12k+iohhdWd1qIquNHjIPdBlx+Vyoo6QIX27Gc CiQE3gJDZpftUjTHvywwT8d4VIQBKWeZ8maJbRcO2EBQHpaePGZ2ZvSXDusIRuvsBqPa TieAdUs1M/qEeGNljSjNllGUWOeI63d59zT6glsO6A07WUW9b+PkhYjoZY31kZi29iFu zQEQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=G6R6J2Tr; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-33880-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33880-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id j29-20020a05620a0a5d00b007834e865b29si6056071qka.288.2024.01.22.10.27.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 10:27:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33880-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=@wanadoo.fr header.s=t20230301 header.b=G6R6J2Tr; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-33880-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33880-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr 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 B707F1C28C0E for ; Mon, 22 Jan 2024 18:27:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA0F250A78; Mon, 22 Jan 2024 17:57:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="G6R6J2Tr" Received: from smtp.smtpout.orange.fr (smtp-20.smtpout.orange.fr [80.12.242.20]) (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 9E1B550272; Mon, 22 Jan 2024 17:57:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.20 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705946275; cv=none; b=kwSgKP2oSktTUorTPAg/G6SQYrX0Jrss1tENzC8cXRa6kH0Clwj5iK02CyXPO9T9Xxm15OYcJExMcCxjVA8oD32rscGE6ZfUY+J9PDbsbS81GnLxENwk2SNM41sGXIeKWU1f30GBx91a6ejs7htNaeLVXWydOmWIvhVMOqd6GOY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705946275; c=relaxed/simple; bh=ormRf2c7k0RSk48YWM459e3k1OgtsTd6YXCAGOapFlM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=JNtiAjG8g4rVnKpZwpOT3t69anxoK4YXC+iWcEZlrb4NLsZl85G4qAUqG6I4ozR8kXgyZQh6AA+CfYmp27RsnnEfNNmbciH2BVTNvK8oz19r58rSVLTmLHGa/y9ZdTBD7yEkkjoo4dZh749zaCHqjQxWIneSZsvCQsqmxXSUNp8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=G6R6J2Tr; arc=none smtp.client-ip=80.12.242.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Received: from [192.168.1.18] ([92.140.202.140]) by smtp.orange.fr with ESMTPA id RyYJrZyS0CqsFRyYJr2t2P; Mon, 22 Jan 2024 18:57:45 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1705946265; bh=CHlsOFd028+jV0LAUMT3aaajLuOQehNM5ywoohsK5ko=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=G6R6J2Tr0yjFFdDfUw8j4W+vMDSPHcYn7lhH9AsHvWwOS3b2fKv5hQSEnK+v1vEX1 X340Jilt9mvYEM6pn2jHnHMMwco0kxed5Za++jbP/7XuRkzzgBDoetvw4ac7m7CbuJ v0XwmEa1DdqoP2K+4bf/vaahw7MJJhsMBCKcwXePV7MjqzwRRwAFpNTfMYivbHQc3c ZW0GAOGyMjn+JKmuzWZpGTpq4ODnItBSjzS3P2k1QvWckVZsQ+PCl6W3bViR54tViM hF3rLxCHF4Rv41RJnFyCdLaLrmgroDZjbKRkqg4G82K1FrSut3/drmRYD280/lL6vz a+zdJyvdOZX8A== X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 22 Jan 2024 18:57:45 +0100 X-ME-IP: 92.140.202.140 Message-ID: Date: Mon, 22 Jan 2024 18:57:42 +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] thunderbolt: Remove usage of the deprecated ida_simple_xx() API To: Mika Westerberg Cc: Andreas Noever , Michael Jamet , Yehezkel Bernat , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-usb@vger.kernel.org References: <7fce4c8c4345d283dbfadd3cea60fdc49f9ca087.1705007397.git.christophe.jaillet@wanadoo.fr> <20240122112922.GH2543524@black.fi.intel.com> Content-Language: en-MW From: Christophe JAILLET In-Reply-To: <20240122112922.GH2543524@black.fi.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 22/01/2024 à 12:29, Mika Westerberg a écrit : > On Thu, Jan 11, 2024 at 10:10:21PM +0100, Christophe JAILLET wrote: >> ida_alloc() and ida_free() should be preferred to the deprecated >> ida_simple_get() and ida_simple_remove(). >> >> Note that the upper limit of ida_simple_get() is exclusive, but the one of >> ida_alloc_range()/ida_alloc_max() is inclusive. So a -1 has been added >> when needed. > > Looks tood to me but wanted to check if you tested this on a real > hardware or you just build tested? > > Hi, It was compile tested only. Transformation has been done with the help of the cocci script below. CJ === @@ expression i, gfp; @@ - ida_simple_get(i, 0, 0, gfp) + ida_alloc(i, gfp) @@ expression e1, e2, gfp; @@ - ida_simple_get(e1, e2, 0, gfp) + ida_alloc_min(e1, e2, gfp) @@ expression e1, e2, gfp; @@ - ida_simple_get(e1, 0, e2, gfp) + ida_alloc_max(e1, e2 - 1, gfp) @@ expression e1, e2, gfp; @@ - ida_simple_get(e1, e2, e2+1, gfp) + ida_alloc_range(e1, e2, e2, gfp) @@ expression e1, e2, e3, gfp; @@ - ida_simple_get(e1, e2, e3, gfp) + ida_alloc_range(e1, e2, e3 - 1, gfp) @@ expression e1, e2; @@ - ida_simple_remove(e1, e2) + ida_free(e1, e2)