Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp6186241ybn; Sun, 29 Sep 2019 14:19:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIV6byokfug8Ada2y0Fo9eNeYWAoHp8HH1d79mb10gZOUoQqgnDGOxG78w7/swb0NagiHe X-Received: by 2002:a05:6402:65a:: with SMTP id u26mr16335826edx.86.1569791947005; Sun, 29 Sep 2019 14:19:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569791946; cv=none; d=google.com; s=arc-20160816; b=wfW27sOMdaAm8x4XrPFPcsKFfkhOHJ2mVCxkiUmojkCWoWsZNFlZ3YgmrU1OZywODk gKR21tmRa36wB2O1vM1T0rvFRHDQ6O8PM0UyZq9++zRYXXEympdbI4xHPeoZMFjbRmI0 S214RTJXnhumFQsYQ4dWN56ZtoTuT2BvcFKvPYmAvn8Cm3Y/Pz3FHhQPKVsqAP/DZRD1 QPrsxWfuT3e5s0zxXise9s62ims+qTfeazEe2J1HmPMjsB+VY8Mjm95TdpqZz52DD0Xh 22DvHj7jCGF+8RGoMjFTyHf6mb1YoIzYareSdSTj0bczrO3oUcIW0CJXFfJmPmasgVKq QvcA== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=GARshYuS0/J7AX88vtnuv22wUYaUyMuVIDpSc70bmvQ=; b=QOpN75Wkk1PKXpJg2xoQYPhp/MNu7HEZ7r0nhE4PBs9qLbcylwkqNLBWiAeW+5j4Ju x7Cfqyjq/sdJSDMhNIzMxQe8EQKTO5NQ8kpzk0+hhBM7+AbiDnPEUia1q5fOiIEw/2P0 IsKrzXF35TEBMcUKNfj2HPbe3jJIoYA+OgwMLJZehlQHxfBYUJcovZERAUyD93L64Ccn znlsjnkGDqJZfSO7JYsjwZlNL+mNY3Z0UdcLJNsB/Q1E72Bnygc0ehXN0Dw+nIKuxut3 RSixBkf7E/tyoj6Sw6pziBAQt4H7gS0QdYF1xPJTKgU5nt1heWsYiHpeTMlt11KD9Kuo 4KXQ== 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 d17si5817654eda.213.2019.09.29.14.18.39; Sun, 29 Sep 2019 14:19:06 -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; 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 S1729010AbfI2VQa (ORCPT + 99 others); Sun, 29 Sep 2019 17:16:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:34032 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726390AbfI2VQa (ORCPT ); Sun, 29 Sep 2019 17:16:30 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0D61E217F5; Sun, 29 Sep 2019 21:16:28 +0000 (UTC) Date: Sun, 29 Sep 2019 17:16:27 -0400 From: Steven Rostedt To: Alexey Dobriyan Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, intel-gfx@lists.freedesktop.org, mingo@redhat.com, linux@rasmusvillemoes.dk Subject: Re: [PATCH] Make is_signed_type() simpler Message-ID: <20190929171627.1b854409@gandalf.local.home> In-Reply-To: <20190929204424.GA14565@avx2> References: <20190929200619.GA12851@avx2> <20190929161531.727da348@gandalf.local.home> <20190929204424.GA14565@avx2> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 29 Sep 2019 23:44:24 +0300 Alexey Dobriyan wrote: > On Sun, Sep 29, 2019 at 04:15:31PM -0400, Steven Rostedt wrote: > > On Sun, 29 Sep 2019 23:06:19 +0300 > > Alexey Dobriyan wrote: > > > > > * Simply compare -1 with 0, > > > * Drop unnecessary parenthesis sets > > > > > > New macro leaves pointer as "unsigned type" but gives a warning, > > > which should be fine because asking whether a pointer is signed is > > > strange question. > > > > > > I'm not sure what's going on in the i915 driver, it is shipping kernel > > > pointers to userspace. > > > > This tells us what the patch does, not why. > > Check the subject line. I don't see how it's simpler. -#define is_signed_type(type) (((type)(-1)) < (type)1) +#define is_signed_type(type) ((type)-1 < 0) Requires more rational that "make it simpler". Rewriting futex or tty layer code would be something I would love to see, but just replacing "(type)1" with "0" isn't worth the churn. -- Steve