Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2069852imd; Sun, 28 Oct 2018 02:14:32 -0700 (PDT) X-Google-Smtp-Source: AJdET5exv1sSuGYuvLGMzguKE21/3q0b5+z4yV0oJd1KKtSEAtihHmF7ZmWvmlIQxjZuQiU+lw85 X-Received: by 2002:a62:5881:: with SMTP id m123-v6mr731357pfb.160.1540718072757; Sun, 28 Oct 2018 02:14:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540718072; cv=none; d=google.com; s=arc-20160816; b=bOM9ZkiT+u6tH91heXH59Pxc2nkU9OMfkTaJBdeYo7MEbWZal3qmqcr3uBQYGebIfh 1SrfcA2HSZDWhY2qJqSxFIs4FgwwhF8ifb2oqtCH1m5NnJwhThL73WXa7ZdhtMm2JC2a Mvtfy/DdVdzAHKD2d8BtdcNJfH7PWGea++rRPR0x09JyV6hn2p2IKRdDOmlbgU+pyWJ9 gVQkX30lPJAd+G0vPD22O0dDKqirMAlQdFygy8iQBytOo0p7N7PXEIT7iA4SvmCohA1K DrSPHqpTs+z5cOvHZ31dM2DfY15X9oacWjtF6Ol+yErxbuv1CG5iMKX0xULpPZmXdRJV 2ZtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=Ix6BqwZsGc73lLNjzuTpxIWkJ3C+PqSMDGs0LXPl0gg=; b=yB+2EmEOEluJsD6ED4Q2vhu/bqdqE7jQU+XTDJPmgUTdFInOqmsHLdKA/Wxl03MxAs BEyCoqW/DwHRkJHfOpIZ+i8nNC0BwK6VFCGDE2aiDirEfGtqPmBvVEpMNmBToRqpC6pf r0T7HXnB/rd9mhMdG4dev0XGviHeXnBPFf6WnmFZtAM6XJJffJyq9F3kZrMmNtUAa1WP X/EUXNVhN16e9dHij0Sc4x+3r+4iBSzjiZa8Lx5yUDVSCJTb9DO10mlwi5hrbcXtE+ry pRFLpLEQvOYepxBDxjiA4Wr+w4xaxL/fxNPrVDUcxt34aXQ1Y/3cjOU+STZbVjhhUTgc V8uQ== 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 34-v6si16794092pln.402.2018.10.28.02.14.03; Sun, 28 Oct 2018 02:14:32 -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 S1727205AbeJ1RbS (ORCPT + 99 others); Sun, 28 Oct 2018 13:31:18 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:23613 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726354AbeJ1RbS (ORCPT ); Sun, 28 Oct 2018 13:31:18 -0400 X-IronPort-AV: E=Sophos;i="5.54,435,1534802400"; d="scan'208";a="283541470" Received: from 89-157-201-244.rev.numericable.fr (HELO hadrien) ([89.157.201.244]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Oct 2018 09:47:16 +0100 Date: Sun, 28 Oct 2018 09:47:15 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Himanshu Jha cc: Sasha Levin , Shayenne da Luz Moura , Greg Kroah-Hartman , Hans de Goede , Michael Thayer , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, outreachy-kernel@googlegroups.com Subject: Re: [Outreachy kernel] [RESEND PATCH 2/2] staging: vboxvideo: Use unsigned int instead bool In-Reply-To: <20181028075209.GA1938@himanshu-Vostro-3559> Message-ID: References: <211701e4ae42acd95afb24713314bce5a4c58ecf.1540580493.git.shayenneluzmoura@gmail.com> <20181026204225.GH2015@sasha-vm> <20181028075209.GA1938@himanshu-Vostro-3559> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > The "possible alignement issues" in CHECK report is difficult to figure > out by just doing a glance analysis. :) > > Linus also suggested to use bool as the base type i.e., `bool x:1` but > again sizeof(_Bool) is implementation defined ranging from 1-4 bytes. If bool x:1 has the size of bool, then wouldn't int x:1 have the size of int? But my little experiments suggest that the size is the smallest that fits the requested bits and alignment chosen by the compiler, regardless of the type. bool x:1 has the advantage that anything that is not 0 is considered true. So for bool x:1, x = 4 is true, while for int x:1, x = 4 is false. But the :1 adds instructions, so at least for only one bool, where little space is saved, it is probably not worth it. julia