Received: by 10.223.164.202 with SMTP id h10csp908181wrb; Fri, 10 Nov 2017 18:14:19 -0800 (PST) X-Google-Smtp-Source: AGs4zMYMpCJWKTf2WmBUK85B/DxkPR6rrJQddNhGjdvE4nZqsvDAWJmRy0wwozBvOT+phEg5xb90 X-Received: by 10.84.248.142 with SMTP id q14mr2283295pll.102.1510366459877; Fri, 10 Nov 2017 18:14:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510366459; cv=none; d=google.com; s=arc-20160816; b=DM1LcL+X228ZS7jCXoIp6kUdrI+oK9S9lk6KgtYy8CVD0hN7ToMzxMl8P0ZkaOenWU UVZmOw8deYC7erpzjUy9mBtvX0FGkShjKS507edC5Z5s7rYUrVpKtMlmVa+0CJ+nV2jr 3jRWN7uNvpKa9M16wEJw5uEbbtxKeIQAcYo3LeIj2KN2w5q3VaILjc/G6TEmol5aXIsL b4b0YYhcquCje9oxaQSD8mxotxxSCX2g6J1pZxk9lK52Yr7Yj5fOccPia0gyarS4Wkjp EGsQ6RvuxIQWUun17jzRVG5HytUpMdtUqTCqYgYfllHDJgfH8FDO/lBy9R/TEqbbyYIP UeaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=2qPSm9pksPVUDVYMpdTt1h2nFtEkdJWA8HJUQARJPN0=; b=yEwUy8GKcIfjb8Cg9YCUVUxsEirRhjJRuCkhv7Rruk4WautUJdF1hIhwyn1ZvKYb/0 PBTV1SwYAOx361Olk+SQSlXXYUaSab8cMM5zOGgK9rcmnRtsMhkLLPS9IvvKFSHoh2tu w6OeHcDobKfELE5UCHFiZUrKN2ncAEaqD9YpEi0X3QyosmCOvZF40tqDPCqnfQyF5x46 gBqNtHHfPyyMgH2M9epYK3ItDWfmR3V0cYMtGVZhKg3hMrKnzG94G0pBZdCHQ/dLZT9j TqZVr14JHV2cXN3/VXuOjQtJpNRg4UIgjO4gGW0xzCRvyM4Err/nEKg3O/kXlXzHiJKA L7+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k189si10077213pgc.153.2017.11.10.18.14.08; Fri, 10 Nov 2017 18:14:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754969AbdKKCNZ (ORCPT + 83 others); Fri, 10 Nov 2017 21:13:25 -0500 Received: from hera.aquilenet.fr ([141.255.128.1]:48609 "EHLO hera.aquilenet.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753541AbdKKCNX (ORCPT ); Fri, 10 Nov 2017 21:13:23 -0500 X-Greylist: delayed 581 seconds by postgrey-1.27 at vger.kernel.org; Fri, 10 Nov 2017 21:13:23 EST Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id B15BCFC57; Sat, 11 Nov 2017 03:03:42 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eOoBeRRh5ZN0; Sat, 11 Nov 2017 03:03:42 +0100 (CET) Received: from var.youpi.perso.aquilenet.fr (unknown [IPv6:2a01:cb19:181:c200:3602:86ff:fe2c:6a19]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 07256F67B; Sat, 11 Nov 2017 03:03:42 +0100 (CET) Received: from samy by var.youpi.perso.aquilenet.fr with local (Exim 4.89) (envelope-from ) id 1eDL91-0001bU-9u; Sat, 11 Nov 2017 03:03:39 +0100 Date: Sat, 11 Nov 2017 03:03:39 +0100 From: Samuel Thibault To: "Gustavo A. R. Silva" Cc: William Hubbs , Chris Brannon , Kirk Reiser , Greg Kroah-Hartman , speakup@linux-speakup.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: speakup: selection: replace _manual_ swap with swap macro Message-ID: <20171111020339.zbaqsxzy2jo4uygs@var.youpi.perso.aquilenet.fr> Mail-Followup-To: Samuel Thibault , "Gustavo A. R. Silva" , William Hubbs , Chris Brannon , Kirk Reiser , Greg Kroah-Hartman , speakup@linux-speakup.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org References: <20171110221303.GA29629@embeddedor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20171110221303.GA29629@embeddedor.com> Organization: I am not organized User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Gustavo A. R. Silva, on ven. 10 nov. 2017 16:13:03 -0600, wrote: > Make use of the swap macro instead of _manually_ swapping values > and remove unnecessary variable tmp. > > This makes the code easier to read and maintain. > > This code was detected with the help of Coccinelle. > > Signed-off-by: Gustavo A. R. Silva Acked-by: Samuel Thibault > --- > drivers/staging/speakup/selection.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/drivers/staging/speakup/selection.c b/drivers/staging/speakup/selection.c > index 66061b5..0ed1fef 100644 > --- a/drivers/staging/speakup/selection.c > +++ b/drivers/staging/speakup/selection.c > @@ -64,13 +64,8 @@ int speakup_set_selection(struct tty_struct *tty) > ps = spk_ys * vc->vc_size_row + (spk_xs << 1); > pe = spk_ye * vc->vc_size_row + (spk_xe << 1); > > - if (ps > pe) { > - /* make sel_start <= sel_end */ > - int tmp = ps; > - > - ps = pe; > - pe = tmp; > - } > + if (ps > pe) /* make sel_start <= sel_end */ > + swap(ps, pe); > > if (spk_sel_cons != vc_cons[fg_console].d) { > speakup_clear_selection(); > -- > 2.7.4 > -- Samuel il faut combien de chevaux pour tirer une doloréan à 88 morph ? ***b vient de remarque que 88 mph c'est 142 km/h aaaaah c'est pour ça qu'ils limitent à 130 km/h sur les autoroutes c'est pour éviter que les gens voyagent dans le temps probablement From 1583718910790604635@xxx Fri Nov 10 22:14:09 +0000 2017 X-GM-THRID: 1583718910790604635 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread