Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2812385imu; Sun, 23 Dec 2018 08:19:54 -0800 (PST) X-Google-Smtp-Source: ALg8bN4ZRTQAtCGJneA3yBZd2D+gvP2NY0sjZ8H8ro6sDhKCuyktMGZ+I58IwCZX8knL3zISH0QE X-Received: by 2002:a17:902:7c85:: with SMTP id y5mr10062921pll.63.1545581994671; Sun, 23 Dec 2018 08:19:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545581994; cv=none; d=google.com; s=arc-20160816; b=tU2sWkMbD4TFa3ojH5KHC5Zv4IHYQUdAFZy8iafnKo684QwxNRDSHCs03jcPufnemn KC5nykpUikvxOlp4DE/widCRNsElXuzh8pPMpiK8k0zM1JIemAT/NhEhNkHWhU9QrTlx k+J71Vz2V918qnFd8/gFldlSQHma6KcErlrUF3kCwIbWsGPMcB6TpPlv+QvE5C7HqSf9 OhmU7m1mNdodOr+2guPV1p/gSTgd2FUVhnVeTO2QLI4ApFt9KW4fAPkfEfSmSUs8k4vJ bSnFohC/AHAk2UOatke1SBXY10oTq4hQlmnXuYnz/af0otcvZD4iS0nxr+VWoV+aTGGK VmAw== 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=xH8/TPNqQjr4C1tn50ZeKK8GZCHDZ9VNqYDK1KbcBOs=; b=IFjDoZt2QsTdHAuoe+JoqBjfTnOudoFrcP6JHTwS0KF091zRnOdhtBYBVRjFeykM6/ oq9KcjMoOT0IeqazUk+Hj9LxzQWH7I2bLW+JaeTxaxOOa7q1XizH5k1xudr4MuJwrRPU T3u8mjIcA9/pHHmHytBh12Ez+euUGq0CL/3pZPD8ha9D9gzTCTYkG9P5Pn1w6+UqMDnQ 2pZz6zPSUhJUyIeV7cQxPcNGdZrHs4xgyE0cWN+cPIM6j2yxT8mJykQujgc7o/Pt/41X Zfv3Z1Sbx4aAqyGZt5xY+XC3GzQfHUVbPiMaUWTEgUPYwujhePnMfRmDmmsQICSZovYQ M72A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TX8PnhFR; 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 f7si26357583pga.87.2018.12.23.08.19.39; Sun, 23 Dec 2018 08:19:54 -0800 (PST) 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=TX8PnhFR; 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 S2391396AbeLVR3H (ORCPT + 99 others); Sat, 22 Dec 2018 12:29:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:56514 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725825AbeLVR3H (ORCPT ); Sat, 22 Dec 2018 12:29:07 -0500 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 01BAB219D6; Sat, 22 Dec 2018 17:29:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545499746; bh=faTOkyHoSxtRC5mOWzbDqVgzvo91S99q++LO8u+WawY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=TX8PnhFRAsnxngXrrPQEDxbyi0zzR5ZfVITNlkDPWH6xyDJrvdK+aA27ewdl2EUEW Owa5UqRuZhwOvrI3/4xQulSsQ6nVqlTxcxqx/qQhNjTuLui2aDAPTvJ7Zbsmn2P9MY 3LbUFVNV9x+gbruMiSYdAwq2RwGE0hKt9QLZ2Is8= Date: Sat, 22 Dec 2018 17:28:59 +0000 From: Jonathan Cameron To: Amir Mahdi Ghorbanian Cc: lars@metafoo.de, Michael.Hennerich@analog.com, knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org, linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Staging: iio: ad7192: replaced bool in struct Message-ID: <20181222172859.6d3b84ae@archlinux> In-Reply-To: <1545434786-15220-1-git-send-email-indigoomega021@gmail.com> References: <1545434786-15220-1-git-send-email-indigoomega021@gmail.com> X-Mailer: Claws Mail 3.17.2 (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 Fri, 21 Dec 2018 15:26:26 -0800 Amir Mahdi Ghorbanian wrote: > Replaced bool in struct with unsigned int bitfield to conserve space and > more clearly define size of varibales > > Signed-off-by: Amir Mahdi Ghorbanian Hi Amir, I'm a bit in two minds on this one. It's not a size critical structure and the advantage of bools is they make it clear the thing really is true or false. Another element here is that this is a platform data structure and unless we have users in the kernel tree, the chances that we'll maintain it's existence at all as we look to move this driver out of staging is very small! So slightly marginal advantage to the change on a structure that I certainly hope is shortly going away! Sorry, but I'm not convinced and won't be applying it. If you want to work on this driver though that would be great and I'm happy to do a review of it to highlight what other elements need cleaning up. Just say on the list and either I'll take a look or one of our other reviewers will. Thanks, Jonathan > --- > drivers/staging/iio/adc/ad7192.h | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/drivers/staging/iio/adc/ad7192.h b/drivers/staging/iio/adc/ad7192.h > index 7433a43..7d3e62f 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; > + unsigned int refin2_en : 1; > + unsigned int rej60_en : 1; > + unsigned int sinc3_en : 1; > + unsigned int chop_en : 1; > + unsigned int buf_en : 1; > + unsigned int unipolar_en : 1; > + unsigned int burnout_curr_en : 1; > }; > > #endif /* IIO_ADC_AD7192_H_ */