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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C029FC433FF for ; Tue, 6 Aug 2019 08:16:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8EB022070C for ; Tue, 6 Aug 2019 08:16:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731994AbfHFIQE (ORCPT ); Tue, 6 Aug 2019 04:16:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49192 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727259AbfHFIQE (ORCPT ); Tue, 6 Aug 2019 04:16:04 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 09F9C2D6A3D; Tue, 6 Aug 2019 08:16:04 +0000 (UTC) Received: from gondolin (dhcp-192-181.str.redhat.com [10.33.192.181]) by smtp.corp.redhat.com (Postfix) with ESMTP id 583BC10016E8; Tue, 6 Aug 2019 08:15:58 +0000 (UTC) Date: Tue, 6 Aug 2019 10:15:56 +0200 From: Cornelia Huck To: Parav Pandit Cc: kvm@vger.kernel.org, wankhede@nvidia.com, linux-kernel@vger.kernel.org, alex.williamson@redhat.com, cjia@nvidia.com Subject: Re: [PATCH 1/2] vfio-mdev/mtty: Simplify interrupt generation Message-ID: <20190806101556.3ca75900.cohuck@redhat.com> In-Reply-To: <20190802065905.45239-2-parav@mellanox.com> References: <20190802065905.45239-1-parav@mellanox.com> <20190802065905.45239-2-parav@mellanox.com> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 06 Aug 2019 08:16:04 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2 Aug 2019 01:59:04 -0500 Parav Pandit wrote: > While generating interrupt, mdev_state is already available for which > interrupt is generated. > Instead of doing indirect way from state->device->uuid-> to searching > state linearly in linked list on every interrupt generation, > directly use the available state. > > Hence, simplify the code to use mdev_state and remove unused helper > function with that. > > Signed-off-by: Parav Pandit > --- > samples/vfio-mdev/mtty.c | 39 ++++++++------------------------------- > 1 file changed, 8 insertions(+), 31 deletions(-) This is sample code, so no high impact; but it makes sense to set a good example. Reviewed-by: Cornelia Huck