Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp867278rdb; Fri, 19 Jan 2024 00:56:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IFeYl0gaJ5/F2ouHZ0hMW7pKVA4Fkzr4r+SuD7nxo4as7EklzERA+pPOJsVQrsEi1ns9jJV X-Received: by 2002:a05:6a00:4648:b0:6d9:af31:293b with SMTP id kp8-20020a056a00464800b006d9af31293bmr2008199pfb.61.1705654598458; Fri, 19 Jan 2024 00:56:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705654598; cv=pass; d=google.com; s=arc-20160816; b=sUMl82sZUdK14NiHpQwkYwCYop6KLmLqMpJ1wtmR1XzAvWWkiCCd8Cc/+7BIZ0Ps98 49vgSEy00RT5HdYPiyovhajpUHirG/KwJwY4yNTR4+O5nd71JoOmcKKONSfORRL4JnUd Wd10n63vnXkPwzcgHjC6EZiROBwsohWSufd1057zfaXy0d4j7EFdwPz82RyIUWY9ZVzt JG9bnZNUfQActfH2XWFe31O8/llQF+YPQLgkjU/mzcw0WMVyHCiMmR0q0R+v7CxNqmrK y7xJ9OV9NB0r0jLNr6XwRAkx264yCBSLL9SkODUxkrgK2UA5Wfk+NQzwwKpwnbpCqu4I f/3g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=t+5iWpv4RNX3aTa2gciiFG/5iPbkcLKE4JhyWvilR7g=; fh=k2fp+SnJ7/zzEMuCKDsxgFKLLMCNB8OAq8HDDyzeTC4=; b=SVnYoV8kkQgqG/M+9nIYtn0TGqpEcnDwJ4neoHcD5XJGVwKxMBvkRXqApHJ9ADK55U yMDbNULlRXRKgJPSRqzY1o12NLRO3cORP3FAsMPoz7u1Jz7olQp9Eb+4OMQKtfA6ROfO GX6Moop6nEPfoaZLNh77vdwp8cU3N7YhKSsVDumy9sN9pmGfzzkf05MeznawRf5T+qDx 74E7Dybd4MgcjBvf8c9pCaegi0t4vEfd7E1UJX3sR7Edh0h1b4a699pCZzoUJMXGhhwn 3m3BU8s2Trh0nJM879weuvrL0r8IFTznyipbntwFkKf7RwxNtBBPZtwVabMbVlxwe1yC MnqA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S8gXkrSR; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-30927-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30927-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id kq20-20020a056a004b1400b006d9abe94a76si5486616pfb.67.2024.01.19.00.56.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 00:56:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30927-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S8gXkrSR; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-30927-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30927-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 43218B23F18 for ; Fri, 19 Jan 2024 08:56:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 89EC51E89A; Fri, 19 Jan 2024 08:56:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="S8gXkrSR" Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 34CCF1E897 for ; Fri, 19 Jan 2024 08:56:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705654568; cv=none; b=MpGqKMx6lntd3AiE/EH7Ee7rKdvLwZrRVBk4E3KRdKt7K2MnjUgbY2xZMrCmyHEdENcetDSNL54CR/ecSsBtTL543jeUI2/xV8yDaGVEGb2ntx62r2HbJUb6ghjzhCV1lFAfzhgjIpHk3hcE6KCm2QYV4zYNM6WOhjlO0B7c/v0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705654568; c=relaxed/simple; bh=A02zxz7byKxzPrYpMPQTWD4E7H2WLd2KSeOWDy/LnWc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=INNr36OrKtmES2cRpSDy0li1ewseQD0NyrPxacfP3dyCXug62C4cNEBZVZi39uQYTlAqfNcJB+dDaUPoP46UZwaV0VBmR45nZdUucy5avJMlTtdz1gfjGxHbT7fxbfr9Z2049SERAIwzu47vSNOjiqlWj4wUgk55Kr2jDlN3aMU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=S8gXkrSR; arc=none smtp.client-ip=209.85.208.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-559de6145c3so507372a12.1 for ; Fri, 19 Jan 2024 00:56:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705654565; x=1706259365; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=t+5iWpv4RNX3aTa2gciiFG/5iPbkcLKE4JhyWvilR7g=; b=S8gXkrSRUbak/5l4dKKQuewxG+Z+Jc9KgdMYABYJ9jn5odBDA43SY1y6gF9kvjGQE8 /CXVaCTszbflaZ5AF8TI7XJimNBF+OiftwEJwzmJqnn2ITVwRYk77pE8nUU0u9Rim3g3 5yUeqrbb70EoOQGOoBdA+yV7jmmEB+J2/eygrOkIevtgreeRk9bhe6pOsOJPy81GaImH i0Mio144Srzt4g57DXcqIA4dKn91Wyoxeu036LKdpuv3EpCcEyhZNc4lszIVjvzY3MgU vY0kd4fgTRfgjj7776LUmdu6RBmCWc+5lAwfRVNYH97cgJzEu2uhDn6EI8BBUjaLgKEP t4tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705654565; x=1706259365; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=t+5iWpv4RNX3aTa2gciiFG/5iPbkcLKE4JhyWvilR7g=; b=nwm4mNIC/3S2kfF+wulpKyd9CFQAVSaBFn3tfEGCCK36MoOfL5frKDXZ/D0vrnc8gn wiQBTrLc5QZ7bsE+d63f5xO8h6d7oxlbd1zr61XT1eBQIKMgvZyemeskkrqgVpV5Z369 6Xu6ccFVcm+bvcC3dwEJeOWFJo4Np5RPPAhu6NaefprUcvq/0Qr+W4WJlQX2F7nzkIq0 pkjV4TT2/n8BDXKS+08tjs9WbZvmSVg9XauLNkvYoQSHZu7/ck99PRJvRQMl0PF/KIVz NYU47Db9frVuG7a8my8WeahZa/dFC6OZQOvL9jJS/yGR6m7JOSghSo6wa7TcMeCKKVG+ Ep6g== X-Gm-Message-State: AOJu0Yzm4SLB0CLwpsgS68txFjnkjKq0+Pr8gnCHMgeolwNtEa10udPj BiWWrGEnjT1840Xxr2v2jCSFvPUnB28K6oHqyXpUo20r2BJnwtowPQGRMxo/vyA= X-Received: by 2002:aa7:d890:0:b0:55a:780:2d8f with SMTP id u16-20020aa7d890000000b0055a07802d8fmr1153845edq.56.1705654565265; Fri, 19 Jan 2024 00:56:05 -0800 (PST) Received: from [192.168.2.107] ([79.115.63.202]) by smtp.gmail.com with ESMTPSA id ek7-20020a056402370700b005594ad2235bsm6233549edb.12.2024.01.19.00.56.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Jan 2024 00:56:04 -0800 (PST) Message-ID: <76e1dc42-cabe-4925-8aa1-c8f733fb36a2@linaro.org> Date: Fri, 19 Jan 2024 08:56:02 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 17/18] tty: serial: samsung: shrink port feature flags to u8 Content-Language: en-US To: Sam Protsenko Cc: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, gregkh@linuxfoundation.org, jirislaby@kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com References: <20240110102102.61587-1-tudor.ambarus@linaro.org> <20240110102102.61587-18-tudor.ambarus@linaro.org> From: Tudor Ambarus In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 1/16/24 19:03, Sam Protsenko wrote: > On Wed, Jan 10, 2024 at 4:25 AM Tudor Ambarus wrote: >> >> There's a single flag defined as of now. Shrink the feature flags to u8 >> and aim for a better memory footprint for ``struct s3c24xx_uart_info``. >> >> Signed-off-by: Tudor Ambarus >> --- >> drivers/tty/serial/samsung_tty.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c >> index 5df2bcebf9fb..598d9fe7a492 100644 >> --- a/drivers/tty/serial/samsung_tty.c >> +++ b/drivers/tty/serial/samsung_tty.c >> @@ -90,7 +90,7 @@ struct s3c24xx_uart_info { >> >> /* uart port features */ >> >> - unsigned int has_divslot:1; >> + u8 has_divslot:1; > > But that's already a bit field. Why does it matter which type it is? > If using unsigned int the bitfied is combined with the previous u8 fields, whereas if using u8 the bitfield will be independently defined. So no benefit in terms of memory footprint, it's just a cosmetic change to align the bitfield with the previous u8 fields. Allowing u32 for just a bit can be misleading as one would ask itself where are the other bits. Between a u32 bitfield and a bool a u8 bitfield seems like a good compromise. I'll update the commit message with this explanation in v2 because I'd keep the patch, it makes the struct look cleaner. At the same time I don't have a strong opinion, so if you'd like to see the patch dropped, tell there, I'll be fine with it.