Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp508062lqo; Wed, 8 May 2024 06:45:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWQez1hsptMg7inU3ZOtPyYwh93l4YD8uAFmmx54klZd/DhcM49sCNSlF5iNSS6mcSRvD+uAujOeScMezb5ddMWk7jGhWTFt4zO9/gBtw== X-Google-Smtp-Source: AGHT+IGhkwLjMONWjCFhPM3l7zteQ+Wm8IVYlE6mqnxzyfbfsFgj8xQAu00ZmI1F7QRyJxNQbPUj X-Received: by 2002:a50:d581:0:b0:572:475c:a47c with SMTP id 4fb4d7f45d1cf-5731d9f1285mr1617278a12.22.1715175948502; Wed, 08 May 2024 06:45:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715175948; cv=pass; d=google.com; s=arc-20160816; b=bntAPfDE4IS2prNqiMoSa/jiUor07n5BdrsxVxbjWa5aoFmoSKlbW9b7862BqPGviL vOSD1U1CpXCfLEIe+BLEV8HrD3dvFsSlV9yRgAMgXVQeDxg0GXolo4DsYcoDBwJ/f8I/ AxWYj2/Ikq+qFX0kHur5lsC0FHtVkRojMUTgOdkke8gf62qORBz4f7wiTMbELWQqKveg 6rdUrXCaC+4qGzj2WCNem7dkzxuMWHzUKgu/gB7hsbl3Cg7Xi85vx6WV665jPpOMGIoC FB1EFaBnLL8AGFVH8RUYpdySTurnRl+zu4tYktSsJqRcktrOYL/aSpy4lGC/bOeWauq0 SerQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:subject :references:in-reply-to:cc:to:from; bh=HdLwJzJzN26EbeVFHgIYT0zSRH89Hk8KEgn+Hy1YW+g=; fh=k85PMKMcRVUki7ujjtlfOhxbl91QHEiT/WWf26T0SQo=; b=RPZdp3G19dEVhVgWCt6R/UB+auBZ+IANeTLNZ4lYuWAYBSu0b5DjTXSstLKdtNPibc P3rV/U37uVQnMUhDUy0mBzsawM7I7ulouEtYsrtFLC4qqEAK7Xc6esdv5hdkTRpo7Yub TYi4Ehndtp0UI1q8vdLBHVwjZCgdFqychZQzNYNPi9nTc++J11ubMXt3ELrc+MKMCw7q coXR5csrY6Cm97p3CEsVCHGiGXAj8fcUmbeRnYlc3rKznan62va4CHYrUBRo6PAsJrl7 PC7h9EBFM2GY0uciQZFMkAm5lbuN8OHhDL7mdGKkJhKV0CViUHjZOTYXaBv73cbE8ZCz STgA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=ellerman.id.au); spf=pass (google.com: domain of linux-kernel+bounces-173344-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173344-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id l7-20020a056402344700b00572aed54c93si6850402edc.337.2024.05.08.06.45.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 06:45:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-173344-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=ellerman.id.au); spf=pass (google.com: domain of linux-kernel+bounces-173344-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173344-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7F24A1F27444 for ; Wed, 8 May 2024 13:44:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04530127E1E; Wed, 8 May 2024 13:42:03 +0000 (UTC) Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D1E886629 for ; Wed, 8 May 2024 13:42:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=150.107.74.76 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715175722; cv=none; b=WSaSepJwNqy3zhDhOpfsxQKSVz7gmeRNsnFj7GBDH+FjMLRq/AamD/LCWi+DGraRFUTI0f+153BldK5nXjHY+MXV+0ZK9bkacqDD6ejhBUoMG4G/AHX+R4lMsGap34KoLVEa32QpFfGMu0RQzt6RXoatQBsX60z2heTU0pXoQRA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715175722; c=relaxed/simple; bh=RXHSKMLHZrN5WJW3gPBJ+WFN36aCE7TQwQgyl5eudkQ=; h=From:To:Cc:In-Reply-To:References:Subject:Message-Id:Date: MIME-Version:Content-Type; b=ljYsKJC41hBAuc2MDI+Pm2qQFAvBPrVM0dJhguWtOSYco2KCKvflwe2gPaeUFVWjnKja80PffuTTiT3OJV+wXzg7zdGbLYQjzP2TKYQKN+HxR6ZbmjLi30MYxpOr6dUZwbx4lBNEWLudH0eNpZvjp6ZPORi04x05viMfWwkN9Ck= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au; spf=pass smtp.mailfrom=ellerman.id.au; arc=none smtp.client-ip=150.107.74.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ellerman.id.au Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4VZGXS5NX9z4xKZ; Wed, 8 May 2024 23:42:00 +1000 (AEST) From: Michael Ellerman To: linuxppc-dev@lists.ozlabs.org, Michael Ellerman Cc: arnd@arndb.de, naresh.kamboju@linaro.org, linux-kernel@vger.kernel.org, nathan@kernel.org In-Reply-To: <20240503075619.394467-1-mpe@ellerman.id.au> References: <20240503075619.394467-1-mpe@ellerman.id.au> Subject: Re: [PATCH v2 1/2] powerpc/io: Avoid clang null pointer arithmetic warnings Message-Id: <171517558549.165093.14013162517942082900.b4-ty@ellerman.id.au> Date: Wed, 08 May 2024 23:39:45 +1000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Fri, 03 May 2024 17:56:18 +1000, Michael Ellerman wrote: > With -Wextra clang warns about pointer arithmetic using a null pointer. > When building with CONFIG_PCI=n, that triggers a warning in the IO > accessors, eg: > > In file included from linux/arch/powerpc/include/asm/io.h:672: > linux/arch/powerpc/include/asm/io-defs.h:23:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] > 23 | DEF_PCI_AC_RET(inb, u8, (unsigned long port), (port), pio, port) > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ... > linux/arch/powerpc/include/asm/io.h:591:53: note: expanded from macro '__do_inb' > 591 | #define __do_inb(port) readb((PCI_IO_ADDR)_IO_BASE + port); > | ~~~~~~~~~~~~~~~~~~~~~ ^ > > [...] Applied to powerpc/next. [1/2] powerpc/io: Avoid clang null pointer arithmetic warnings https://git.kernel.org/powerpc/c/03c0f2c2b2220fc9cf8785cd7b61d3e71e24a366 [2/2] powerpc/64: Set _IO_BASE to POISON_POINTER_DELTA not 0 for CONFIG_PCI=n https://git.kernel.org/powerpc/c/be140f1732b523947425aaafbe2e37b41b622d96 cheers