From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Date: Tue, 25 Aug 2020 07:29:03 +0000 Subject: Re: [PATCH v2] HID: roccat: add bounds checking in kone_sysfs_write_settings() Message-Id: <20200825072903.GQ1793@kadam> List-Id: References: <1597819984.4101.16.camel@web.de> <20200824085735.GA208317@mwanda> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Walter Harms Cc: Stefan Achatz , Jiri Kosina , Benjamin Tissoires , "linux-input@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kernel-janitors@vger.kernel.org" On Mon, Aug 24, 2020 at 03:35:16PM +0000, Walter Harms wrote: > hello Dan, > > i notice that you can shorten the line to: > (line above checks for count=sizeof(struct kone_settings)) > > difference = memcmp(settings, &kone->settings, count); > > nothing special just to shorten the line and make use of count. > > and just to save one indent level and because its readabel nicely: > if ( ! difference ) > goto unlock; > > hope that helps Yeah. I wrote that version and I wanted to send it, but then I decided not to change the style too much. I definitely agree with you, but I figured I would keep the patch less intrusive. regards, dan carpenter