From nobody Thu Dec 18 20:24:54 2025 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5EC73A8FA for ; Mon, 22 Jan 2024 12:42:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705927374; cv=none; b=OIPz/rK3tYtDetGWmPPPTD8f/Gf60WhKjTbz7b1Ty4oGV6bC3pDSmE8C9O21wQ2a/S4p2W0bC4OiyOWNYUMpOTSZJ/1VVAwHfhCdUO8gnLWjK/2ogn2p7p8DN12HVTduBQpm7ohO0BdqYitKu4xWc18MJLoksitHkRqxsytH+BU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705927374; c=relaxed/simple; bh=qQusp98fDKL6XEvrEMTBwUXyqLgUpEHAm5Bh8eE7yXI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CklYkLozK0bqvzrqGtMfe9eYjNogXVfZCS26mJJDMa6sAmLdXBji72480kZQm/yZoithybMq/JITsPA6kEfr02MBWM397AnLee/bfPakkph+ceQAta+8kIXzU7+yuzJ+LuUhaIhekLKd1kdTJTYK7b0KoRFYEls2xY9gF5//rRg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=DRinTAZ3; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="DRinTAZ3" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-336c9acec03so2735684f8f.2 for ; Mon, 22 Jan 2024 04:42:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1705927371; x=1706532171; 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=7ckRu1igyABT1yYhLwRfuP0jDinbnZSUDI6tIkabXps=; b=DRinTAZ3xgOHKEbGgqhYJWvKQGMkhGJ4shMjR9jixxJ6wHeT3fvP+NQ7fFFEX4xvgm s6GZGLzaqQbvJMwGsMMyzBMcx51wsAfUvDew2GvVgjmGtcJlwlYCFhjm4DYxhXi2zBkK Zwpb/rVOnd9AUt4mGrj8MeU0Heb0GTPqph6xQ6eRBWcPzrTDi//8Dazknyi4PzJN4mle a6AinRoVkiEjQFtFnliRhY9EmVfHHcXb0FUM6ksEr8LKk17AhKTg3GizMJ6jsW3U6mRA 0w9NB7IGdzS41UutL7rpjia8BX9EFrLU721IWQ4mblLVWWo60FiJa83Pe+yAZNa6aW05 MrXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705927371; x=1706532171; 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=7ckRu1igyABT1yYhLwRfuP0jDinbnZSUDI6tIkabXps=; b=shuqlc0zxH3LQWMsQCmwrNwDrlzfDENRzez6wAPUXGIZzsZK8CCGhDToylRMPBEl5M +fQJAWlrf536CG3AdYlod3ZFoIJ3rCOrfNUw5UaTvVW2uKgdrR3IlTG7rWlqJjOsc4+a Z20FMJ2h5EK0niGq3vKBbyA5qF3IOwWXTUuYK10fv5ZtEdwXLcMTHRc5J6NGclt3duiC Ey0cVj/NlaRWPx/3xma6EtOeYPnwneeOWGVaTIpF2e8Oc0qM5VsQ3zsruGZtjJcsE6u1 ahcUns8lWmSc0qAbFPDyFss9Anfz3eAbzkXtLMhwqFtb5V6WzsrlFic6PtQvgyQRHIC9 4oSg== X-Gm-Message-State: AOJu0YxWVCXbGQNmToao6Vg/BNcr/X4Qixr1/Z5fqPYbFCdXKUP6+Sc/ t/VB7UR1fAYz8vQc/heRNnwszm4TLIXINiY10W01D6hLKsQ6OyGIQaXSfYPFnG0= X-Google-Smtp-Source: AGHT+IHq/0RLosd/FyFjcYflErcXHe9D/2h7BZNC8le4JLun+bCTbAADVzuruPdOyXA2CdEbBWQ3qw== X-Received: by 2002:a5d:46c8:0:b0:337:beb7:26fa with SMTP id g8-20020a5d46c8000000b00337beb726famr2082884wrs.87.1705927370832; Mon, 22 Jan 2024 04:42:50 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:92a0:6172:d229:1898]) by smtp.gmail.com with ESMTPSA id s16-20020a5d5110000000b0033763a9ea2dsm4671771wrt.63.2024.01.22.04.42.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 04:42:50 -0800 (PST) From: Bartosz Golaszewski To: Yury Norov , Andy Shevchenko , Rasmus Villemoes , Thomas Gleixner , Marc Zyngier , Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [RESEND PATCH v2 1/4] bitmap: define a cleanup function for bitmaps Date: Mon, 22 Jan 2024 13:42:40 +0100 Message-Id: <20240122124243.44002-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240122124243.44002-1-brgl@bgdev.pl> References: <20240122124243.44002-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Reviewed-by: Andy Shevchenko Acked-by: Yury Norov --- include/linux/bitmap.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index 99451431e4d6..df24c8fb1009 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h @@ -6,6 +6,7 @@ =20 #include #include +#include #include #include #include @@ -127,6 +128,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 *, if (_T) bitmap_free(_T)) + /* Managed variants of the above. */ unsigned long *devm_bitmap_alloc(struct device *dev, unsigned int nbits, gfp_t flags); --=20 2.40.1 From nobody Thu Dec 18 20:24:54 2025 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7ED373A8FC for ; Mon, 22 Jan 2024 12:42:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705927375; cv=none; b=KJj1TQIt2+vLcoyyji35sOqG8oAJ1IlE6m5O5nfFLHgzlEkPgH3LlptA+IDgpReoN2P6yIg8jgP0DwmgOAJCskz9LZ+lRf+rXaqNjlw0Ken82++1j16qEDtV7WI8IB5v3I2axsuV/U77zrgjgs8eKzcxt/xJjq7BF1iUxxGdJKo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705927375; c=relaxed/simple; bh=/HB819CWl4exgAM4x006PP6pwpOtqG44H5UW5U3dNEo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qiBzabl0A+lFysjUZc0BLBnp0v6bQtmdNybFkD1izmY9qBX7Li/spvLkkJuvPhyPiutdqWwmow2TZxQ/AB3rO5gIh86DkK7L55oA0u5wjGw8ZGVsoGwANjP0FdWy+j515bM0RrEimJ8zhFCwdKUqjioif6Oao3UhaT3KIHPy39A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=LZcacmy7; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="LZcacmy7" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-33921b8988fso2730436f8f.3 for ; Mon, 22 Jan 2024 04:42:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1705927372; x=1706532172; 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=lhF5NthBM2Es9ERveXoYfwPd/Rxqijhgw0U1wdCYWbU=; b=LZcacmy7w01LTQF6ui7k5qp0fGwlwl5Grol2p0UgAeOla6sc/iyC8/dliNEdG4kvb/ /c7HeCwywnS38bxSxF9q1sKgE+3WzIdOfsyRpv3xIcWSO1X0l6AVUqBJtgpYItn8LIHu CSvEZ1KDwQyZWGDyY+ORI4CH4FrW4L0hk//R0WYqULcWFgEakD7uvjaujSdIGbckOds+ rGba3Ty31Vx7+5uoAtnNEHbgDXkk4xQpU0ormtzWhUEAJB04XeFT0ThMu37IYeYpSgnv 2qCxP5Yn+lBPiF+Mk81+wbqpoklykSP45Tmw1mU6/0/SNy3baXo0NO3qcOMpJeXRNrUo ndRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705927372; x=1706532172; 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=lhF5NthBM2Es9ERveXoYfwPd/Rxqijhgw0U1wdCYWbU=; b=LKRho6fx/Cn0elrGdYjTOKkoVOe9YhZLUyYiF162AIvFAMQkLsAwZILDyeDsQXahcu o71rEvZM4SgottT+1/gJ9skcvzApzbZUvihhbIm+GZaM7TYNMHPN5yyEePW5ibSLhXgU 7jEFoHOefrYpPWtddqM5jLHhRofHV01gLzF29UBg93hTICOwUzUtqIADGsdomamLmsPN JvubsP4Z2urezYaFlOeWUJFcoC7zeJGQgW65mz+YBMxSaTHYnqqJYfv/DQuJcPCMZ1zX ZNgJ82lpDWeAzwVoo7AIW4Q1iVKk1BZp8413xzEcrLlXbsrZp3bUMtAFHjsN5TQZZB0S wtxA== X-Gm-Message-State: AOJu0YzIhtiVupxYhqtkOTO69Arjsaq/aeyGtX9z1Cv65h2WvEGsKmrm qT1cnLTAfxP2h9PaWUyOhveA2TCFHnKPTlPCh40EiVWJJtQvZbGREfLckmZBZYA= X-Google-Smtp-Source: AGHT+IHetdjgfjLx+FUl/hYVY74FiBlnQC4qW30Vb86Cj/TzXcQH8909ffBu6LbW12K1CVDXPUBSxQ== X-Received: by 2002:adf:e8c7:0:b0:337:5997:a4f0 with SMTP id k7-20020adfe8c7000000b003375997a4f0mr2179168wrn.9.1705927371693; Mon, 22 Jan 2024 04:42:51 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:92a0:6172:d229:1898]) by smtp.gmail.com with ESMTPSA id s16-20020a5d5110000000b0033763a9ea2dsm4671771wrt.63.2024.01.22.04.42.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 04:42:51 -0800 (PST) From: Bartosz Golaszewski To: Yury Norov , Andy Shevchenko , Rasmus Villemoes , Thomas Gleixner , Marc Zyngier , Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [RESEND PATCH v2 2/4] genirq/irq_sim: remove unused field from struct irq_sim_irq_ctx Date: Mon, 22 Jan 2024 13:42:41 +0100 Message-Id: <20240122124243.44002-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240122124243.44002-1-brgl@bgdev.pl> References: <20240122124243.44002-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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.40.1 From nobody Thu Dec 18 20:24:54 2025 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6555D3BB53 for ; Mon, 22 Jan 2024 12:42:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705927375; cv=none; b=B00HtxYsAbaLmsVn7bosVYxR+if3EcnzTTg+a8VZ5DJFj6xb+iL+tTF5NOr7oSwaRlTTpSH9wRKwT1OvovVhPyDDdrfhFCdi8oRqqgWOVgCa+tP7ynxeLRC/DqHLg3Wdq0QLpIKqwR69GgBFCUm/LtjS4Ui37cU0cNTk2RwkNAs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705927375; c=relaxed/simple; bh=9fJ4/jNRWyPrbuUW72vI7e3jpNHnk7E37fo/n+TK37M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZicOzTg7PMAkWOzuoE7mkV/SnTFNu/jq+MFl/t5sQ4QmOi9tQ8VTopcGoYuQk1ctFxR4tVT2udSfENXlD5XpxqtQFZVXNEMjU5w4pAz2GxLlAty3Mi6WGCC95HnyiBrzeJQbLDw2AdF+cDiV4HbqmsKDgQOH50Toppr+DRJzzto= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=ahb0gW2h; arc=none smtp.client-ip=209.85.221.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="ahb0gW2h" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-337b8da1f49so2823357f8f.0 for ; Mon, 22 Jan 2024 04:42:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1705927372; x=1706532172; 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=/MictaQTnmuvgryOODFf0I7jgiEaNRAnJ9k//p/ysG8=; b=ahb0gW2haOeMlYJt5yF1wDDHjMrVnkuCalbZq/lvGRfvLoWhU9c5CYQm6ZmYIDFuYo i/0fd9OcmHuvms/G8YAtZofSZCBgA+BftzszQ0wjFObugTlT3aF9SZI5T7liOqHkhP44 1e0Wo5FI1hL1xLvMp4In4Rx7AfCPeNVY2nB5KFw6XfCztR0jJcM8ugISkTkHhfSTr+bh swTUPm6WZyxpEfeoY15adIMbPiwh0PtsqOxQPfTQdkVtXPN1m69Zmb8GDPSqibJkjkxJ hkoauhjVAazeeDePaE/y7JD3mHtSPx4OpYzG3wsTKSYKtXso+UWb93Ea3Ix0DHfXdY42 117w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705927372; x=1706532172; 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=/MictaQTnmuvgryOODFf0I7jgiEaNRAnJ9k//p/ysG8=; b=fzJs1AYwdAOPiqMa6tzxgM942mwQctBkfE4LT6B4EtExZPDsB5vvYOpQoFkUmSTjWd vVMXcihLOv4OJOJttrN+sB0aAmBEE4gg7PMnReIFtPQ5rgEhyCuqL2TNOfrQQQ3NHtdE FnqSQZONzJ2/jNthtmXA6hXVIEYg3ujKbwBXvwbATZ4Tr6ls2nD+46yupx35B/LlZJ1p ZXGHYkOOg3ixL5tidSRWOtAc0mi4tBKJIHYX0bPmS+6spA+2mjkmQoEjXKLTsa9M8U/D DCwbqRe1B9e151+voajAPHVGVbcM9y5RfyYnkWiKCb2IITUM992iSMevtU+u/kWYIOy+ sRFw== X-Gm-Message-State: AOJu0YysVkedXEWvwp2Q1yB/D+H1FLo9oNq2m5EGT4dhgRC3qkiVKBlG 9c6uw8OmrpxWHbX2Kl0pX/4IsB+Z+mtvATopuxk1YIod+g1PVoEVSDrpSHSi8tGwq7L7GPPw4bx + X-Google-Smtp-Source: AGHT+IE0+45bDml8pUn31f1SmdUtpKu3vmX9W3rERBPjH+HjfaGbgeJL0jzLzOvHzsTPy6WU1lPRdw== X-Received: by 2002:a05:6000:71a:b0:337:9b5f:95 with SMTP id bs26-20020a056000071a00b003379b5f0095mr2234682wrb.133.1705927372693; Mon, 22 Jan 2024 04:42:52 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:92a0:6172:d229:1898]) by smtp.gmail.com with ESMTPSA id s16-20020a5d5110000000b0033763a9ea2dsm4671771wrt.63.2024.01.22.04.42.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 04:42:52 -0800 (PST) From: Bartosz Golaszewski To: Yury Norov , Andy Shevchenko , Rasmus Villemoes , Thomas Gleixner , Marc Zyngier , Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [RESEND PATCH v2 3/4] genirq/irq_sim: order headers alphabetically Date: Mon, 22 Jan 2024 13:42:42 +0100 Message-Id: <20240122124243.44002-4-brgl@bgdev.pl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240122124243.44002-1-brgl@bgdev.pl> References: <20240122124243.44002-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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.40.1 From nobody Thu Dec 18 20:24:54 2025 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C3283CF7E for ; Mon, 22 Jan 2024 12:42:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705927377; cv=none; b=GjwqrNUupvSNf1BW/Yrsd+Ax5gsx1uOmhFZIKhC3JgeohK2tSuAfkcD8AZEPNgnxmbCdqhE5F7amG603DFp7eSLIx4Y7vjoyXYATsMhaBR2mjnqMfEZ0I0tTw6NbtvyP+anQZxPZs9QVyIrXwbYgSqm17FpMmCac5b+Ki6mlXU0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705927377; c=relaxed/simple; bh=fGUJHqKDbHbau/baYI1WJnLw0RqVDU52GxAaio5Tj4A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pOyDM8g45xvsbkwoiCaXUwuEmh/NTgEW4C2Uvdg4fB4wHy6LfOqL2yK8VkMaK2k4p4/xcJOaea1Y+hv+u973eMy8jfpZGDBB7upsmhFOBIgHn215l9MGh9TE/sEk4l7YjQKwkmp+/3ItIUEESJHWscxNkJgT7sO36cnZcI56mg4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=ZsupBBYv; arc=none smtp.client-ip=209.85.221.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="ZsupBBYv" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-339261a6ec2so1742383f8f.0 for ; Mon, 22 Jan 2024 04:42:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1705927373; x=1706532173; 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=DcMpSzqjutwlYPIEdiYUpdYZXwsHBg8m+KC9MOwgURk=; b=ZsupBBYvENiuYr+21KQ1yRv22pSfhiL7e1geqUl1lKekMj/Wrkqmw+nuKzlCg0nvV6 zwLRE6uoLMi/1QZ9qYRCj4iDEaqF49ltX7TtwMOSHh05yMjxxVhixpcOLi+hHGFz+x26 Fxt8TM0gpZlm94XjnSmqnphQ+P4ZdOOexwehMnD57l+Ms7JJuzH2HdIiCiKkxzZi9V8K TtCK6vdMv5vfohZ5MiEv6ae9wy2kE0iOqvEKV++OA6acJ18VCAtQe4wDTaUE6R9+XI2O AJ4mTDLol2gdG3LHMfHCvdbE26JF24QcX5jVHRXRA9vCQajRMOML8W3FHybaX9lS0+ZC o+Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705927373; x=1706532173; 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=DcMpSzqjutwlYPIEdiYUpdYZXwsHBg8m+KC9MOwgURk=; b=AFenLOctWCu7vT7LdvX+0D348x7+skb7osLgXsvETm0UC4MouHE3TXeQ1OlKNYGvOM uHC44Z/VysfcGdP6NBQmweZVEeY818IIvV0kfD0nEuFL+wGX9G/pilX2i9ik+/t9UCBS CIh9s+wWozkWaQdrqajlq4W8z7EoDTjFY7/Sc6dnvf/PMEzfgvp5KdRMauWV02fx764/ bTkAgLesxrL8qeTmJZqXjdCwGPnBVYad+uL6q+BpTVC9a0QtXQom4T7bvP/DVS0B4Mc+ sT5Y4NYVgm83kJ0fK0OvC7sj0IMXMN5KZ7yd4rWnIP+VFoLrMaLd7t7E6rabh1VZFZUt cjSA== X-Gm-Message-State: AOJu0YxVEm6uVk+E2FdKvqtksrhX53KA/EDTZvwJ8vW8EoYyQ9uPfcQM i1NPlfRLQg/AIo/efBFio4Dh6eZI+x+LPpN6JZVrwH/o8czBf9S5Wtv3c/xkrhA= X-Google-Smtp-Source: AGHT+IH22P6MqrwZ/7q699Gv8A2fIErhhA67HcT8Go3fyXfYSzeWRuON27J3QBW6iiyxcJTPhmH4Ng== X-Received: by 2002:a5d:4e46:0:b0:337:bfc8:588 with SMTP id r6-20020a5d4e46000000b00337bfc80588mr2231237wrt.125.1705927373588; Mon, 22 Jan 2024 04:42:53 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:92a0:6172:d229:1898]) by smtp.gmail.com with ESMTPSA id s16-20020a5d5110000000b0033763a9ea2dsm4671771wrt.63.2024.01.22.04.42.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 04:42:53 -0800 (PST) From: Bartosz Golaszewski To: Yury Norov , Andy Shevchenko , Rasmus Villemoes , Thomas Gleixner , Marc Zyngier , Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [RESEND PATCH v2 4/4] genirq/irq_sim: shrink code by using cleanup helpers Date: Mon, 22 Jan 2024 13:42:43 +0100 Message-Id: <20240122124243.44002-5-brgl@bgdev.pl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240122124243.44002-1-brgl@bgdev.pl> References: <20240122124243.44002-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/kernel/irq/irq_sim.c b/kernel/irq/irq_sim.c index b0d50b48dbd1..82b7b5051249 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,27 @@ 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; - - work_ctx =3D kmalloc(sizeof(*work_ctx), GFP_KERNEL); + struct irq_sim_work_ctx *work_ctx __free(kfree) =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; + unsigned long *pending __free(bitmap) =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.40.1