Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp908673rdg; Fri, 11 Aug 2023 04:05:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEsiVXvP1Xb4rsI56wxyaQYbWwkAR4LurQycOTyiDeb/8E77nM/t1ntnP0TYfsI4rR950VW X-Received: by 2002:a05:6a20:4402:b0:13d:3b4d:e4b4 with SMTP id ce2-20020a056a20440200b0013d3b4de4b4mr2502624pzb.9.1691751956124; Fri, 11 Aug 2023 04:05:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691751956; cv=none; d=google.com; s=arc-20160816; b=jiYM+RV8odeJktyaGZcE19nd8Y8hE0LBXLvCyYNIIPiw6nbBgwsouJR07b6MF7AKfZ E4RJukoeZoH7c2dn+uM7RI+vuKMNwhSnf4CKN44vUd7Djt4dV7jEy2nbr2Oa6cQBLPcp RwYE6ajY+wMjZktF71Tg1vP2iTIOTEx5aBAt41IGI8P1E0aVV0efpMtWyY3QELEjEWgR zoOf/oy31v6igmDCqbEd4YT7r1DIsytfABNMUur63ik4uhJJxuOu41roUEfRGS4r10b9 nCXd4fY98sdT5v0E2by6xiXe4EIZQjQU5B5pfHZM7WTBBardfhaGJQ2Yg/0CEemc5WKh AuEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=NslvcDvuxfAowExZckO6q/QNiso35UFinqZIAJlRvqk=; fh=woJdKc7Pl3s0sbPZtV5BBTGBSGnywl1OxnpFPlU6R+Y=; b=VpVb8GzBa8Sstn6MKQdWCA8ZmTyb1VnuxIWRZ+A5vx2Ca3iOeS3ZGmdfRTQ/rZ8DjN oSgPwden4AsWkPXZS+xaCoN/5dVjXIQoOhn1RcNF3eVKtGLCA2pDvzt2VpJeB8MmqIDO monY++jItH5YKHVPizsWYzdNGnuf+yoFToy2AdRGd+EmRxjoJLH5RksWrrW/92ZcYHud 0goJ6n8naJDEzBxDHC+vumV8PIM/ESVeWrNTAPD4VnD1dZCfbHIZynhxVJTNBXJo91C1 yBIwF63B6OA6jbYvstoxtqDXyZ/CLrvEwm6Ps3gziW5aesF6Z8zrnN8c7MAkB2hVEMWs xysw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XPGyjiBT; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k5-20020a056a00134500b006870b977759si3391409pfu.382.2023.08.11.04.05.43; Fri, 11 Aug 2023 04:05:56 -0700 (PDT) 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=@intel.com header.s=Intel header.b=XPGyjiBT; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234742AbjHKJgG (ORCPT + 99 others); Fri, 11 Aug 2023 05:36:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234977AbjHKJgC (ORCPT ); Fri, 11 Aug 2023 05:36:02 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2602A2D61; Fri, 11 Aug 2023 02:36:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691746562; x=1723282562; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=JJRwqHyKv0p+otad23Vh/qQQtrlA9JIRUHyH+M6PLWc=; b=XPGyjiBTYAeTzhY8IWWzB7wLL/MG0FbqQ5ep73jl+h5IMd9hq50c6YG3 69IqBh5RwZ2g0yZ1DU/TYZZ/qI9sWw+2yeJ7kInbHWi5X0EwjaLSrOgH7 UrChNn1U+U9O5P6K/U7g1dkW8DnigYOcnMYfru4GwOeRUUGBKaJF4PaT1 rJnj4LtWs/OybJ6yVYa8aip2mhBDrk3WmtHBk7LHDcHjKktsEdZAAY3fl jC2Z2tLMSqI1vht3MuKWHxlSkZo7KDVc5bfy4D5dEts2s/E5UWObS4Zza jNGRkwhEBjASOyoyvBuhSRXEWCguzBoXPzlQdM5gIq5JJNP3mu1i023l+ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10798"; a="369109965" X-IronPort-AV: E=Sophos;i="6.01,165,1684825200"; d="scan'208";a="369109965" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2023 02:36:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10798"; a="735728755" X-IronPort-AV: E=Sophos;i="6.01,165,1684825200"; d="scan'208";a="735728755" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga007.fm.intel.com with ESMTP; 11 Aug 2023 02:35:58 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qUOYm-008nvr-1G; Fri, 11 Aug 2023 12:35:56 +0300 Date: Fri, 11 Aug 2023 12:35:56 +0300 From: Andy Shevchenko To: Tony Lindgren Cc: Greg Kroah-Hartman , Jiri Slaby , Dhruva Gole , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , John Ogness , Johan Hovold , Sebastian Andrzej Siewior , Vignesh Raghavendra , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Guenter Roeck Subject: Re: [PATCH] serial: core: Fix serial core port id, including multiport devices Message-ID: References: <20230810065737.47294-1-tony@atomide.com> <20230811051121.GL11676@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED 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 On Fri, Aug 11, 2023 at 12:35:01PM +0300, Andy Shevchenko wrote: > On Fri, Aug 11, 2023 at 08:11:21AM +0300, Tony Lindgren wrote: > > * Andy Shevchenko [230810 15:26]: > > > On Thu, Aug 10, 2023 at 06:24:13PM +0300, Andy Shevchenko wrote: > > > > On Thu, Aug 10, 2023 at 09:57:34AM +0300, Tony Lindgren wrote: ... > > > > > + unsigned int min = 0, max = ~0U; > > > > > > > > Shouldn't this be int? The max IIRC will be INT_MAX with this anyway. > > > > > > Ah, and then you can supply is as 0 (IIRC). > > > > The returned id will be INT_MAX, but idr.h uses unsigned int: > > > > int ida_alloc_range(struct ida *, unsigned int min, unsigned int max, gfp_t); > > > > If there's some reason to limit max id we can do it, otherwise it's just > > a don't care flag. > > > > Please clarify if I'm not following what you are suggesting :) > > ... max = 0; > > Will have the same effect with more explicit intention "use whatever maximum is > default". With ~0U I would expect to see something bigger than INT_MAX, but it > won't ever appear. You can put a comment on top /* Use 0 for max to apply IDA defaults */ -- With Best Regards, Andy Shevchenko