From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753128AbcADIjw (ORCPT ); Mon, 4 Jan 2016 03:39:52 -0500 Received: from smtp.gentoo.org ([140.211.166.183]:39837 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753071AbcADIjr (ORCPT ); Mon, 4 Jan 2016 03:39:47 -0500 Subject: Re: [PATCH] [media] si2165: Refactoring for si2165_writereg_mask8() To: SF Markus Elfring , linux-media@vger.kernel.org, Mauro Carvalho Chehab References: <566ABCD9.1060404@users.sourceforge.net> <568020CC.1060004@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: Matthias Schwarzott Message-ID: <568A2FB9.8040806@gentoo.org> Date: Mon, 4 Jan 2016 09:39:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <568020CC.1060004@users.sourceforge.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 27.12.2015 um 18:33 schrieb SF Markus Elfring: > From: Markus Elfring > Date: Sun, 27 Dec 2015 18:23:57 +0100 > > This issue was detected by using the Coccinelle software. > > 1. Let us return directly if a call of the si2165_readreg8() > function failed. > > 2. Reduce the scope for the local variables "ret" and "tmp" to one branch > of an if statement. > > 3. Delete the jump label "err" then. > > 4. Return the value from a call of the si2165_writereg8() function > without using an extra assignment for the variable "ret" at the end. > > Signed-off-by: Markus Elfring The patch looks fine. Signed-off-by: Matthias Schwarzott Regards Matthias PS: I am going to switch to regmap, but this change is not yet polished and until now does not touch this function. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthias Schwarzott Date: Mon, 04 Jan 2016 08:39:21 +0000 Subject: Re: [PATCH] [media] si2165: Refactoring for si2165_writereg_mask8() Message-Id: <568A2FB9.8040806@gentoo.org> List-Id: References: <566ABCD9.1060404@users.sourceforge.net> <568020CC.1060004@users.sourceforge.net> In-Reply-To: <568020CC.1060004@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: SF Markus Elfring , linux-media@vger.kernel.org, Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall Am 27.12.2015 um 18:33 schrieb SF Markus Elfring: > From: Markus Elfring > Date: Sun, 27 Dec 2015 18:23:57 +0100 > > This issue was detected by using the Coccinelle software. > > 1. Let us return directly if a call of the si2165_readreg8() > function failed. > > 2. Reduce the scope for the local variables "ret" and "tmp" to one branch > of an if statement. > > 3. Delete the jump label "err" then. > > 4. Return the value from a call of the si2165_writereg8() function > without using an extra assignment for the variable "ret" at the end. > > Signed-off-by: Markus Elfring The patch looks fine. Signed-off-by: Matthias Schwarzott Regards Matthias PS: I am going to switch to regmap, but this change is not yet polished and until now does not touch this function.