From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751270AbdALJkR (ORCPT ); Thu, 12 Jan 2017 04:40:17 -0500 Received: from mx2.suse.de ([195.135.220.15]:42478 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750727AbdALJkP (ORCPT ); Thu, 12 Jan 2017 04:40:15 -0500 Date: Thu, 12 Jan 2017 10:40:06 +0100 From: Jean Delvare To: Andy Shevchenko Cc: Ricardo Ribalda Delgado , Wolfram Sang , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] i2c: piix4: Avoid race conditions with IMC Message-ID: <20170112104006.4dfed9b7@endymion> In-Reply-To: References: <20170110121600.30649-1-ricardo.ribalda@gmail.com> Organization: SUSE Linux X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.31; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 11 Jan 2017 03:49:21 +0200, Andy Shevchenko wrote: > On Tue, Jan 10, 2017 at 2:16 PM, Ricardo Ribalda Delgado > > --- a/drivers/i2c/busses/i2c-piix4.c > > +++ b/drivers/i2c/busses/i2c-piix4.c > > @@ -585,9 +585,28 @@ static s32 piix4_access_sb800(struct i2c_adapter *adap, u16 addr, > > u8 command, int size, union i2c_smbus_data *data) > > { > > struct i2c_piix4_adapdata *adapdata = i2c_get_adapdata(adap); > > + unsigned short piix4_smba = adapdata->smba; > > u8 smba_en_lo; > > u8 port; > > int retval; > > + int timeout = 0; > > + int smbslvcnt; > > Keep them just after your another added variable. FWIW, I don't think this makes sense as a general rule. I'd rather have the variables in an order which makes sense (for human readers or for stack size optimization - unless gcc does it for us?), rather than always adding at the same place. Is there a rationale for doing that? I don't think shrinking the patch size is good enough a reason. -- Jean Delvare SUSE L3 Support