From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 992BFC6FA86 for ; Fri, 9 Sep 2022 23:53:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230512AbiIIXxS (ORCPT ); Fri, 9 Sep 2022 19:53:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbiIIXxP (ORCPT ); Fri, 9 Sep 2022 19:53:15 -0400 Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3631D11B008 for ; Fri, 9 Sep 2022 16:53:14 -0700 (PDT) Received: by mail-qv1-xf2c.google.com with SMTP id m9so2449000qvv.7 for ; Fri, 09 Sep 2022 16:53:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=I7AGr5kxvD7L8BGImkaiYYIcWYTyuHALX3Uwn5SFGes=; b=dABIJEmzczJA9TeUEwB/vqlw1on+BNexewwg9hQHdtE1Pf+5Eir7ZuRo5Ra74CBI2Y mcA+UH3eeO9aAd0QqE0L7SFCTjpphtpc0ELtMYBKyyRw1a/HWDzHyUcOactrzkgR2sl3 L0nOmencTRW6FHXiEoY9iZZ+c/WYo/U0AzzN4UAFPlTI1iRVRUWqtRTHaf8sCXXZzJnf NJL3l99mu6NE5Asx87J+/QD6IeeyB3qXivdFsvkAKE6TbTRWix12Dqc9T+JmjOGbnts9 4TFjGIVIDOrRXIamT7vOV1TzgaehJPaax4ZVZ8nlHpjlkRagg2W3Kahrivj4XNmSdY7D YIBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=I7AGr5kxvD7L8BGImkaiYYIcWYTyuHALX3Uwn5SFGes=; b=eebkyhLVRdtdKJNNAJTfLs5fPqJzWMqNQWLQAIL0mpOTny+y5rrz4fBleOp8ULxZhc 9cw1H3lXY7PhX1PcQHBp1IxeR8OJZPCLLjfyhdv+sBwpRwoqmTsI5VGXvCvmlt5B3xQt bgYwnnnKErFnDaMNyi3eYIX5ho/tsD+2akKDzGCmismdRSMl4ffPBxB9Bm+qxUpuVDSv v1ysy3zR9E2o6y6lS5BVlGUkkp298Jl4gZ5zrHvaF6EOV25KBFlDYdunyTFoc+VoXeQm JxKpsemNbEKYF4+afSNeovDBDwFbR0L4zwXSbSuKftkI7ZNUOz4zbQVlLRbOhDHQAC76 /GGg== X-Gm-Message-State: ACgBeo3NGJzQZJ+33DsM8JuLUy+KoimQqXkK/+UCIkdSXWnSfgg4osUW HAywpqolxdyf8QQhK53vpkZbHg== X-Google-Smtp-Source: AA6agR5hWM2GJ5zXaAdZz8/5jyfYnTB6f4lRkH4YbMaWcByENpIrNcfVlyo+HaeUh7LK3d+xbRkfaQ== X-Received: by 2002:a0c:f445:0:b0:4a6:9f4a:9a66 with SMTP id h5-20020a0cf445000000b004a69f4a9a66mr14581963qvm.65.1662767593396; Fri, 09 Sep 2022 16:53:13 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-162-113-129.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.113.129]) by smtp.gmail.com with ESMTPSA id fz16-20020a05622a5a9000b00342fc6a8e25sm1348798qtb.50.2022.09.09.16.53.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 16:53:12 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1oWno8-00A0GS-4S; Fri, 09 Sep 2022 20:53:12 -0300 Date: Fri, 9 Sep 2022 20:53:12 -0300 From: Jason Gunthorpe To: "Tian, Kevin" Cc: Ethan Zhao , Zhenyu Wang , "Wang, Zhi A" , Jani Nikula , Joonas Lahtinen , "Vivi, Rodrigo" , Tvrtko Ursulin , David Airlie , Daniel Vetter , Eric Farman , Matthew Rosato , Halil Pasic , Vineeth Vijayan , Peter Oberparleiter , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Tony Krowiak , Jason Herne , Harald Freudenberger , Diana Craciun , Alex Williamson , Cornelia Huck , Longfang Liu , Shameer Kolothum , Yishai Hadas , Eric Auger , Kirti Wankhede , Leon Romanovsky , Abhishek Sahu , Christoph Hellwig , "intel-gvt-dev@lists.freedesktop.org" , "intel-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "linux-s390@vger.kernel.org" , "kvm@vger.kernel.org" , "Liu, Yi L" Subject: Re: [PATCH v3 01/15] vfio: Add helpers for unifying vfio_device life cycle Message-ID: References: <20220909102247.67324-1-kevin.tian@intel.com> <20220909102247.67324-2-kevin.tian@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 09, 2022 at 08:42:25AM +0000, Tian, Kevin wrote: > I think it's quite common to have an alloc() helper initialize refcount, e.g. > vfio_group_alloc() both initialize its user refcount and also call > device_initialize() to gets kref initialized. Similar example in > ib_alloc_device(), etc. Right, it is quite a good/common pattern to have an allocation function return a refcount to the caller. I don't know of any naming standard for this however. Jason