Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp2313633img; Sun, 24 Mar 2019 05:36:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqydpsbWVPu5ZzaUnhSihJyHuZLG9wtjn8R1ctaYsKSMHx4QoZ36B/OiDUvUN5goFaj3KeAE X-Received: by 2002:a17:902:848c:: with SMTP id c12mr19576350plo.207.1553430967952; Sun, 24 Mar 2019 05:36:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553430967; cv=none; d=google.com; s=arc-20160816; b=0E4347g9bYEO/QePijyzrxJp1eUIJ5uluvNzw2/76nl2jtpaskFCFvuYcX4jWUPy4W YEiWwuttZ3yE/lAwHiW31ndPzEXnew10eURpOd1FskJw07Fkx3n969cSUMGwkjT+hEyA Bio9BEKzy+Ba2xzoVQ2iWjmcTjzkdG2QqRKkcphx/FG4m/7QIEvJqG86vRfjh2Bbtev7 +2yAnlM8Rd+WXQweeVGpRj1SUmQN60oASFbPrsK+Z8FI5wTa19z11O+5u0ZbPxwiaeno Jo7O6KDpeLUlh0AyVJ9s2rfGEOcNzsAqt6bCS17wNynlewiYcjc0z7mFGCaHrkPkkcPs FFPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=NC8OWzy4u0St8A0u5LHqTZpqB/w7u3MwwGw94ioS00w=; b=i99dAtvIBy+cUCLbJbqcMY0u/MNOYTYyT8PXfv+lFImsFEj8llk7L1kBttII3LqdPV V/ODMDw4DsLNxDEuxjrtcgY9sAUCyCe0K3cG3iYQBLdmlRZWq/E1j0TjU0RmimyEngDP hEGNs6Xo/9xofyiq3p6qA8DlcPidgI7uPAQKIIoQGqlQ7/mcnCWmW9lMvVD2HReESbW0 dTazx1taYoTqmXRekitpiuRi5J6OBSmdAg6xfAFvU2Gpnv12ALV/dm073HR0M+9f7E5U 89nRbtVji3OUD4mdbeAV+/d7O8XpGfrYWJe8gEz+yCcxXKNTCFetCw6/ACIxftmO0dCa I0sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HJJB0NAH; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1si11518275plt.318.2019.03.24.05.35.52; Sun, 24 Mar 2019 05:36:07 -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; dkim=pass header.i=@kernel.org header.s=default header.b=HJJB0NAH; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728741AbfCXMe7 (ORCPT + 99 others); Sun, 24 Mar 2019 08:34:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:50658 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726963AbfCXMe7 (ORCPT ); Sun, 24 Mar 2019 08:34:59 -0400 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3DF19222D0; Sun, 24 Mar 2019 12:34:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553430898; bh=veioUJlORlYBTD0o78zA7HRfOnNX8Cm8kLcrUfsYtD0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=HJJB0NAHSx6ijrqAY2K4y+cwOeuyB3IX/ASm2ytXDH3qdJ7K3HJ4S9VZya9AQFQBC FRR9H5FGqKfEPwXX9Gx9W1NFmOUNFnYYGsnLn6oSGrHyA+2x7v1s2egm5+5T4HK4aj 2FBzM40yfDhcmD16zp8xYK6iMXLiCXhF/wY8RAcU= Date: Sun, 24 Mar 2019 12:34:52 +0000 From: Jonathan Cameron To: Cristian Sicilia Cc: Lars-Peter Clausen , Michael Hennerich , Hartmut Knaack , Peter Meerwald-Stadler , Greg Kroah-Hartman , linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/5] staging: iio: adc: Converted bool to bitfield format Message-ID: <20190324123452.66b81183@archlinux> In-Reply-To: <93b82557f3610f4bf4d09d0556e502b418376420.1553366098.git.sicilia.cristian@gmail.com> References: <93b82557f3610f4bf4d09d0556e502b418376420.1553366098.git.sicilia.cristian@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 23 Mar 2019 20:21:39 +0100 Cristian Sicilia wrote: > Changed bool format to bitfield format to save space. > > Signed-off-by: Cristian Sicilia > > --- > The strange thing is that this struct seems not populated > using a DTS binding function. Indeed and that should have definitely been a warning sign ;) We are looking at traditional platform data here (pre device tree) and generally we will want to drop it entirely for old drivers that we are looking to move out of staging. I don't mind improving it prior to dropping (as it avoids setting bad precedence in the code base in the meantime) but one comment inline... > --- > drivers/staging/iio/adc/ad7192.h | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/drivers/staging/iio/adc/ad7192.h b/drivers/staging/iio/adc/ad7192.h > index 7433a43..87891ba 100644 > --- a/drivers/staging/iio/adc/ad7192.h > +++ b/drivers/staging/iio/adc/ad7192.h > @@ -35,13 +35,13 @@ struct ad7192_platform_data { > u16 vref_mv; > u8 clock_source_sel; > u32 ext_clk_hz; > - bool refin2_en; > - bool rej60_en; > - bool sinc3_en; > - bool chop_en; > - bool buf_en; > - bool unipolar_en; > - bool burnout_curr_en; > -}; > + u8 refin2_en:1; > + u8 rej60_en:1; > + u8 sinc3_en:1; > + u8 chop_en:1; > + u8 buf_en:1; > + u8 unipolar_en:1; > + u8 burnout_curr_en:1; > +} __attribute__((__packed__)); Please don't use packed for anything without a very very good reason. it may result in data layouts that are much harder to read from. That obviously doesn't matter here as I doubt it's read in a fast path. > > #endif /* IIO_ADC_AD7192_H_ */