From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from moxy.haproxy.com (moxy.haproxy.com [205.234.165.26]) (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 42339186E20 for ; Wed, 25 Dec 2024 17:55:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.234.165.26 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735149311; cv=none; b=q3pdah9Ew1g6hWByFCi7yWd5uR8jrqbHHcLOPpgVi8zaFZtDEWZSApKIbBJPihnyfYV0MSlhpOH9L3nMGMtlD5Z0wOT3hlQ7g/Z3bx2LzA/N1tcmxvubiMh7xTeRoWvM2oc0qwb7CrTh1E8bqJyp1ysuib1szDNLuvUVv9cdxnw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735149311; c=relaxed/simple; bh=jjASJgsT4eB4OCiim7X93HWAiQ0sIGbqB1EiNP4RAxA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KILfUbY2I8sZXK4Sx9d5d6/ftAcHCR905eGsTgJdYL1iRSf/ksRgW6scOkRaqzp9pGvliAcaXMEmzclvFgK6D91yuKv57JJtYthOUq9HUAIHGjPqhaekvM9l81Mnb2iOtitA1956WZE63v3qYps2YKbRe3BIGOu6XtZ1omAIlXk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=haproxy.com; spf=none smtp.mailfrom=exceliance.fr; dkim=pass (2048-bit key) header.d=haproxy.com header.i=@haproxy.com header.b=kTReGNe6; dkim=fail (2048-bit key) header.d=haproxy.com header.i=@haproxy.com header.b=MoC28K2F reason="signature verification failed"; arc=none smtp.client-ip=205.234.165.26 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=haproxy.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=exceliance.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=haproxy.com header.i=@haproxy.com header.b="kTReGNe6"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=haproxy.com header.i=@haproxy.com header.b="MoC28K2F" Received: by moxy.haproxy.com (Postfix, from userid 2120) id F10131EC2AD8; Wed, 25 Dec 2024 12:46:50 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=haproxy.com; s=202009; t=1735148810; bh=jjASJgsT4eB4OCiim7X93HWAiQ0sIGbqB1EiNP4RAxA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kTReGNe60XL4x8E28rL/9lWTe4xVsrTIpu0EsWKlFAT5ftUGT9hxmDJUVmhhiZ0Bm LWL843QbYrD9Eilql7zX1Z1JgFHjn1Bb7bDIW8v63WP3oLJl9onfzRq5H8XksedSbw byigh3Zh0H9gTPPGX+uwsrH7uiZCn9vE8+ZKBQXdNgc+3VtmqtSeWxko5CRKdzhDqa eTYH1iQ57J91kVhPIsH24rJD9JQ7noAdVJ0tnJKNFPllBwSHmwiRF3MP4PrCUUK7mQ ssUR7seke03KoJ4QSW+0wNV3javLIQRyMfIaaBWNBTGOSE3J4mi0f7KssqCkFN7jhx nguDNa4cPGr/A== Received: from smtp.exceliance.fr (unknown [172.29.1.90]) by moxy.haproxy.com (Postfix) with ESMTP id 879E91EC2606; Wed, 25 Dec 2024 12:46:49 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=haproxy.com; s=202009; t=1735148810; bh=jjASJgsT4eB4OCiim7X93HWAiQ0sIGbqB1EiNP4RAxA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MoC28K2FoC8Fl9TWWB2EanKzKk/kTKUnkxJzMt+3g3KJL6p1CpYYSvWxCIMF4Xoas tAjhuAR86x6C6muqYZtG6H5yjbCmKhk5LatV9GqjXLfcahnMLLSXf39DqV2VRRZbJB 9OFESIoXUGn0TgYQShYhmS1c/WFQKzi5nEHZrp/HZT6GN+eTJ8HW1i+rBvGQ1bOd1z niXhGkyKrtfx+Vga+vJN8QPT4tWe9DCK0e44Z4CvPRWLf9aqS7orO23CfvOcJh7ZJ9 ehsbdqGB2Qg3NmToCXoRvxOaOz9JiuRIExTw/7QDzmevu0grD0CaC3iecJLK/MoBGp el9loBSKWFZ8g== Received: by azote.haproxy.local (Postfix, from userid 509) id DEA3731144; Wed, 25 Dec 2024 18:46:48 +0100 (CET) Date: Wed, 25 Dec 2024 18:46:48 +0100 From: Willy TARREAU To: Atharva Tiwari Cc: Ksenija Stanojevic , Andy Shevchenko , Geert Uytterhoeven , Sudip Mukherjee , "Dr. David Alan Gilbert" , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: Re: [PATCH] auxdisplay: panel: replace struct with union for display configuration Message-ID: <20241225174648.GA31874@haproxy.com> References: <20241225174120.100698-1-evepolonium@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241225174120.100698-1-evepolonium@gmail.com> User-Agent: Mutt/1.6.2 (2016-07-01) Hello! On Wed, Dec 25, 2024 at 11:11:18PM +0530, Atharva Tiwari wrote: > this patch replaces a struct with a union in the panel.c driver > to better represent display configuration as mentioned in TODO > > Signed-off-by: Atharva Tiwari > --- > drivers/auxdisplay/panel.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c > index a731f28455b4..4662f763dac7 100644 > --- a/drivers/auxdisplay/panel.c > +++ b/drivers/auxdisplay/panel.c > @@ -204,8 +204,7 @@ static struct { > int charset; > int proto; > > - /* TODO: use union here? */ > - struct { > + union { > int e; > int rs; > int rw; Have you tested this patch ? I guess not. The TODO here is not just to change a language keyword but to see if it would be better achieved using a different construct and representation of the different signals. Here what you've done is merge all the signals into a single one. I think that a better patch would be to just remove the TODO comment that has been there for about 20 years without making any progress, and which is no longer relevant since that code will not change now. regards, Willy