Message ID | 20230920075500.96260-2-brgl@bgdev.pl |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp4074742vqi; Wed, 20 Sep 2023 04:52:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFCkGiTKvXoZCkT0dcEFLLhrzfmmrFhwNFbgESMcExi7Pd8o1sI7zD3/3Iu1t8muWjRu1bS X-Received: by 2002:a05:6a00:b4d:b0:68f:ee0e:95df with SMTP id p13-20020a056a000b4d00b0068fee0e95dfmr2554887pfo.14.1695210767427; Wed, 20 Sep 2023 04:52:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695210767; cv=none; d=google.com; s=arc-20160816; b=vK5NYZCCE2okmeFKdTqSDBLpf/oUl27QzHtNjWLjS62mNFtgIm30WG+IaH2BRzuW8X qJpi4nqVI1HAVrfsHKDIjeXTlmRbbEYjFZLU7rQBdXvFlkFKV6Rv0JbmCwhoPAMtr+pX 6S3WjMAFXUhjuAxqYVGhSobKEFH5aAV4ADN7vymhijtvTGSsOygNqeG0jLpD6dCD6WC3 WyCgr+d1YCGcs7oYhUmspMUzU+5eTC53Dsi3je0tFa6Kknlm4qx3ir+fTquuFxGs0uKN LDubghJ7pnvKHpjt2w7pVjGPVXZhhPbvreNnUlaIDR8awPiHKr+qaniFZOm0fVwaihPX 3QQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7Gea6QOSQ2NLWpWhPeEBkdF1fprl0wRUu4kccc1zIas=; fh=El7U+Cg75FrEsqBKE0pb+XSRaZD7UUWlPElNZyAnAj8=; b=sPrWtQMhIR0FpUunfVMzdK/HvOqhh+R2IpN3h7IRqAIw0x4dglg8x32rfkNJ4xYH5b SiZyzv/eM+Z0TiJf2bVK3h/FDrGMj9mKmygih1+T31adzqxPVPeEhzeLEcG0CVGW5rEL RDHd17iZmfVqrOgR+6Fy5Pczlt4moU7FG1cHY1qDMBJ7AINfbSp4ZgWVHPVJeY79EUxp uoMcH32frQFIg/ujuZySlZnJCb4eHNIYrBQOmWAH0W6BJHJUJ1Kk98mhMsGV80e20lIH LB8Imr4yw3ZjncWUZFOpURLsYCv+NpCaETeUAECymdN0mh9SAdaNHE2TUEFiOGsS8Rl4 t5pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=V9HLwvxR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id 6-20020a630a06000000b00577616e3ad9si11552068pgk.871.2023.09.20.04.52.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 04:52:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=V9HLwvxR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 644C58082A46; Wed, 20 Sep 2023 00:55:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233243AbjITHz0 (ORCPT <rfc822;toshivichauhan@gmail.com> + 26 others); Wed, 20 Sep 2023 03:55:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233003AbjITHzY (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 20 Sep 2023 03:55:24 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CDC49D for <linux-kernel@vger.kernel.org>; Wed, 20 Sep 2023 00:55:18 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-501bd6f7d11so10971139e87.1 for <linux-kernel@vger.kernel.org>; Wed, 20 Sep 2023 00:55:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1695196517; x=1695801317; 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=7Gea6QOSQ2NLWpWhPeEBkdF1fprl0wRUu4kccc1zIas=; b=V9HLwvxRTweU+a50Wkz4o4BFDzPH9CnawZw1yGkVeYUiTwUaDPx+xJNwiyhsxm3uLG 3Oi0LaSR3wGqky48xBmWngQqsPggHBsGPqFNBYtSoEQ7IyjD1T5iaopm2ge27j/TCAx/ a6xeMP4eUbtP0uD1H/y+rwSupXuTX6VLHo1g+IUi4nixE4VjIBhOy3TlXjeBu/ojdKlm cfcuu015LeXrwXg46D/GjP14KD3jZflrGsXeASC+mCVxBL97K33NSHnLYKJYQH9hWJzE bJhclFsR3dI+QsW5OxMRWUaowbU49TZYCXi95/eHRePi9Cfvv/msrGRPgI8K8uOhHW72 8s/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695196517; x=1695801317; 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=7Gea6QOSQ2NLWpWhPeEBkdF1fprl0wRUu4kccc1zIas=; b=Owxe9yvN1gDuD+5XUwU4tpVFqt5du2vnNfznrjUyd1A8fa39KxlqhASBJCoD7FST6r SgHBx5yR+8nYtUfjebBD9A09WjLdnrEXAa7+t8XZHJ2nwnEjUr9MMrjS7086VMvr2+Eo HABSoHyLRcrOXmbQZkpCs0pe5AQm5fOAlJ3oQAdzy90ywZRQJSlIHJFoOFfMl6WV6Z4H Oqsp672HPdzHwLGx7IPK50RAReGSJ+z0bZlg0PuMusitRwXQMcXgTYr9/Cds9nQpRe2C hI2LjpWA+pVMEqkbPEcsqnI7d8z//MsickVRnw1aVWRX1hqnx7FrcfZQWxZcIzfhE3UP gSuQ== X-Gm-Message-State: AOJu0YzWNYPg4MfKVHaRxsLhMD2A2DB+LitK3PtQQ2/q6aZezE0I96tE du037uqcxRknh9j4tJtsljfemw== X-Received: by 2002:a05:6512:ea1:b0:500:95f7:c416 with SMTP id bi33-20020a0565120ea100b0050095f7c416mr2078432lfb.7.1695196516473; Wed, 20 Sep 2023 00:55:16 -0700 (PDT) Received: from brgl-uxlite.. (static-212-193-78-212.thenetworkfactory.nl. [212.78.193.212]) by smtp.gmail.com with ESMTPSA id d9-20020a05640208c900b0051bed21a635sm8481981edz.74.2023.09.20.00.55.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 00:55:15 -0700 (PDT) From: Bartosz Golaszewski <brgl@bgdev.pl> To: Yury Norov <yury.norov@gmail.com>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Rasmus Villemoes <linux@rasmusvillemoes.dk>, Thomas Gleixner <tglx@linutronix.de>, Marc Zyngier <marc.zyngier@arm.com>, Peter Zijlstra <peterz@infradead.org> Cc: linux-kernel@vger.kernel.org, Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Subject: [PATCH v2 1/4] bitmap: define a cleanup function for bitmaps Date: Wed, 20 Sep 2023 09:54:57 +0200 Message-Id: <20230920075500.96260-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230920075500.96260-1-brgl@bgdev.pl> References: <20230920075500.96260-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 20 Sep 2023 00:55:34 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777557326016279839 X-GMAIL-MSGID: 1777557326016279839 |
Series |
genirq/irq_sim: misc updates
|
|
Commit Message
Bartosz Golaszewski
Sept. 20, 2023, 7:54 a.m. UTC
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Add support for autopointers for bitmaps allocated with bitmap_alloc() et al. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> --- include/linux/bitmap.h | 3 +++ 1 file changed, 3 insertions(+)
Comments
On Wed, Sep 20, 2023 at 09:54:57AM +0200, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > > Add support for autopointers for bitmaps allocated with bitmap_alloc() > et al. Haven't I given a tag? (Probably this is significant change...) Whatever, Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
On Wed, Sep 20, 2023 at 09:54:57AM +0200, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > > Add support for autopointers for bitmaps allocated with bitmap_alloc() > et al. > > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > --- > include/linux/bitmap.h | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h > index 03644237e1ef..6709807ebb59 100644 > --- a/include/linux/bitmap.h > +++ b/include/linux/bitmap.h > @@ -6,6 +6,7 @@ > > #include <linux/align.h> > #include <linux/bitops.h> > +#include <linux/cleanup.h> > #include <linux/find.h> > #include <linux/limits.h> > #include <linux/string.h> > @@ -125,6 +126,8 @@ unsigned long *bitmap_alloc_node(unsigned int nbits, gfp_t flags, int node); > unsigned long *bitmap_zalloc_node(unsigned int nbits, gfp_t flags, int node); > void bitmap_free(const unsigned long *bitmap); > > +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); Acked-by: Yury Norov <yury.norov@gmail.com>
On Wed, Sep 20, 2023 at 3:50 PM Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > On Wed, Sep 20, 2023 at 09:54:57AM +0200, Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > > > > Add support for autopointers for bitmaps allocated with bitmap_alloc() > > et al. > > Haven't I given a tag? (Probably this is significant change...) Whatever, > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > > -- > With Best Regards, > Andy Shevchenko > > Yeah, I dropped it due to the NULL-pointer check change. Bart
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index 03644237e1ef..6709807ebb59 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h @@ -6,6 +6,7 @@ #include <linux/align.h> #include <linux/bitops.h> +#include <linux/cleanup.h> #include <linux/find.h> #include <linux/limits.h> #include <linux/string.h> @@ -125,6 +126,8 @@ unsigned long *bitmap_alloc_node(unsigned int nbits, gfp_t flags, int node); unsigned long *bitmap_zalloc_node(unsigned int nbits, gfp_t flags, int node); void bitmap_free(const unsigned long *bitmap); +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);