From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755508AbbIXNdB (ORCPT ); Thu, 24 Sep 2015 09:33:01 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:32941 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753867AbbIXNc7 convert rfc822-to-8bit (ORCPT ); Thu, 24 Sep 2015 09:32:59 -0400 From: Michal Nazarewicz To: Alexey Dobriyan , Linux Kernel , Andrew Morton Cc: Peter Zijlstra , john.stultz@linaro.org, Masami Hiramatsu , Ingo Molnar , Peter Zijlstra , Steven Rostedt , Linus Torvalds Subject: Re: + kernelh-make-abs-work-with-64-bit-types.patch added to -mm tree In-Reply-To: Organization: http://mina86.com/ References: <55fb3266.yHuY6+DaYTJdIL75%akpm@linux-foundation.org> User-Agent: Notmuch/0.19+53~g2e63a09 (http://notmuchmail.org) Emacs/25.0.50.1 (x86_64-unknown-linux-gnu) X-Face: PbkBB1w#)bOqd`iCe"Ds{e+!C7`pkC9a|f)Qo^BMQvy\q5x3?vDQJeN(DS?|-^$uMti[3D*#^_Ts"pU$jBQLq~Ud6iNwAw_r_o_4]|JO?]}P_}Nc&"p#D(ZgUb4uCNPe7~a[DbPG0T~!&c.y$Ur,=N4RT>]dNpd;KFrfMCylc}gc??'U2j,!8%xdD Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEWbfGlUPDDHgE57V0jUupKjgIObY0PLrom9mH4dFRK4gmjPs41MxjOgAAACQElEQVQ4jW3TMWvbQBQHcBk1xE6WyALX1069oZBMlq+ouUwpEQQ6uRjttkWP4CmBgGM0BQLBdPFZYPsyFUo6uEtKDQ7oy/U96XR2Ux8ehH/89Z6enqxBcS7Lg81jmSuujrfCZcLI/TYYvbGj+jbgFpHJ/bqQAUISj8iLyu4LuFHJTosxsucO4jSDNE0Hq3hwK/ceQ5sx97b8LcUDsILfk+ovHkOIsMbBfg43VuQ5Ln9YAGCkUdKJoXR9EclFBhixy3EGVz1K6eEkhxCAkeMMnqoAhAKwhoUJkDrCqvbecaYINlFKSRS1i12VKH1XpUd4qxL876EkMcDvHj3s5RBajHHMlA5iK32e0C7VgG0RlzFPvoYHZLRmAC0BmNcBruhkE0KsMsbEc62ZwUJDxWUdMsMhVqovoT96i/DnX/ASvz/6hbCabELLk/6FF/8PNpPCGqcZTGFcBhhAaZZDbQPaAB3+KrWWy2XgbYDNIinkdWAFcCpraDE/knwe5DBqGmgzESl1p2E4MWAz0VUPgYYzmfWb9yS4vCvgsxJriNTHoIBz5YteBvg+VGISQWUqhMiByPIPpygeDBE6elD973xWwKkEiHZAHKjhuPsFnBuArrzxtakRcISv+XMIPl4aGBUJm8Emk7qBYU8IlgNEIpiJhk/No24jHwkKTFHDWfPniR4iw5vJaw2nzSjfq2zffcE/GDjRC2dn0J0XwPAbDL84TvaFCJEU4Oml9pRyEUhR3Cl2t01AoEjRbs0sYugp14/4X5n4pU4EHHnMAAAAAElFTkSuQmCC X-PGP: 50751FF4 X-PGP-FP: AC1F 5F5C D418 88F8 CC84 5858 2060 4012 5075 1FF4 X-Hashcash: 1:20:150924:linux-kernel@vger.kernel.org::pdB8O1jhOQ2G9IU+:0000000000000000000000000000000000AZ0 X-Hashcash: 1:20:150924:peterz@infradead.org::PP/ZFH2wn8H6bWkT:000000000000000000000000000000000000000000RcF X-Hashcash: 1:20:150924:adobriyan@gmail.com::hhffShHux6lPdJ1p:0000000000000000000000000000000000000000001GeS X-Hashcash: 1:20:150924:torvalds@linux-foundation.org::RAWBABxxlx49QqIj:000000000000000000000000000000001+sr X-Hashcash: 1:20:150924:john.stultz@linaro.org::J3EnYJtKAfN4xkdG:0000000000000000000000000000000000000001aO5 X-Hashcash: 1:20:150924:akpm@linux-foundation.org::pJUUbAeOi8qqkp1a:00000000000000000000000000000000000021zL X-Hashcash: 1:20:150924:mingo@kernel.org::cp+M24EgFRsqBgbR:03+d3 X-Hashcash: 1:20:150924:rostedt@goodmis.org::x9hhv92FLsKFVMXC:0000000000000000000000000000000000000000006Non X-Hashcash: 1:20:150924:a.p.zijlstra@chello.nl::ftd6wC6Cj77EgAZ8:0000000000000000000000000000000000000009M4z X-Hashcash: 1:20:150924:masami.hiramatsu.pt@hitachi.com::5iT61cdWeF4R0Njx:0000000000000000000000000000007TEh Date: Thu, 24 Sep 2015 15:32:55 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 23 2015, Alexey Dobriyan wrote: > I've sent kabs() before which didn't go in because it didn't work for > INT_MAX et al > (don't worry, this abs() doens't as well) but it is nicer that this > version in other aspects > (hopefully). > > [PATCH v2] Add kabs() > http://marc.info/?l=linux-kernel&m=133518745522740&w=4 Perhaps: + (void)(_x))))))); \ instead of: + _x)))))); \ at the end. Since kabs makes no sense for unsigned types it’s best to fail with compile-time error than to let user think that the call is actually doing something. Also, you don’t need ({ … }) around the ‘_x < 0 ? -_x : _x’ expression, do you? -- Best regards, _ _ .o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o ..o | Computer Science, ミハウ “mina86” ナザレヴイツ (o o) ooo +---------ooO--(_)--Ooo--