Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp168447pxk; Wed, 16 Sep 2020 00:52:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKR5OHShRURk6EyJ7ZnmHCfE6iktFK411digCwzodRKTpn3VGCkr3sTTH8IaITqcuUsT1G X-Received: by 2002:a05:6402:17f6:: with SMTP id t22mr25850365edy.374.1600242778828; Wed, 16 Sep 2020 00:52:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600242778; cv=none; d=google.com; s=arc-20160816; b=H7jBCIiSKVsbxLJR0nE5+LCwJXd6/iFnbDspapz9a123ohyDnMmVPU+WIbiXJ15zZJ DgsadL2pVABORi+eZuX9GrL/rpZQ08+H4e+cdbvyvRvEPySEyWXV2sXTuth5yTuU8ZAY kNNxWFnavnp6RK0nG5GiOn0l9MngFx+cmOgQgRJUNArLrmxFY72cif95fndleCKgqi16 sL7t9w8nu8ycMo8OlUOENQYUUevZuSlzpayBbqOpHkND0ZaFfhkk/BE1oyTrn2PoAzQd E3SDM6w35UzxxCMjA6bCoouiCyUttWUFsdG1piRBEYheZVh0cYkK+jS7mz11RrXL4aKH Hy8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=dVvKltWqBEU89BlHB4WRQdNVMd2wZl+8cOFR2ESkNKo=; b=w+HLJEYTtRRrelQypVASPbeqUTKE47V9afeKNHhpqsYm0oDC1JrK6yXM7SaOZUaWb7 69NrDBz88yE2BhG86XBuiL62yllWFwKKz5uBlwUqbXDz+JougfJnUQZKVN+Gbs1Hn5cp wAGBn7ZSo8EvawSd48hA+2eiDmTPU8CZTYzbNncOFybvuljsZHncUm/qZFpetX/TtToT iThEhtK1cKArwRZNCsmhHgN+Mmpb46YKLx4BJQiPYZ5ay92LNeVeHMRk3AbJw0NDAMRg J84bbi7iMJvD8F8l//ls9LyPDKpIYFSK2KEOzdD/7uyu8BrvoOxMyOq+AbJxQeSV7ZxC tqcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=Q2xM5bAJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b18si10861577eju.731.2020.09.16.00.52.35; Wed, 16 Sep 2020 00:52:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=Q2xM5bAJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726349AbgIPHwF (ORCPT + 99 others); Wed, 16 Sep 2020 03:52:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726189AbgIPHwB (ORCPT ); Wed, 16 Sep 2020 03:52:01 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5BDDC06174A for ; Wed, 16 Sep 2020 00:52:00 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id e11so1630813wme.0 for ; Wed, 16 Sep 2020 00:52:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=dVvKltWqBEU89BlHB4WRQdNVMd2wZl+8cOFR2ESkNKo=; b=Q2xM5bAJA/Q2WFGxfesK2VFF/My8eoWs6bHKJhos95mBiqc9lVTNUtWxEjtDNhw9P+ o2nW4Oc7bpXzn5htepF+j+WG1QREUrbdjd8zyVZii+omDNhTHcBpXOgfr1/APV87AC2S +H6ZwmSx2gokn9FmGFszkLtNCBIMZ3a4lT/FM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=dVvKltWqBEU89BlHB4WRQdNVMd2wZl+8cOFR2ESkNKo=; b=PCkApXFJ3O5R+ZsByT0KgNnIe2vh53+r1GrZ93Gk0cX7J249UTGwlnQmnYKbGbMoVZ FCaXaepTPxIq/r/SjC17tx17uwHxiar1IoqNcG6EcMCAh7nf2LMzNQ1fAHwokc9gbfJ3 cQ2BGaDLFqjtyXUGbm90wOevkQJKfZqOxu7nfVtmaRhId1F7UqDxV97ba9eIbPo1vIzb xIq+1dR+LJXothEUwCPpgl+wlgvjZesT3VOn4YC3Pd4V1RKPH9Zysjg5mOCZp+Jit0/4 8Xfe61yvOJjy8prhpryjDDJ/m5ofM+FSM2R/JAOYFgnc8T2NuyMpzntb2n34DSWg8Z4N jY+w== X-Gm-Message-State: AOAM531tzV0eJeIOglillZUdBvZgEZF8Of50SkVZjaaLG5K17oxJqS5T 29sRRZJlasfjDf74PS2o0L+B6g== X-Received: by 2002:a1c:a551:: with SMTP id o78mr3315971wme.4.1600242719437; Wed, 16 Sep 2020 00:51:59 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id m10sm3771805wmi.9.2020.09.16.00.51.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 00:51:58 -0700 (PDT) Date: Wed, 16 Sep 2020 09:51:56 +0200 From: Daniel Vetter To: christian.koenig@amd.com Cc: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , Alex Deucher , yi.zhang@huawei.com, Dave Airlie , LKML , amd-gfx list , Zheng Bin , Maling list - DRI developers , "Deucher, Alexander" Subject: Re: [PATCH -next 0/8] drm/amd/amdgpu: fix comparison pointer to bool warning Message-ID: <20200916075156.GU438822@phenom.ffwll.local> Mail-Followup-To: christian.koenig@amd.com, Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , Alex Deucher , yi.zhang@huawei.com, Dave Airlie , LKML , amd-gfx list , Zheng Bin , Maling list - DRI developers , "Deucher, Alexander" References: <20200909130720.105234-1-zhengbin13@huawei.com> <1fce0f2a-3777-e6d8-5a09-30261f843cfd@amd.com> <20200915193549.GP6112@intel.com> <6658f89f-6957-e6ea-af41-7625f1fd3cb1@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6658f89f-6957-e6ea-af41-7625f1fd3cb1@gmail.com> X-Operating-System: Linux phenom 5.7.0-1-amd64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 16, 2020 at 09:38:34AM +0200, Christian K?nig wrote: > Am 15.09.20 um 21:35 schrieb Ville Syrj?l?: > > On Tue, Sep 15, 2020 at 03:16:32PM -0400, Alex Deucher wrote: > > > I question the value of these warnings. Why even have a boolean type > > > if you are going to get warnings when you use them... > > > That said, applied to avoid getting these patches again and again > > > every time someone sees this. > > if (this_is_sparta) > > if (this_is_sparta == true) > > if (this_is_sparta != false) > > > > I think the first one reads the best, and avoids having to > > decide between truth and falsehood :) > > +1 +1, especially because we also have the inversion when using negative errno codes for failures and 0 as success, which results in if (errno == 0) /* success case */ but if (bool == 0) /* failure case */ now creative people do sometimes if (!errno) /* success case */ which I think is horribly confusing. So imo for more easier telling apart of these too I think consistently using the short form for booleans, and consistently using the more explicit long form for errno checks is a Very Good Pattern :-) Cheers, Daniel > > Christian. > > > > > > Alex > > > > > > On Wed, Sep 9, 2020 at 9:21 AM Christian K?nig wrote: > > > > Acked-by: Christian K?nig for the series. > > > > > > > > Am 09.09.20 um 15:07 schrieb Zheng Bin: > > > > > Zheng Bin (8): > > > > > drm/amd/amdgpu: fix comparison pointer to bool warning in gfx_v9_0.c > > > > > drm/amd/amdgpu: fix comparison pointer to bool warning in gfx_v10_0.c > > > > > drm/amd/amdgpu: fix comparison pointer to bool warning in sdma_v5_0.c > > > > > drm/amd/amdgpu: fix comparison pointer to bool warning in sdma_v5_2.c > > > > > drm/amd/amdgpu: fix comparison pointer to bool warning in si.c > > > > > drm/amd/amdgpu: fix comparison pointer to bool warning in uvd_v6_0.c > > > > > drm/amd/amdgpu: fix comparison pointer to bool warning in > > > > > amdgpu_atpx_handler.c > > > > > drm/amd/amdgpu: fix comparison pointer to bool warning in sdma_v4_0.c > > > > > > > > > > drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 4 ++-- > > > > > drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +- > > > > > drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 +- > > > > > drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 4 ++-- > > > > > drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 2 +- > > > > > drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 2 +- > > > > > drivers/gpu/drm/amd/amdgpu/si.c | 2 +- > > > > > drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 4 ++-- > > > > > 8 files changed, 11 insertions(+), 11 deletions(-) > > > > > > > > > > -- > > > > > 2.26.0.106.g9fadedd > > > > > > > > > _______________________________________________ > > > > amd-gfx mailing list > > > > amd-gfx@lists.freedesktop.org > > > > https://lists.freedesktop.org/mailman/listinfo/amd-gfx > > > _______________________________________________ > > > dri-devel mailing list > > > dri-devel@lists.freedesktop.org > > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch