From nobody Thu Dec 18 20:16:16 2025 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 C6542CA0ECE for ; Tue, 12 Sep 2023 08:56:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233081AbjILI4I (ORCPT ); Tue, 12 Sep 2023 04:56:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233048AbjILI4F (ORCPT ); Tue, 12 Sep 2023 04:56:05 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E47EE7A for ; Tue, 12 Sep 2023 01:56:01 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-401ec23be82so59284255e9.0 for ; Tue, 12 Sep 2023 01:56:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1694508960; x=1695113760; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UGE8+aaEWV5mHsdN/XyuIXsk7ZbIHUwF0zjQXkbFuiY=; b=PPBZqTjs9fBExOCIh0mpM57vyyCAnaBol8M4+06l6SXloJ3jBVthtC723YLf1CqPoM ON4zl92Sf4zbkAMC1yY3i7Bvm98q3mkqBC8SO5wHjP84zABOzeWmqwW7WqEkiDn2M9re ZmVXj3aYVawQvV1uhFZAXETGqrysz0MkxHq7xQsQrjB26/vLg73YoUXtodNK+J4c9nHF XrktqzZNZctJ/M8eb8tXaF6cvlpY/39tNjbhREqRhVL+jC0Q6Ky2vijvQXpkP2JV8CA6 8w0P3qreIg5YGkQGq5SEmsOrdjaZQvAAxNtFCHpaVeyJohLNJXDVvFkUfVmPV//97k/T /CgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694508960; x=1695113760; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UGE8+aaEWV5mHsdN/XyuIXsk7ZbIHUwF0zjQXkbFuiY=; b=Yu8LHp+B2/BG943g7fMrJ8KFjx0klctLhvzMCo+UWCenZ69f19s4WDfQ2jxlisiFlL E3KYBAskK8q5G3qNpdz44BHpX9j0RkKDgob/yI0cjoHnVQQIoVP0zo6o9qdod+LfJ156 wIzydSLtPAmTcDIYXhX5UbeFTygg+uTFnaPUtRzsbLxHfW7T6fthWMhO5b/keG+racMo lNkXsxmZlcII4KNTC7uLMokkBG5r67v9UoU40tYaaRu0Ld/S+V7zf5lNRNnP1rb5cq23 MZNjbv4OIa8JTKyE7MiaXvkN8MauuvGZgcXJ+X7M/TQm186zM/F0I1kzrfDiLcis7oxG qt9Q== X-Gm-Message-State: AOJu0YwjUFn+QLZvqDuWkYM1+xKkmVr57rG9CEizw21h+BwyyF22jiH0 AK5tkWJ06bics+fypDJXdHInGQ== X-Google-Smtp-Source: AGHT+IFs3GaRmd7Pr3hi1nz7WGlupkTzFq1qrOY478irGruifUp0BMXMoUkAifEkHNdiYZwmv4PJUQ== X-Received: by 2002:adf:e78c:0:b0:314:1b4d:bb27 with SMTP id n12-20020adfe78c000000b003141b4dbb27mr9815432wrm.64.1694508960129; Tue, 12 Sep 2023 01:56:00 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:907f:4cd7:f0ae:6b2a]) by smtp.gmail.com with ESMTPSA id d6-20020adfef86000000b00317ddccb0d1sm12310028wro.24.2023.09.12.01.55.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 01:55:59 -0700 (PDT) From: Bartosz Golaszewski To: Yury Norov , Andy Shevchenko , Rasmus Villemoes , Thomas Gleixner , Marc Zyngier Cc: linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 1/4] bitmap: define a cleanup function for bitmaps Date: Tue, 12 Sep 2023 10:55:38 +0200 Message-Id: <20230912085541.13682-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230912085541.13682-1-brgl@bgdev.pl> References: <20230912085541.13682-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Bartosz Golaszewski Add support for autopointers for bitmaps allocated with bitmap_alloc() et al. Signed-off-by: Bartosz Golaszewski Acked-by: Yury Norov Reviewed-by: Andy Shevchenko --- include/linux/bitmap.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index 03644237e1ef..ba8c0d733842 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h @@ -6,6 +6,7 @@ =20 #include #include +#include #include #include #include @@ -125,6 +126,8 @@ unsigned long *bitmap_alloc_node(unsigned int nbits, gf= p_t flags, int node); unsigned long *bitmap_zalloc_node(unsigned int nbits, gfp_t flags, int nod= e); void bitmap_free(const unsigned long *bitmap); =20 +DEFINE_FREE(bitmap, unsigned long *, bitmap_free(_T)) + /* Managed variants of the above. */ unsigned long *devm_bitmap_alloc(struct device *dev, unsigned int nbits, gfp_t flags); --=20 2.39.2 From nobody Thu Dec 18 20:16:16 2025 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 366F4CA0ECA for ; Tue, 12 Sep 2023 08:56:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233133AbjILI4K (ORCPT ); Tue, 12 Sep 2023 04:56:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233090AbjILI4G (ORCPT ); Tue, 12 Sep 2023 04:56:06 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2C2310C3 for ; Tue, 12 Sep 2023 01:56:02 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-401da71b7c5so60605795e9.2 for ; Tue, 12 Sep 2023 01:56:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1694508961; x=1695113761; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dp0b1o9g+PpYZByhHPBV5mXBlVfc9hIIqUxUds48fFY=; b=igpTNQAj90LXMnpjJbjaNrUtiqCVkKFA2cuDB+sZpw9reqxf6WDyecoJpRhsRT8T2y uZXjLAO5fqhYJsyDKEMD5E5wOsDiAHEn8cnF3SEn0dLdtT8icU4HdscNmPWWj/aF6Bd7 6SDs3v2YwhQpu4jkefneTlftxpGUFCrbtDgV0UsJawPa2YqRmUKGW1Obn6kSctoPUTkp FlAwU9O32ZsqBK5icuD746fy3EJ0sMsQ32w8v5cekqTGRummBu0scwCDuVpLzlIxdKqu Q3gU1h1SXyrXbeiRvVhtsJ1OAWrJWgVwBsuVq3GPPSY0gVfpCE2kotaQOAbsgyBVugU3 ZwjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694508961; x=1695113761; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dp0b1o9g+PpYZByhHPBV5mXBlVfc9hIIqUxUds48fFY=; b=LHsmOrTe2sc44AweypMPvHTqTE92wYxtzi80T8YWfAD4sOHd05raxUXGReyuCRHUV8 GFlj3nRQWD49HLd3sdxoc2G98Lx90II0cn4zxhhGcov/KtABYySrXanRkt3byGCOM4KH wLbwcgmnaRvw3I5I6E1ADho4xnYMi1S9pErlfYLo1bOmwEJtZuSoVqFTLZRjyJ7sOoHS 1lC++vmP+37OJAVYV/8tyqOvwmn1sdAbLWk4/2kPMCl1pvu+d3msfj4qPWTdjC/OMlIC VozkqbjxBmjr7syIKog/XtyTzlxf9oJeS2KoPLQJ/YJb7EORmu5MscFbzA/f+liHiLeA paPg== X-Gm-Message-State: AOJu0YzaaV0uEqqiD607QB0lO2ULSTXb2x72b5GvqbWRPHcZCi9Su1N9 ICNe3xBu640QL/vdkMEzSJvT1Q== X-Google-Smtp-Source: AGHT+IEGdAuxHqFncTMDy9cwwHgPV2kuOOsPnfdI9pJL2lWPhiJNk5A86SCwm/6/Qez344Ragzz09Q== X-Received: by 2002:a5d:54d0:0:b0:319:8a5a:ab5e with SMTP id x16-20020a5d54d0000000b003198a5aab5emr8294912wrv.38.1694508961086; Tue, 12 Sep 2023 01:56:01 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:907f:4cd7:f0ae:6b2a]) by smtp.gmail.com with ESMTPSA id d6-20020adfef86000000b00317ddccb0d1sm12310028wro.24.2023.09.12.01.56.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 01:56:00 -0700 (PDT) From: Bartosz Golaszewski To: Yury Norov , Andy Shevchenko , Rasmus Villemoes , Thomas Gleixner , Marc Zyngier Cc: linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 2/4] genirq/irq_sim: remove unused field from struct irq_sim_irq_ctx Date: Tue, 12 Sep 2023 10:55:39 +0200 Message-Id: <20230912085541.13682-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230912085541.13682-1-brgl@bgdev.pl> References: <20230912085541.13682-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Bartosz Golaszewski The irqnum field is unused. Remove it. Signed-off-by: Bartosz Golaszewski --- kernel/irq/irq_sim.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/irq/irq_sim.c b/kernel/irq/irq_sim.c index dd76323ea3fd..f5ebb3ba6f9a 100644 --- a/kernel/irq/irq_sim.c +++ b/kernel/irq/irq_sim.c @@ -19,7 +19,6 @@ struct irq_sim_work_ctx { }; =20 struct irq_sim_irq_ctx { - int irqnum; bool enabled; struct irq_sim_work_ctx *work_ctx; }; --=20 2.39.2 From nobody Thu Dec 18 20:16:16 2025 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 88194CA0ECA for ; Tue, 12 Sep 2023 08:56:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233188AbjILI4P (ORCPT ); Tue, 12 Sep 2023 04:56:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233106AbjILI4H (ORCPT ); Tue, 12 Sep 2023 04:56:07 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DB1610CA for ; Tue, 12 Sep 2023 01:56:03 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-401b5516104so56635105e9.2 for ; Tue, 12 Sep 2023 01:56:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1694508962; x=1695113762; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CxpXhgDL+WYT4ZjQ7cMsLe1CH/MZvqWCA7Gdeim4PCs=; b=1dN+zwd9sbyJaqZbbt41SfLR3ySrf4k5uG/AxWM19SHvTAFGUJ7eZCF1EhwG01ydvj BiHujRgbK4saG4AdA1jSFbIEsjA1sDR1UxWzLqCgQ/wMMqWhStXpiw3brRdTPEZjRHcz 74wNypnZVqRHQoUwhj2lQrf1JThLBWzqidFHOik9/BvFrOPuY5sFpgA5uBFXjqJD9B58 kppSpnpHqP4KwyU/ze1sQsvFsWU/u5mxgoDOsaDF9HNNTFpDJ3MZgW6LULmzYqM2an3a xVt1ZzbPFGvxMgqvR2tVGSrgPQ7iLj08xzXjZTMrEC9pLbrkH6hmTS8xaEMa9+XMJ27P UmRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694508962; x=1695113762; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CxpXhgDL+WYT4ZjQ7cMsLe1CH/MZvqWCA7Gdeim4PCs=; b=CmJsEC+XVA/edME1Znrt0XaY1LE/kJ/P/abi/eH/XcWrJqCk2MqLNwf33pe0gTRQzG iS9zFdFRhEdUfZEomoZ4GGVGK2aHtEpSjYJyARwyWQ72tbDo+13OH+VPsL2Lcjj69PYG RLKXX+t7rtT1l9APAfJmUWMxyMKSpyaAgr/AUEG+zFHh7d2RGvR8iYIrOPo5xedVg/M9 FLKjljYa5EOWwmmZRMX7HJDTs6jFk4WabFWZ4L+cNP7zQBkTi3dsNdQXLYyP3hEmIflg KCqXMKYXhs8xMJK25ObBmtTTOGHMq3dmpCO2G268dr9MFE6HnAQPYN1O7ccnKK8jAfkp 3M7w== X-Gm-Message-State: AOJu0YxlhGad3Oxx2h/7UyFuGq5cg61Jhsu8KW8a/wM3DfM0b4uFMN9D 0QJZpYXqHjfO2nNsvebbZdymuQ== X-Google-Smtp-Source: AGHT+IHwVYNadCpGQMP7winv93kpz4rGjYqP/F+H8Bl7Z5RwaFYy/5WX+GP4G96mrTKE18ljwclUiQ== X-Received: by 2002:a05:6000:180b:b0:31a:d450:c513 with SMTP id m11-20020a056000180b00b0031ad450c513mr10252463wrh.26.1694508962038; Tue, 12 Sep 2023 01:56:02 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:907f:4cd7:f0ae:6b2a]) by smtp.gmail.com with ESMTPSA id d6-20020adfef86000000b00317ddccb0d1sm12310028wro.24.2023.09.12.01.56.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 01:56:01 -0700 (PDT) From: Bartosz Golaszewski To: Yury Norov , Andy Shevchenko , Rasmus Villemoes , Thomas Gleixner , Marc Zyngier Cc: linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 3/4] genirq/irq_sim: order headers alphabetically Date: Tue, 12 Sep 2023 10:55:40 +0200 Message-Id: <20230912085541.13682-4-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230912085541.13682-1-brgl@bgdev.pl> References: <20230912085541.13682-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Bartosz Golaszewski For better readability and maintenance keep headers in alphabetical order. Signed-off-by: Bartosz Golaszewski --- kernel/irq/irq_sim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/irq/irq_sim.c b/kernel/irq/irq_sim.c index f5ebb3ba6f9a..b0d50b48dbd1 100644 --- a/kernel/irq/irq_sim.c +++ b/kernel/irq/irq_sim.c @@ -4,10 +4,10 @@ * Copyright (C) 2020 Bartosz Golaszewski */ =20 +#include #include #include #include -#include #include =20 struct irq_sim_work_ctx { --=20 2.39.2 From nobody Thu Dec 18 20:16:16 2025 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 01E7CCA0EC3 for ; Tue, 12 Sep 2023 08:56:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233202AbjILI4X (ORCPT ); Tue, 12 Sep 2023 04:56:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233093AbjILI4I (ORCPT ); Tue, 12 Sep 2023 04:56:08 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A567CAA for ; Tue, 12 Sep 2023 01:56:04 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-31f737b8b69so4880601f8f.3 for ; Tue, 12 Sep 2023 01:56:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1694508963; x=1695113763; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=P0GSkSsBN1wyMRXDMHKAiDApaGJ4YO7Sk/7sv4md1Ps=; b=AxLuEctBWuoOz0QPbt5I6ffnds/54T799jnlbiT7SzW7JS6qbBcaVZJ47hxwcctuFc lypQrNhpC+BcxCqM3g1j25Vx6x8jSaWqzHaEPUc2IIWyM9wnIJQwmQqIGzQkcbJR0302 GPjX4OwXyL49io6wl/El1mAgPei4bq+pruDf+Gf+0I6SHAy/TqvthrPzIUiLZ4Ex+WkJ mxY84AmixdbPewKtXwuD3UTxJxNCALr7e0+VaMJhxjE2yScD83u5NAppWSD0lUtTNFLu 6jtt/oML0RMhoJhzmIhodPxNrffpPBSJSUNhW4WbTcB1OvwWNOCxXJuAYlCD53r4Oe7s v+kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694508963; x=1695113763; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P0GSkSsBN1wyMRXDMHKAiDApaGJ4YO7Sk/7sv4md1Ps=; b=php4qpirTkeJzbMFDNMOBG2xS3uABVN3Fq1BLT5GKi5fAK9JjF5zLiSC8R9UPHAHEx HEdaPsRKsRTiZt1lb+23VWykaq0/Pmi+wUCKHmGl90PE0/AnMut4rqCPwph8CipdBiuD 0o4PJl6CtqgbihTr/So1bNKe2E9DTyxSOWxDBgg2ZdR8gLrRA0IWrD1+nZ9JqLI10J9y ChJQlsPnJKTBVzn3wmSdyfKBmdbsCdHFKSKe2QAh2E2qgF6npxkT2oFYOxbltEb3qJUz yM2rt51F1mWk8gIzf0pJUNTZ7xEPJKwuOTuPT+damOuPcIVMvPcWdjWHMC4bIr+aXR39 RnTw== X-Gm-Message-State: AOJu0YzptXpoxs53Z2TvdtHvD1sPGnT8wYViKiWjlvistgyP8Ee1o85Y 4pk3nFowX/mNqHjJ+dGPbxwjx89/mf1qiICltAQ= X-Google-Smtp-Source: AGHT+IGwDIPkFn64tdiDwF/U8wlhvYO6WZMan4vk0QfnDLhTFT7jlM4KVavq6RZ2aUwvI/tB5zvkew== X-Received: by 2002:adf:e743:0:b0:31f:651f:f850 with SMTP id c3-20020adfe743000000b0031f651ff850mr9470113wrn.36.1694508963002; Tue, 12 Sep 2023 01:56:03 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:907f:4cd7:f0ae:6b2a]) by smtp.gmail.com with ESMTPSA id d6-20020adfef86000000b00317ddccb0d1sm12310028wro.24.2023.09.12.01.56.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 01:56:02 -0700 (PDT) From: Bartosz Golaszewski To: Yury Norov , Andy Shevchenko , Rasmus Villemoes , Thomas Gleixner , Marc Zyngier Cc: linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 4/4] genirq/irq_sim: shrink code by using cleanup helpers Date: Tue, 12 Sep 2023 10:55:41 +0200 Message-Id: <20230912085541.13682-5-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230912085541.13682-1-brgl@bgdev.pl> References: <20230912085541.13682-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Bartosz Golaszewski Use the new __free helper from linux/cleanup.h to remove all gotos and simplify the error paths. Signed-off-by: Bartosz Golaszewski --- kernel/irq/irq_sim.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/kernel/irq/irq_sim.c b/kernel/irq/irq_sim.c index b0d50b48dbd1..24d10267f582 100644 --- a/kernel/irq/irq_sim.c +++ b/kernel/irq/irq_sim.c @@ -4,6 +4,7 @@ * Copyright (C) 2020 Bartosz Golaszewski */ =20 +#include #include #include #include @@ -163,33 +164,28 @@ static const struct irq_domain_ops irq_sim_domain_ops= =3D { struct irq_domain *irq_domain_create_sim(struct fwnode_handle *fwnode, unsigned int num_irqs) { - struct irq_sim_work_ctx *work_ctx; + struct irq_sim_work_ctx *work_ctx __free(kfree) =3D NULL; + unsigned long *pending __free(bitmap) =3D NULL; =20 work_ctx =3D kmalloc(sizeof(*work_ctx), GFP_KERNEL); if (!work_ctx) - goto err_out; + return ERR_PTR(-ENOMEM); =20 - work_ctx->pending =3D bitmap_zalloc(num_irqs, GFP_KERNEL); - if (!work_ctx->pending) - goto err_free_work_ctx; + pending =3D bitmap_zalloc(num_irqs, GFP_KERNEL); + if (!pending) + return ERR_PTR(-ENOMEM); =20 work_ctx->domain =3D irq_domain_create_linear(fwnode, num_irqs, &irq_sim_domain_ops, work_ctx); if (!work_ctx->domain) - goto err_free_bitmap; + return ERR_PTR(-ENOMEM); =20 work_ctx->irq_count =3D num_irqs; work_ctx->work =3D IRQ_WORK_INIT_HARD(irq_sim_handle_irq); + work_ctx->pending =3D no_free_ptr(pending); =20 - return work_ctx->domain; - -err_free_bitmap: - bitmap_free(work_ctx->pending); -err_free_work_ctx: - kfree(work_ctx); -err_out: - return ERR_PTR(-ENOMEM); + return no_free_ptr(work_ctx)->domain; } EXPORT_SYMBOL_GPL(irq_domain_create_sim); =20 --=20 2.39.2