Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3370758imm; Fri, 25 May 2018 04:42:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqmsmwlHpB6fw+FzoZ2oXHcWzHcpXaUmtmA5OPQ1y3izc4EGAQy2CCBD2kKjAtv/iD4XN7a X-Received: by 2002:a17:902:1a6:: with SMTP id b35-v6mr2268509plb.80.1527248540477; Fri, 25 May 2018 04:42:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527248540; cv=none; d=google.com; s=arc-20160816; b=JATpieE0eTIlc/jhFnnbrZS3Wx2RDVFDDn1GCaravQwNhP9TE+ZF4OlRF0VJpOCeCI ju24sqGuqAqAVFsIGZjmduPlYh9bk6t7ygrkXY+KegZ3kcYWoFdV4UXIEiIItYrR0etI MqyfiJ2111pgCbcqEnXxY2WI1xXJuankDU3DJQ/cxUxlf49zO/VjTcZ6vbcdRaj9IOD7 Bt+hfH1g/tPZHjMsb49d6H1/ZiGqn08bU7PmDZizVM5WuIiFFQN2BUoTebioJNLvx5G6 Dy0XjFXymM0oEA8SW5uhCoQX6/qwnfxzjHIHyvD4X90GCByXIpreabvaCTlP3Rs0kNQ8 drYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:subject:cc:from:to :in-reply-to:arc-authentication-results; bh=uzXM6evAAa0SWrcKiUZmPcPBtSE9+EUfHPXFWG1siNc=; b=H8f/R7DXYKKiEJ5ZZXpj8p61R7Y1DSmmq4Op96TKwaVQuiefzmz7f5HEOpdi+LUEK8 bZarpLopvlHM/wPFMMdheJSSaGyrg5R/EyqkgiM9FAp27D0hNTJp6SgKCFxqNmHA+Eo1 eG4VOxXm46dEcf3LwEPIK23lZYfFTxZpj+7q8Mf+XdiAREfLMEU4h2daAkor11GjI2Fo JBnFRomJRLKOMKlZVVRSGBspS3Z0rto3uWKidQ9PnNgms+JNz64KzPs1Zoq9Lf0warkh 6tTsh7Mf320C2WkU2SXvwBDWx5pEwpSBDIJIZRnriCXpKeThIFNKRK2A+nRkfXdaQxiV eyaQ== 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 u9-v6si24252751plk.516.2018.05.25.04.42.02; Fri, 25 May 2018 04:42:20 -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 S966674AbeEYLlp (ORCPT + 99 others); Fri, 25 May 2018 07:41:45 -0400 Received: from ozlabs.org ([203.11.71.1]:56711 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966591AbeEYLlk (ORCPT ); Fri, 25 May 2018 07:41:40 -0400 Received: by ozlabs.org (Postfix, from userid 1034) id 40skqQ1Nybz9s1w; Fri, 25 May 2018 21:41:37 +1000 (AEST) X-powerpc-patch-notification: thanks X-powerpc-patch-commit: d8731527acee53b4d46d59ff0b5fc36931ad0451 In-Reply-To: <20180413184144.25183-1-malat@debian.org> To: Mathieu Malaterre , Benjamin Herrenschmidt From: Michael Ellerman Cc: Mathieu Malaterre , Paul Mackerras , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [v2] powerpc/sparse: fix plain integer as NULL pointer warning Message-Id: <40skqQ1Nybz9s1w@ozlabs.org> Date: Fri, 25 May 2018 21:41:37 +1000 (AEST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2018-04-13 at 18:41:43 UTC, Mathieu Malaterre wrote: > Trivial fix to remove the following sparse warnings: > > arch/powerpc/kernel/module_32.c:112:74: warning: Using plain integer as NULL pointer > arch/powerpc/kernel/module_32.c:117:74: warning: Using plain integer as NULL pointer > drivers/macintosh/via-pmu.c:1155:28: warning: Using plain integer as NULL pointer > drivers/macintosh/via-pmu.c:1230:20: warning: Using plain integer as NULL pointer > drivers/macintosh/via-pmu.c:1385:36: warning: Using plain integer as NULL pointer > drivers/macintosh/via-pmu.c:1752:23: warning: Using plain integer as NULL pointer > drivers/macintosh/via-pmu.c:2084:19: warning: Using plain integer as NULL pointer > drivers/macintosh/via-pmu.c:2110:32: warning: Using plain integer as NULL pointer > drivers/macintosh/via-pmu.c:2167:19: warning: Using plain integer as NULL pointer > drivers/macintosh/via-pmu.c:2183:19: warning: Using plain integer as NULL pointer > drivers/macintosh/via-pmu.c:277:20: warning: Using plain integer as NULL pointer > arch/powerpc/platforms/powermac/setup.c:155:67: warning: Using plain integer as NULL pointer > arch/powerpc/platforms/powermac/setup.c:247:27: warning: Using plain integer as NULL pointer > arch/powerpc/platforms/powermac/setup.c:249:27: warning: Using plain integer as NULL pointer > arch/powerpc/platforms/powermac/setup.c:252:37: warning: Using plain integer as NULL pointer > arch/powerpc/mm/tlb_hash32.c:127:21: warning: Using plain integer as NULL pointer > arch/powerpc/mm/tlb_hash32.c:148:21: warning: Using plain integer as NULL pointer > arch/powerpc/mm/tlb_hash32.c:44:21: warning: Using plain integer as NULL pointer > arch/powerpc/mm/tlb_hash32.c:57:21: warning: Using plain integer as NULL pointer > arch/powerpc/mm/tlb_hash32.c:87:21: warning: Using plain integer as NULL pointer > arch/powerpc/kernel/btext.c:160:31: warning: Using plain integer as NULL pointer > arch/powerpc/kernel/btext.c:167:22: warning: Using plain integer as NULL pointer > arch/powerpc/kernel/btext.c:274:21: warning: Using plain integer as NULL pointer > arch/powerpc/kernel/btext.c:285:31: warning: Using plain integer as NULL pointer > arch/powerpc/include/asm/hugetlb.h:204:16: warning: Using plain integer as NULL pointer > arch/powerpc/mm/ppc_mmu_32.c:170:21: warning: Using plain integer as NULL pointer > arch/powerpc/platforms/powermac/pci.c:1227:23: warning: Using plain integer as NULL pointer > arch/powerpc/platforms/powermac/pci.c:65:24: warning: Using plain integer as NULL pointer > > Also use `--fix` command line option from `script/checkpatch --strict` to > remove the following: > > CHECK: Comparison to NULL could be written "!dispDeviceBase" > #72: FILE: arch/powerpc/kernel/btext.c:160: > + if (dispDeviceBase == NULL) > > CHECK: Comparison to NULL could be written "!vbase" > #80: FILE: arch/powerpc/kernel/btext.c:167: > + if (vbase == NULL) > > CHECK: Comparison to NULL could be written "!base" > #89: FILE: arch/powerpc/kernel/btext.c:274: > + if (base == NULL) > > CHECK: Comparison to NULL could be written "!dispDeviceBase" > #98: FILE: arch/powerpc/kernel/btext.c:285: > + if (dispDeviceBase == NULL) > > CHECK: Comparison to NULL could be written "strstr" > #117: FILE: arch/powerpc/kernel/module_32.c:117: > + if (strstr(secstrings + sechdrs[i].sh_name, ".debug") != NULL) > > CHECK: Comparison to NULL could be written "!Hash" > #130: FILE: arch/powerpc/mm/ppc_mmu_32.c:170: > + if (Hash == NULL) > > CHECK: Comparison to NULL could be written "Hash" > #143: FILE: arch/powerpc/mm/tlb_hash32.c:44: > + if (Hash != NULL) { > > CHECK: Comparison to NULL could be written "!Hash" > #152: FILE: arch/powerpc/mm/tlb_hash32.c:57: > + if (Hash == NULL) { > > CHECK: Comparison to NULL could be written "!Hash" > #161: FILE: arch/powerpc/mm/tlb_hash32.c:87: > + if (Hash == NULL) { > > CHECK: Comparison to NULL could be written "!Hash" > #170: FILE: arch/powerpc/mm/tlb_hash32.c:127: > + if (Hash == NULL) { > > CHECK: Comparison to NULL could be written "!Hash" > #179: FILE: arch/powerpc/mm/tlb_hash32.c:148: > + if (Hash == NULL) { > > ERROR: space required after that ';' (ctx:VxV) > #192: FILE: arch/powerpc/platforms/powermac/pci.c:65: > + for (; node != NULL;node = node->sibling) { > > CHECK: Comparison to NULL could be written "node" > #192: FILE: arch/powerpc/platforms/powermac/pci.c:65: > + for (; node != NULL;node = node->sibling) { > > CHECK: Comparison to NULL could be written "!region" > #201: FILE: arch/powerpc/platforms/powermac/pci.c:1227: > + if (region == NULL) > > CHECK: Comparison to NULL could be written "of_get_property" > #214: FILE: arch/powerpc/platforms/powermac/setup.c:155: > + if (of_get_property(np, "cache-unified", NULL) != NULL && dc) { > > CHECK: Comparison to NULL could be written "!np" > #223: FILE: arch/powerpc/platforms/powermac/setup.c:247: > + if (np == NULL) > > CHECK: Comparison to NULL could be written "np" > #226: FILE: arch/powerpc/platforms/powermac/setup.c:249: > + if (np != NULL) { > > CHECK: Comparison to NULL could be written "l2cr" > #230: FILE: arch/powerpc/platforms/powermac/setup.c:252: > + if (l2cr != NULL) { > > CHECK: Comparison to NULL could be written "via" > #243: FILE: drivers/macintosh/via-pmu.c:277: > + if (via != NULL) > > CHECK: Comparison to NULL could be written "current_req" > #252: FILE: drivers/macintosh/via-pmu.c:1155: > + if (current_req != NULL) { > > CHECK: Comparison to NULL could be written "!req" > #261: FILE: drivers/macintosh/via-pmu.c:1230: > + if (req == NULL || pmu_state != idle > > CHECK: Comparison to NULL could be written "!req" > #270: FILE: drivers/macintosh/via-pmu.c:1385: > + if (req == NULL) { > > CHECK: Comparison to NULL could be written "!pp" > #288: FILE: drivers/macintosh/via-pmu.c:2084: > + if (pp == NULL) > > CHECK: Comparison to NULL could be written "!pp" > #297: FILE: drivers/macintosh/via-pmu.c:2110: > + if (count < 1 || pp == NULL) > > CHECK: Comparison to NULL could be written "!pp" > #306: FILE: drivers/macintosh/via-pmu.c:2167: > + if (pp == NULL) > > CHECK: Comparison to NULL could be written "pp" > #315: FILE: drivers/macintosh/via-pmu.c:2183: > + if (pp != NULL) { > > Link: https://github.com/linuxppc/linux/issues/37 > Signed-off-by: Mathieu Malaterre Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/d8731527acee53b4d46d59ff0b5fc3 cheers