From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932212AbcH0TGb (ORCPT ); Sat, 27 Aug 2016 15:06:31 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:9230 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755139AbcH0TGa (ORCPT ); Sat, 27 Aug 2016 15:06:30 -0400 X-IronPort-AV: E=Sophos;i="5.28,587,1464645600"; d="scan'208";a="191261576" Date: Sat, 27 Aug 2016 21:06:25 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: SF Markus Elfring cc: linux-cris-kernel@axis.com, Adam Buchbinder , Dave Hansen , Ingo Molnar , Jesper Nilsson , Jiri Kosina , Mikael Starvik , Thomas Gleixner , LKML , kernel-janitors@vger.kernel.org, Paolo Bonzini Subject: Re: [PATCH 8/8] cris-cryptocop: Apply another recommendation from "checkpatch.pl" In-Reply-To: <0e29d372-ef5f-afa7-50b1-70ddc089ef00@users.sourceforge.net> Message-ID: References: <566ABCD9.1060404@users.sourceforge.net> <0e29d372-ef5f-afa7-50b1-70ddc089ef00@users.sourceforge.net> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 26 Aug 2016, SF Markus Elfring wrote: > From: Markus Elfring > Date: Fri, 26 Aug 2016 14:23:06 +0200 > > The script "checkpatch.pl" can point out that assignments should usually > not be performed within condition checks. > Thus move the assignments for a local variable to separate statements > in three functions. > > Signed-off-by: Markus Elfring > --- > arch/cris/arch-v32/drivers/cryptocop.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c > index 1a966dc..00231a7 100644 > --- a/arch/cris/arch-v32/drivers/cryptocop.c > +++ b/arch/cris/arch-v32/drivers/cryptocop.c > @@ -1510,7 +1510,8 @@ int cryptocop_new_session(cryptocop_session_id *sid, struct cryptocop_transform_ > while (tfrm_in){ > int err; > ++no_tfrms; > - if ((err = transform_ok(tfrm_in))) { > + err = transform_ok(tfrm_in); > + if (err) { > DEBUG_API(printk("cryptocop_new_session, bad transform\n")); > return err; > } > @@ -2276,7 +2277,10 @@ static int cryptocop_job_setup(struct cryptocop_prio_job **pj, struct cryptocop_ > (*pj)->iop->ctx_in.saved_data = operation->list_op.inlist; > (*pj)->iop->ctx_in.saved_data_buf = operation->list_op.in_data_buf; > } else { > - if ((err = cryptocop_setup_dma_list(operation, &(*pj)->iop, alloc_flag))) { > + err = cryptocop_setup_dma_list(operation, > + &(*pj)->iop, > + alloc_flag); Checkpatch didn't say to put every argument on a different line, and that wasn't done before, so why do it now? There is plenty of room for at least &(*pj)->iop on the line before. julia > + if (err) { > DEBUG_API(printk("cryptocop_job_setup: cryptocop_setup_dma_list failed %d\n", err)); > kfree(*pj); > return err; > @@ -2867,7 +2871,8 @@ static int cryptocop_ioctl_process(struct inode *inode, struct file *filp, unsig > > DEBUG(printk("cryptocop_ioctl_process: inserting job, cb_data=0x%p\n", cop->cb_data)); > > - if ((err = cryptocop_job_queue_insert_user_job(cop)) != 0) { > + err = cryptocop_job_queue_insert_user_job(cop); > + if (err) { > DEBUG_API(printk("cryptocop_ioctl_process: insert job %d\n", err)); > err = -EINVAL; > goto mark_outpages_dirty; > -- > 2.9.3 > > -- > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >