Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp907183rdb; Fri, 1 Dec 2023 01:33:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IEvhhx++WhEGRzlW1kkRDRhWZo7YuuO2BLOYTGc2UaXWhVZo+OX7hr/OWSbI1nRzQcYjnAz X-Received: by 2002:a05:6358:89e:b0:16c:24d:8252 with SMTP id m30-20020a056358089e00b0016c024d8252mr28574717rwj.8.1701423220242; Fri, 01 Dec 2023 01:33:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701423220; cv=none; d=google.com; s=arc-20160816; b=ormXfiydYBOJiAHmRjg8rIoqeQTlsDYnUrqGIyi/QK1b5jAt7sZ46nf3927n4/BqST Bh1dJHIuKevZTi7Tuy5dRURg6TgR6cxT30uxCEEn/B51evZYWEbQzfTPvF4fx7mDlDvm OZGG/cL4X45ARhs+iKXO0BVKHp60XJ3u3kp3ehjCW6t9ANFfKYFQ3jibZbWtxgdb0DIq eWroyy3p6NK2v2/Xyrqj7MEskRrI3fZq7pq4epQhh3dvwU0lS7SrMnTv6L8WmA4q8X9K oznLCBxG+DmQ3qWd+WoN3SduuZeLIvIBojY29JFkKa+TWRsiRYCMBmcLjUW+ebwCvnUT xWtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=LDckJMY0+USVHrMrcRe21eD+8vxdnT0zL8W4pq/j+Po=; fh=E1fo2IoakCsND4Z1T+2sQQRs8VNzX6aoehAGQmx3eks=; b=NK3gR0h5PbYJJ8mWn03SzIMJssR38NtgMYA4xMBGVNeEt/jD6mXwtfNoAhq144ESst uojSr45sjNEH90E/vmG/dw+R+OgPjKkwCAlhLEPcNhW0/qcqqPPHOE1/I1m6Qv9A0dNH znvebim7EAuZX5/hw735wozg8LHWS3tJMfXWdEcTGT4bQQZJc8So3o2xDvvbaknVqMJp DgqMUSoUFKjoVYlNN6Oo+75Jwxgtf7ckz6uybJ+KlYkhD7XOcuDOsr4lc9rwEHychloq OP8Xfeko6+QZG+jC3a6oxP7vKG3UJ+laxJFpSf4IOr23Ey869sd8/c8S/4pZaiRtl/O/ Ur7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id bd5-20020a656e05000000b005b9a467330esi3371045pgb.707.2023.12.01.01.33.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 01:33:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 80D32825F15E; Fri, 1 Dec 2023 01:33:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235321AbjLAJdG (ORCPT + 99 others); Fri, 1 Dec 2023 04:33:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235324AbjLAJcy (ORCPT ); Fri, 1 Dec 2023 04:32:54 -0500 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E24D3242 for ; Fri, 1 Dec 2023 01:30:55 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0VxZv8NZ_1701423028; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0VxZv8NZ_1701423028) by smtp.aliyun-inc.com; Fri, 01 Dec 2023 17:30:34 +0800 From: Jiapeng Chong To: harry.wentland@amd.com Cc: sunpeng.li@amd.com, Rodrigo.Siqueira@amd.com, alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH] drm/amd/display: Fix warning comparing pointer to 0 Date: Fri, 1 Dec 2023 17:30:26 +0800 Message-Id: <20231201093026.122655-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 01 Dec 2023 01:33:37 -0800 (PST) Avoid pointer type value compared with 0 to make code clear. ./drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c:532:62-63: WARNING comparing pointer to 0. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7672 Signed-off-by: Jiapeng Chong --- drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c index 38360adc53d9..7d13d2e1bda8 100644 --- a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c @@ -529,7 +529,7 @@ enum dmub_status dmub_srv_calc_mem_info(struct dmub_srv *dmub, out->fb[i].cpu_addr = cpu_base + reg->base; out->fb[i].gpu_addr = gpu_base + reg->base; - if (i == DMUB_WINDOW_4_MAILBOX && params->cpu_inbox_addr != 0) { + if (i == DMUB_WINDOW_4_MAILBOX && params->cpu_inbox_addr) { out->fb[i].cpu_addr = (uint8_t *)params->cpu_inbox_addr + reg->base; out->fb[i].gpu_addr = params->gpu_inbox_addr + reg->base; } -- 2.20.1.7.g153144c