Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp1370031rwb; Sat, 5 Aug 2023 13:26:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHUL1rhBwzNhpu63Oe5FG8NP+gAJKyqmUsrrDIuRUfjPzuNFmskg2mCaBk2SdUa8Bv/69Ck X-Received: by 2002:a2e:3c1a:0:b0:2b9:e230:25d0 with SMTP id j26-20020a2e3c1a000000b002b9e23025d0mr4164955lja.14.1691267196772; Sat, 05 Aug 2023 13:26:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691267196; cv=none; d=google.com; s=arc-20160816; b=cpc/JvEyqMF7Tm8Hmi55Iwl/URCNsIVJlxWuAqPdH5lFSWIlFmsbhlczVfhU3patP5 aOWi9xmnru19iAw1Us5vF57Mhn+DHAnzMw7xgOFyc68TsfHrs/5UNGVrVsgnsgDkJdJ1 3+lucwS8ubz7Y0XQZGN2F+yOgTE+o9SxXU70Qcxv4G0wIs941ad7h0DX2QDTMcb8kFcd 1EHoQp6vQmOgxfpqxtLmk7PKiyy1tKgN5FUELbWpj1TAfX7hMi5FZMV3dCZAt909pOm7 LlJ1Lzd4Y6hM56iuA3BFY0ePEEJxqKu2v8EieoaOe4LMyxrELsBMwwLljlycQEfGW0PI Nkbg== 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=15vvxuEzw/vsBIM1vvUZPsddQoEbjf6nV0kH24iIJDs=; fh=F1+Yw49Jc/jUryHL+WqG3tq25pjsRL5avPIN7ZUzGPk=; b=oK5wmBXuli2/menscDfkjkrEYix4S7P5fF1h9ZSrDobWZ6EE5Ss0zutTCToBZjzExg dbWHuXfX/kDbFqXhlhTkb4F5GuPWXW+xDoVHE8/G5Fyf5R4mvRpBDR8X4G28gK21me5K FUmMG8Iu6BgzaJsS1J2KdCVOOFIhKhN6kDIYwX08KyIww+3lKVqMk2cmKQfPJkyiUcQs 9IqoqRL5yzfiJDrVIqRS4aBNma7FzqCHQs8gwmvvToREv2rBzQtt8mzsMLxF+Ygz8eWX qk8rPD/SJ3Jedq1un79DzbZDEITYwv15fbLQnRHaxI9VMx9r1sLRFeCTILVcl4eJWwhC 6E1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bb+zTIsN; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u21-20020aa7db95000000b00522bbb9c8ffsi3512830edt.195.2023.08.05.13.26.12; Sat, 05 Aug 2023 13:26:36 -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=@kernel.org header.s=k20201202 header.b=bb+zTIsN; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229721AbjHESNE (ORCPT + 99 others); Sat, 5 Aug 2023 14:13:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230079AbjHESM6 (ORCPT ); Sat, 5 Aug 2023 14:12:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2506D1BC; Sat, 5 Aug 2023 11:12:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B13C660DF5; Sat, 5 Aug 2023 18:12:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43E81C433C8; Sat, 5 Aug 2023 18:12:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691259177; bh=7Ank85kDcL0zPfhDN0t1xq7zO6IsGA0dtJ/2WUZ+waE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bb+zTIsNLqu+2SKXjCsSMusMaRcGuy4hU2XQimgUOBNolviY5AnEbYiJR3iX9Y4vH ZiAYiOIYza4yTUqONU/E3IIaMaF46FlcA2hhnUVLDgz/Eq4DNLad9QsnaTQTd220Xr Zm4Qc0Z0rjhtO14N3NGP/6/dDPC4NcgJBSTTOZZNKC8llGvCWaHS5rN2VMxSJclE9D GtsvISqE5RD7ekbWLqldCKgLbcOeJiMcTIe8TcgzAlwdskQ7grG0fRy/JvzbJi6Xo4 loKhslDGMwe1yn0wS4Lz7fGkY4fHk3NUO2K3UMsF8PKDwKTZxiwLFS7fu21Rm2gump zqJLaJ3srI9gg== Date: Sat, 5 Aug 2023 11:15:54 -0700 From: Bjorn Andersson To: Elliot Berman Cc: Alex Elder , Srinivas Kandagatla , Catalin Marinas , Will Deacon , Prakruthi Deepak Heragu , Murali Nalajala , Trilok Soni , Srivatsa Vaddagiri , Carl van Schaik , Dmitry Baryshkov , Konrad Dybcio , Arnd Bergmann , Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Corbet , Bagas Sanjaya , Andy Gross , Jassi Brar , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v14 17/25] virt: gunyah: Translate gh_rm_hyp_resource into gunyah_resource Message-ID: References: <20230613172054.3959700-1-quic_eberman@quicinc.com> <20230613172054.3959700-18-quic_eberman@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230613172054.3959700-18-quic_eberman@quicinc.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Tue, Jun 13, 2023 at 10:20:45AM -0700, Elliot Berman wrote: > diff --git a/drivers/virt/gunyah/rsc_mgr.c b/drivers/virt/gunyah/rsc_mgr.c [..] > +struct gh_resource *gh_rm_alloc_resource(struct gh_rm *rm, struct gh_rm_hyp_resource *hyp_resource) > +{ > + struct gh_resource *ghrsc; > + int ret; > + > + ghrsc = kzalloc(sizeof(*ghrsc), GFP_KERNEL); > + if (!ghrsc) > + return NULL; > + > + ghrsc->type = hyp_resource->type; > + ghrsc->capid = le64_to_cpu(hyp_resource->cap_id); > + ghrsc->irq = IRQ_NOTCONNECTED; > + ghrsc->rm_label = le32_to_cpu(hyp_resource->resource_label); > + if (hyp_resource->virq) { > + struct gh_irq_chip_data irq_data = { > + .gh_virq = le32_to_cpu(hyp_resource->virq), > + }; > + > + ret = irq_domain_alloc_irqs(rm->irq_domain, 1, NUMA_NO_NODE, &irq_data); > + if (ret < 0) { > + dev_err(rm->dev, > + "Failed to allocate interrupt for resource %d label: %d: %d\n", > + ghrsc->type, ghrsc->rm_label, ret); > + kfree(ghrsc); > + return NULL; > + } else { No need for the else here, the failure case has already returned. > + ghrsc->irq = ret; > + } > + } > + > + return ghrsc; > +} [..] > diff --git a/include/linux/gunyah.h b/include/linux/gunyah.h > index 982e27d10d57f..4b398b59c2c5a 100644 > --- a/include/linux/gunyah.h > +++ b/include/linux/gunyah.h > @@ -27,6 +27,9 @@ struct gh_resource { > enum gh_resource_type type; > u64 capid; > unsigned int irq; > + > + struct list_head list; This is unused. Regards, Bjorn