Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1607237ybb; Sat, 21 Mar 2020 02:01:19 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsXIU1Qsu4Vxfn7iDHFz+hQOc+A5ScHGWxYdiWNHFRzq5ZzGXqlaMiBYtNtVLL0j595rILO X-Received: by 2002:aca:cdd1:: with SMTP id d200mr9378814oig.153.1584781279169; Sat, 21 Mar 2020 02:01:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584781279; cv=none; d=google.com; s=arc-20160816; b=Sa9F2vmDec3nkgLmbJyDGRMHYRy1oqWDnaeLZUCcGhXydlmiJDzhKtBHWMpvIdEwod iacfMxhlqve9wnQQvoUGlJ4ncba0JLA6cxZDkHY4prpEgERtoWcbmFTonvzlAFLDPIxD YvC3JcfEwlQsC7SiG00Vds8BzCcEGd7cwcII+Y3VbdlUzcyjdFdVTH2rftazobo2EnEg iuVGZMcdz7gHtJYWLaM8v23JjFshpxQ5QmgktVxLEa4i1tMHp3s1dTYx9NMsKzBiVRui shPKHMfDkaQ9vmQnd6EMAKVjrDbpGWe4PzXvCjJlQw9k+0uQK573DIx9yGiDPRFfgGFy tUow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=3bCxE12mWO/Emym8+NzAiHAn7M99/aqkB3/cyKTO42c=; b=JRxf+fQwjSVXhDFTFdQw/l/BSVDehbl9nJl4H35N8b9abxojHzO3hCOM90FRsZLwCy v4TeUwSaJ6qcsgIWChGUNqVcnR3Rf2q4IrWYs6en80NKBmYrG6XvZw4wQ4PG30jS/Gwd KpqqOkvnYYmKimBif4P4B9byfyxTkKKh21MPXFlQ/r1mUKekhwAM9MO7Rhip/NPzQtZQ 5nuFQZFhtWOOcp2kUK5KZ5jKRffrLsKxa2x8GDMi1YX4ZdcEkPXsyxycVmO1oCpvVGFa wmwHE46tYn5e7q26k1kAWtnG4dtHQm2+8W4Bs3Oq7x9tO3hcdu+VDLfou8q0YEjRYzCE jZ2A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n198si3960942oig.37.2020.03.21.02.01.06; Sat, 21 Mar 2020 02:01:19 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728226AbgCUJAd (ORCPT + 99 others); Sat, 21 Mar 2020 05:00:33 -0400 Received: from mx0a-00128a01.pphosted.com ([148.163.135.77]:42956 "EHLO mx0a-00128a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728008AbgCUJAd (ORCPT ); Sat, 21 Mar 2020 05:00:33 -0400 Received: from pps.filterd (m0167088.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02L8st3n014731; Sat, 21 Mar 2020 05:00:19 -0400 Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com with ESMTP id 2ywcs5rdqx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 21 Mar 2020 05:00:19 -0400 Received: from SCSQMBX10.ad.analog.com (scsqmbx10.ad.analog.com [10.77.17.5]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 02L90HpF049901 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=FAIL); Sat, 21 Mar 2020 05:00:17 -0400 Received: from SCSQMBX11.ad.analog.com (10.77.17.10) by SCSQMBX10.ad.analog.com (10.77.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1779.2; Sat, 21 Mar 2020 02:00:16 -0700 Received: from zeus.spd.analog.com (10.64.82.11) by SCSQMBX11.ad.analog.com (10.77.17.10) with Microsoft SMTP Server id 15.1.1779.2 via Frontend Transport; Sat, 21 Mar 2020 02:00:15 -0700 Received: from localhost.localdomain ([10.48.65.12]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 02L90CUH009329; Sat, 21 Mar 2020 05:00:12 -0400 From: Alexandru Ardelean To: , CC: , , , Alexandru Ardelean Subject: [PATCH v2] iio: buffer: re-introduce bitmap_zalloc() for trialmask Date: Sat, 21 Mar 2020 10:59:56 +0200 Message-ID: <20200321085956.11213-1-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200317123621.27722-1-alexandru.ardelean@analog.com> References: <20200317123621.27722-1-alexandru.ardelean@analog.com> MIME-Version: 1.0 Content-Type: text/plain X-ADIRoutedOnPrem: True X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.645 definitions=2020-03-21_02:2020-03-20,2020-03-21 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 adultscore=0 phishscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 clxscore=1015 suspectscore=0 spamscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003210051 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Reviewed-by: Andy Shevchenko Signed-off-by: Alexandru Ardelean --- Changelog v1 -> v2: * add 'Reviewed-by: Andy Shevchenko ' * re-send from an Analog server; GMail changed the author to @gmail.com 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.17.1