From patchwork Wed May 18 19:11:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrien Thierry X-Patchwork-Id: 12854008 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A3433C433EF for ; Wed, 18 May 2022 19:14:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hrB5VjPYr53biImDBTDvRze8cNCt3clZnhh7uImn+w0=; b=vYgFzf+sk0vjr/ lNElb3m4Eovap8LHSTmrdnQ70LUQfNzQEfufj30JH7J3UkkYvS+5mk2nLzHzusacpbqWHv9SRhhrK VkX7GzYoQOZ6oyvDYEB2jjxK1y2p0GoomQ150wAw/aQAg1Jshm4NPvpa2kMGiuDZ7NTIpChlnJ4AM XffLEwagZh+FQ2+WDmdK9PkZ8S6jVFknKQu2zIWw6//st66bUf4yBwtHLcJiIxtn2RWKelxD30/Tt x55ICy/e1RP3QmihdshwNu0TEp8fKYNKVy0VWCReqFMFkMu61DskRUHzPbskTNAfk7uhe7B0hNHaL sADrs+YlCA6rZ9CtrRQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrP6d-003YRX-8C; Wed, 18 May 2022 19:13:11 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrP5e-003Y1o-I6 for linux-arm-kernel@lists.infradead.org; Wed, 18 May 2022 19:12:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652901129; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=z3iPx7qaaPixjw/oS8UgHujPw/Xc8SlGxp3qIEtkoeE=; b=KedH6kwOeLxTEJPtoLrLWF56ht6YVJkQ+JdWdm8MIH31D5BXnkh2TqJ0hts3k2pXwCTw+O NVxFswTPn1o8faM/yttaXAw8eZLy3Xdj6A5J8QWhoDPRR++eZ/nQDs15BbgysTSJZr67Jm TbqSiBDAPOwxYiebSQpJqbj5syPBZy8= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-543-YV5wzWH1MpOKyh7icFfqLQ-1; Wed, 18 May 2022 15:12:08 -0400 X-MC-Unique: YV5wzWH1MpOKyh7icFfqLQ-1 Received: by mail-qt1-f198.google.com with SMTP id w21-20020a05622a135500b002f3b801f51eso2331374qtk.23 for ; Wed, 18 May 2022 12:12:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=z3iPx7qaaPixjw/oS8UgHujPw/Xc8SlGxp3qIEtkoeE=; b=5921/Y9nDWd7emPVoB3R8WS8oi9v04B7l/suoH612zEdloVR5dMZVaB5kWEUaBEnx7 NbE+KF6zoxbn1LSKiJSX7YzjJePIAPNKA5zUbFkwi5doCwquZEZPaUgCKi1dfgnNIDdB UdOY6TioP0cRUM0cUHtWTKIepBoAGREWaXBt4IE8mJ2mk0dThSlMf7mNrAk98ht5hivK m6Ba2UwgE7tNzppsMkyUQJSKTtZsrtoUiSw1/dFA+tCmVcWACWb/R7/x1pUTEgalYM+i UEGYeqgtrSY6vEYuFORlrXuLXVKNDTpL5JSnLDV21tikbS/16eXBtHFmEcKwPbBAMD7l 3vnQ== X-Gm-Message-State: AOAM532z/ySd/uH7op9TF0oZl7LvfKaB+AolgqIT4O3L5A9oWQMNhYDN pZl7H2xUW1MjY5MZwt21RPrJ7ufEK54MWcVwdNl1YVYbUx4yUjWQ/M3ZqZpBhuzoPb10YvVYb31 Pu+s5MCtYzfqY/znL2kWVcJzDluXd1YrA+WU= X-Received: by 2002:a37:a08d:0:b0:69f:ca79:fa1a with SMTP id j135-20020a37a08d000000b0069fca79fa1amr686501qke.739.1652901127908; Wed, 18 May 2022 12:12:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDbUhSvdLu6JduxiW+/zvp4Y/NJimjXRgGY3vYkMFOTedCDN7rVz8EYfdtSQcjExQ9y0MW6Q== X-Received: by 2002:a37:a08d:0:b0:69f:ca79:fa1a with SMTP id j135-20020a37a08d000000b0069fca79fa1amr686488qke.739.1652901127723; Wed, 18 May 2022 12:12:07 -0700 (PDT) Received: from fedora.hitronhub.home (modemcable200.11-22-96.mc.videotron.ca. [96.22.11.200]) by smtp.gmail.com with ESMTPSA id z190-20020a37b0c7000000b006a32d491f92sm39183qke.39.2022.05.18.12.12.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 12:12:07 -0700 (PDT) From: Adrien Thierry To: Nicolas Saenz Julienne , Greg Kroah-Hartman Cc: Stefan Wahren , Adrien Thierry , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev Subject: [PATCH v2 5/9] staging: vchiq_arm: pass vchiq instance to 'vchiq_get_client_id' Date: Wed, 18 May 2022 15:11:16 -0400 Message-Id: <20220518191126.60396-6-athierry@redhat.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220518191126.60396-1-athierry@redhat.com> References: <20220518191126.60396-1-athierry@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=athierry@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220518_121210_743097_A9388653 X-CRM114-Status: GOOD ( 13.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In order to remove the 'vchiq_states' global array, we need to pass the vchiq_instance reference to the 'handle_to_service' function, as well as to all functions that call 'handle_to_service'. This will allow accessing the vchiq state through the vchiq instance instead of through the global array. 'handle_to_service' is called by 'vchiq_get_client_id'. Therefore, pass the vchiq instance reference to it. Signed-off-by: Adrien Thierry --- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 2 +- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h | 2 +- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c index 7217e3070ffe..d6853e23564c 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c @@ -398,7 +398,7 @@ vchiq_service_put(struct vchiq_service *service) } int -vchiq_get_client_id(unsigned int handle) +vchiq_get_client_id(struct vchiq_instance *instance, unsigned int handle) { struct vchiq_service *service; int id; diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h index 5d9c2f787bad..45c3d7d1a86a 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h @@ -599,7 +599,7 @@ void vchiq_log_dump_mem(const char *label, u32 addr, const void *void_mem, size_ enum vchiq_status vchiq_remove_service(struct vchiq_instance *instance, unsigned int service); -int vchiq_get_client_id(unsigned int service); +int vchiq_get_client_id(struct vchiq_instance *instance, unsigned int service); void vchiq_get_config(struct vchiq_config *config); diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c index adb616d97652..7e297494437e 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c @@ -788,7 +788,7 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg) case VCHIQ_IOC_GET_CLIENT_ID: { unsigned int handle = (unsigned int)arg; - ret = vchiq_get_client_id(handle); + ret = vchiq_get_client_id(instance, handle); } break; case VCHIQ_IOC_GET_CONFIG: {