Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4518742pxy; Tue, 27 Apr 2021 06:59:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyK1bPGI0TRnlB0u2ws7p4cESl8di1Vj/EkFuIq4T7PfeZsw25au4D3lakZgJT40MeTKvDz X-Received: by 2002:a17:902:8c92:b029:e8:fa73:ad22 with SMTP id t18-20020a1709028c92b02900e8fa73ad22mr24341650plo.66.1619531986277; Tue, 27 Apr 2021 06:59:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619531986; cv=none; d=google.com; s=arc-20160816; b=Kque9fn0x3tHBKo7w11U1Ts+15TzxcS02rAMH7NNuZxX+MPTB5OWfYBgx+WuQjCzJz 6ehuNrDawBTyhda5SpBCvzkCzIUDpp5A/ckKdNAFvux2JAL3iAD33eUac5joMlsUABGu m0un081wmVLDWjzxz6AULFGZ5VA6c9kmX5V9DrPQVa8KvXYqSUNAIW0mmHHZRIqvVQIs uT5u+jXH9dxszMdmzDHamXeowY1qls7iUls/WML2EXlv8zKsvAJFq+wBwuz4clw1YtKp GkbvoAb1nf1hFl3/vtRore6rdWbwwZkGlOMgiU+OJVe0RaXTpbhF5M0pTNsDZ5qn522E Cikg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2EZ9wMn5IsrCWzyEdIPf+KOdPnl6OIWHe1m9e0dWRa8=; b=uOKHaum8XWU7DEZe3hEIBy81xbeVZ0qMaJfCJQHAeBWyKlLPj4exSsGbAsWjehyawm gxJqKer29vN7NmaWK1yeqxY3pVDsv5KhYlnimP6W2KeJTq+OaKmfigwOQSu8JHrqPcTh UFS+bJs0k7pBPl1T9NmBgARRLKeTQ1pMKhs4ffCRY0gTsZYaNQe4iwNGgDkNqt0sHH2+ jqAVRsEnSGCz4wotmSLC3GnaKnFXpU+wXu7IZT5HlvmwrlP2gtvHlQ9UFd6v+PWVsVZm qRtmjHfQdQznyKUFyeVo9LJZN1x/Uzfr1btc+2Cag/g2O5KwHqVIwVDq+OXB0vVIH4yX SF+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=kBL8O9EW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u17si4927793pgg.542.2021.04.27.06.59.33; Tue, 27 Apr 2021 06:59:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=kBL8O9EW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236460AbhD0N6H (ORCPT + 99 others); Tue, 27 Apr 2021 09:58:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236074AbhD0N6G (ORCPT ); Tue, 27 Apr 2021 09:58:06 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 691C3C061574 for ; Tue, 27 Apr 2021 06:57:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=2EZ9wMn5IsrCWzyEdIPf+KOdPnl6OIWHe1m9e0dWRa8=; b=kBL8O9EWg/3wmo7Rz/ngkPBWvv /lDdibrv2XDWvOvRxeCuN6GBui4ZCegmuOEt0hj4oRbjRSHiTPOYscLy22+WWBpi1LG0CIpEEPe/7 PE/hqkFuZJMa5lxF32I8uQp7pKtZP1a0AEIHL2W5P3KUOVoozDSosJw+GVBzTpzEn6JcTEEe0suNG WnbpyRZEhUIpLmlyraJE3EoJ/VQIt2/S/9h/6uxmSQ52AvaIzhBVgkQPwgHaB+ARVtkYARELujmYf BbW9WvwIPcb5CTXNnHIIljHUtpXGDHSXlmh/kXYAdlQfueNAJ+Xf/oUBv5I+WzIPJmfHIzVcIJRkZ zZe9U5nA==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lbOC6-006zBS-0S; Tue, 27 Apr 2021 13:56:33 +0000 Date: Tue, 27 Apr 2021 14:56:05 +0100 From: Matthew Wilcox To: "Fabio M. De Francesco" Cc: outreachy-kernel@googlegroups.com, David Kershner , Greg Kroah-Hartman , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Daniel Vetter Subject: Re: [Outreachy kernel] [PATCH v4] staging: unisys: visorhba: Convert module from IDR to XArray Message-ID: <20210427135605.GZ235567@casper.infradead.org> References: <20210427132522.14547-1-fmdefrancesco@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210427132522.14547-1-fmdefrancesco@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 27, 2021 at 03:25:22PM +0200, Fabio M. De Francesco wrote: > +++ b/drivers/staging/unisys/include/iochannel.h > @@ -474,8 +474,8 @@ struct uiscmdrsp_scsitaskmgmt { > enum task_mgmt_types tasktype; > struct uisscsi_dest vdest; > u64 handle; > - u64 notify_handle; > - u64 notifyresult_handle; > + u32 notify_handle; > + u32 notifyresult_handle; > char result; > > #define TASK_MGMT_FAILED 0 I'm scared of this change. Read the top of the file: * Everything needed for IOPart-GuestPart communication is define in * this file. Note: Everything is OS-independent because this file is * used by Windows, Linux and possible EFI drivers. I don't know that you can make any changes to this file. > +static void setup_scsitaskmgmt_handles(struct xarray *xa, struct uiscmdrsp *cmdrsp, > wait_queue_head_t *event, int *result) > { > - /* specify the event that has to be triggered when this */ > - /* cmd is complete */ > - cmdrsp->scsitaskmgmt.notify_handle = > - simple_idr_get(idrtable, event, lock); > - cmdrsp->scsitaskmgmt.notifyresult_handle = > - simple_idr_get(idrtable, result, lock); > + int ret; > + u32 *id; > + > + /* specify the event that has to be triggered when this cmd is complete */ > + id = &cmdrsp->scsitaskmgmt.notify_handle; > + ret = xa_alloc_irq(xa, id, event, XA_LIMIT(1, INT_MAX), GFP_KERNEL); You're still not handling the error here.