Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3742664ybh; Tue, 17 Mar 2020 05:53:40 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs1bz+gZktdoK7r1NPH1c+462/L0A6PayKrnuxTU/0YvCSG9rm3UOe3UG66wjOSklq7m4eT X-Received: by 2002:aca:4d8:: with SMTP id 207mr3199172oie.70.1584449620283; Tue, 17 Mar 2020 05:53:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584449620; cv=none; d=google.com; s=arc-20160816; b=AVRr44G5bIKT9zzkyOrNLNTj8HqjP6kWbeWka9Yf4vousqk4xaBxJ15GacNSsDNjCk 7VRj3PqP6xXB7Mlfl26bU1+SsgwrGC2c8j47uBbdpaaxL635cf/gPRt1Y+aQwPQqARrj 8LZ3b7GEpsCYk9yV2bwnUHjgL+2sM88GKbGBRHyKnhpjpw4YHI9zE3L0+K0BUMip7Qyb BPaqhS8X5fFuvJFXvNmxkHPTvafVgOzBjysmE7KY0B73Sny+/awg9SXWiclgVwcvIkj8 aCiA8Wbu5H2IC8S7SkwIlb3xl+vMosRtvHzGvJO5GSsWCv5BJsAVGqa9dkbBK+7vCY0/ ryOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=y3n5d65SaxS3TxI1NlzzWNvBtjTvJbjB+IeAy+HNOQ4=; b=WTpyoSh/7xcGAf28zlOjwzMp41m19MDjVWUD3z0FLaxh7sUfw+z7Ij+saQAbSdQyLN c4iQn0ALFaliVEpzGtfngO/WU3XCnU6By+TuzNyKUc4GwBsiVhvowKgiznbl+pjJBdkb bF0I1vnMNhX1bYrx3uTnF9XUyQRfRXdRIaMvKh3M7SbZ9X24Dhp9FXDLG9MpeIsv2ovT SfY9TqosgCBcwxjtOLlPlMpdTnm6/LBP/CfpO4k/eLVKgIijrSr8Xz81UtlrVQLT6Q1R vyhyHyststN9r98amYqpU+WwxtxxMH61edeoc2SM1azEt06UlNuM1P2HvzfhrD89NHvb qc/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 63si1745187otl.86.2020.03.17.05.53.27; Tue, 17 Mar 2020 05:53:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726157AbgCQMwY (ORCPT + 99 others); Tue, 17 Mar 2020 08:52:24 -0400 Received: from mga18.intel.com ([134.134.136.126]:64540 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725794AbgCQMwX (ORCPT ); Tue, 17 Mar 2020 08:52:23 -0400 IronPort-SDR: HhErm2z9RVL1gIquMreT5oktdmOuTdb5Ulq7e/WakwBHfwEFCtgYLtU13kD87rLs8sei3WuC3N Z++00FWGYRdA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2020 05:52:22 -0700 IronPort-SDR: agMZD3CRjW1p6dDuFc80F0YaKgfJXV7/sAUsP04jLr1wQHbR/NzTkOFYRfFj/SpiZGhURdfcqz puLd4E60LzjQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,564,1574150400"; d="scan'208";a="236318784" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga007.fm.intel.com with ESMTP; 17 Mar 2020 05:52:21 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jEBhn-00ASUo-Gs; Tue, 17 Mar 2020 14:52:23 +0200 Date: Tue, 17 Mar 2020 14:52:23 +0200 From: Andy Shevchenko To: Alexandru Ardelean Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, jic23@kernel.org, lars@metafoo.de, Alexandru Ardelean Subject: Re: [PATCH] iio: buffer: re-introduce bitmap_zalloc() for trialmask Message-ID: <20200317125223.GC1922688@smile.fi.intel.com> References: <20200317123621.27722-1-alexandru.ardelean@analog.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200317123621.27722-1-alexandru.ardelean@analog.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 17, 2020 at 02:36:21PM +0200, Alexandru Ardelean wrote: > Commit 3862828a903d3 ("iio: buffer: Switch to bitmap_zalloc()") introduced > bitmap_alloc(), but commit 20ea39ef9f2f9 ("iio: Fix scan mask selection") > reverted it. > > This change adds it back. The only difference is that it's adding > bitmap_zalloc(). There might be some changes later that would require > initializing it to zero. In any case, now it's already zero-ing the > trialmask. FWIW, Reviewed-by: Andy Shevchenko > > Signed-off-by: Alexandru Ardelean > --- > drivers/iio/industrialio-buffer.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c > index 4ada5592aa2b..5ff34ce8b6a2 100644 > --- a/drivers/iio/industrialio-buffer.c > +++ b/drivers/iio/industrialio-buffer.c > @@ -316,8 +316,7 @@ static int iio_scan_mask_set(struct iio_dev *indio_dev, > const unsigned long *mask; > unsigned long *trialmask; > > - trialmask = kcalloc(BITS_TO_LONGS(indio_dev->masklength), > - sizeof(*trialmask), GFP_KERNEL); > + trialmask = bitmap_zalloc(indio_dev->masklength, GFP_KERNEL); > if (trialmask == NULL) > return -ENOMEM; > if (!indio_dev->masklength) { > -- > 2.20.1 > -- With Best Regards, Andy Shevchenko