Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp534731yba; Mon, 1 Apr 2019 11:15:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqwIvh5M0NaGR0jr6lwkS2kgDQsF409qbi7A+c5WN8L81Un9qldRpAoRayhbEpMbzwJGgCmj X-Received: by 2002:a63:d1f:: with SMTP id c31mr38055676pgl.353.1554142542168; Mon, 01 Apr 2019 11:15:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554142542; cv=none; d=google.com; s=arc-20160816; b=hOJ5xb8odl6hGedyCFmjRuraEcJ0uQyAPL6vdoSNj6AdIZcgn+AQ7Io59BGK7/oX/k ayzDVQLqMEr5qh5T+Vsrmvwrt1NOgL3nxICe9gR4fFNLgcIVvjTHnrl9VCoihNIvtIvu 1SaI8l9fwSHsFqDW6OxgrUFNCAR63vsPs4LpboHEwlj8S1mnpDY0D+Acw+Bo/QdMpz3Q iwHiSXDPPunRzrafyiVWBKyJCvXUnzLD/JtIGkeRvhtfWtqHxoIH3J2Uc4HbzHX3AqDz 99yTDHsXYA56nBHtl/065zrfQKJH4GZtq0fAPQJy+evj6CU4hyjbZoSn2FSP37C0t+2h /E2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:message-id:date :mime-version:subject:references:in-reply-to:cc:to:from :dkim-signature; bh=MjHdbX1F4aTQmY4SoorYMmxw7zaWT6f/eOXBazqFaq4=; b=HxTPNtqpsS2IQFrusp+9U+3OZfe5YzeBOs6IkGuQuQaUpz7tU2eySjgyndrEYV9S93 p0sdNxAGrGdScMzDUa/VtiJxwU4jhjxDXmO3L0wBV2lpKka4PvvPFOISbgVmwoiypaP7 8rQanVMSVZF20qs06cKKkNVkpiT95cLXWe5gOv2YuH8Yv3jwfawFrwv56GAe3QFiswPK vC1tCMfv17/SqOivy7kXMDtyAiroYtem45Jcsm662rJ1CXudu4a2Ub2BpqJwnwvEvcH6 yDxT0KO79KBNUsHhqRbfSR8XT6Rq0srL9ejeTRiEFtzxbJSuoxrtY5DvSo5R/x2XycEN zbPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=S4GwXOKE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s78si8331047pfa.103.2019.04.01.11.15.26; Mon, 01 Apr 2019 11:15:42 -0700 (PDT) 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; dkim=pass header.i=@yandex.ru header.s=mail header.b=S4GwXOKE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728729AbfDASOu (ORCPT + 99 others); Mon, 1 Apr 2019 14:14:50 -0400 Received: from forward500o.mail.yandex.net ([37.140.190.195]:40623 "EHLO forward500o.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728638AbfDASOu (ORCPT ); Mon, 1 Apr 2019 14:14:50 -0400 Received: from mxback13g.mail.yandex.net (mxback13g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:92]) by forward500o.mail.yandex.net (Yandex) with ESMTP id 3540A60264; Mon, 1 Apr 2019 21:14:45 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback13g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id K52M0V5utU-EdmGh2Iw; Mon, 01 Apr 2019 21:14:44 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1554142484; bh=MjHdbX1F4aTQmY4SoorYMmxw7zaWT6f/eOXBazqFaq4=; h=Message-Id:Cc:Subject:In-Reply-To:Date:References:To:From; b=S4GwXOKEVuR2oS5fZ39Jenx5TGALVK81KrigS+DZUYiDFnUSEA/+B+e7HaFIq/MIu zZy48VecN6tv2yM812BJa4CPrApzNvGEvEBXTJu+xm5K2Jqq5XFLUZZVRnNsaCV2bg XY0tcG789unydEDYIPVKO9z1+rO7d7lOwp1gXf/g= Authentication-Results: mxback13g.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by myt6-23299ba78d64.qloud-c.yandex.net with HTTP; Mon, 01 Apr 2019 21:14:39 +0300 From: Andrey Abramov To: Vineet Gupta , David Laight , "'gregkh@linuxfoundation.org'" Cc: George Spelvin , "adrian.hunter@intel.com" , "ard.biesheuvel@linaro.org" , "benh@kernel.crashing.org" , "bp@alien8.de" , "darrick.wong@oracle.com" , "dchinner@redhat.com" , "dedekind1@gmail.com" , "hpa@zytor.com" , "jlbec@evilplan.org" , "jpoimboe@redhat.com" , "linux-kernel@vger.kernel.org" , "linux-snps-arc@lists.infradead.org" , "mark@fasheh.com" , "mingo@redhat.com" , "mpe@ellerman.id.au" , "naveen.n.rao@linux.vnet.ibm.com" , "paulus@samba.org" , "richard@nod.at" , "tglx@linutronix.de" , "x86@kernel.org" In-Reply-To: References: <18626931553963861@sas1-b3ec53dbc12b.qloud-c.yandex.net> <20467491553964233@myt4-c0b480c282c8.qloud-c.yandex.net> <20190330183826.GB21828@kroah.com> <201903302015.x2UKFnSL003850@sdf.org> <20434561554015618@myt1-cd60b8ae9bb9.qloud-c.yandex.net> <20190331105412.GA9393@kroah.com> Subject: Re: [PATCH 5/5] Lib: sort.h: replace int size with size_t size in the swap function MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Mon, 01 Apr 2019 21:14:39 +0300 Message-Id: <440631554142479@myt6-23299ba78d64.qloud-c.yandex.net> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 01.04.2019, 21:02, "Vineet Gupta" : > On 4/1/19 7:46 AM, David Laight wrote: >>  From: gregkh@linuxfoundation.org >>>  Sent: 31 March 2019 11:54 >>  ... >>>  Yes, "int" is a very nice variable for "size", you need to explain why >>>  it is better to use size_t here please. >>  Actually, on x86_64 you probably want 'unsigned int' to avoid the >>  compiler having to generate a sign-extending register move if the >>  value is ever used in a 64bit expression (eg an address calculation). > > Thats likely true for non x86 arches too (for certain on ARC). That is also the > reason I dislike "bool", despite its "software engineering" benefits. Per ARC ABI > (and likely others too) it is signed 8 bits and any use thereof, requires the > compiler to generate an additional EXTB instruction to promote to 32-bit int with > sign extension before using the value. > > -Vineet George Spelvin wrote "So how about *deleting* the parameter instead? That simplifies everything.", and he is right, so I am just going to completely remove it. Any objections? -- With Best Regards, Andrey Abramov