From mboxrd@z Thu Jan 1 00:00:00 1970 From: Corey Minyard Subject: Re: [PATCH v4 0/1] Add support for IPMB driver Date: Thu, 2 May 2019 17:59:11 -0500 Message-ID: <20190502225910.GK6623@minyard.net> References: <20190502194954.GJ6623@minyard.net> Reply-To: minyard@acm.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Vadim Pasternak Cc: Asmaa Mnebhi , "wsa@the-dreams.de" , Michael Shych , "linux-kernel@vger.kernel.org" , "linux-i2c@vger.kernel.org" List-Id: linux-i2c@vger.kernel.org On Thu, May 02, 2019 at 09:14:46PM +0000, Vadim Pasternak wrote: > [...] > > > > > > >>Better, if you can avoid cast. > > > >>Would compiler warn if you use for example rol16(client->addr, 1) & > > GENMASK(7, 0); or something like it? > > > I thought it wouldn't be too much of an issue to use typecast here since other > > existing ipmi drivers use typecasting: bt-bmc.c, kcs_bmc_aspeed.c, > > kcs_bmc_npcm7xx.c all use (u8) typecasting. > > > But if you really think it is worth it, I could do that. > > > I just think it is not as straight forward to read this code as using a simple > > typecast. Some might wonder why a GENMASK is needed in this case. > > > > > Hi Asmaa, > > I will not insist in case it's OK with maintainers. > > [...] I'm mostly against casts unless they are necessary, as they tend to clutter up the code. But I don't feel that strongly about it. I'm not sure how other maintainers feel. -corey