Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3009421pxb; Mon, 18 Oct 2021 06:32:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSJw6cpeMGop0+1Rf0Jf5ai9YlAZ4+WpVHd7wUZQs90cFwxgaabzU1GdI7bEmMbhptPevs X-Received: by 2002:a17:90b:17d0:: with SMTP id me16mr48242436pjb.152.1634563925263; Mon, 18 Oct 2021 06:32:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634563925; cv=none; d=google.com; s=arc-20160816; b=TqBrKAsrooJBonx5RTYBmbjGQnRn3YTMFbQO5yiuhM17gmYGr9eUh7ma6DDZHTloha HyUGXqgAF4qrt+9wYlDiA5Yuok4D3bIZNxj5geTlGgxSMLJJHWbBva/0PzmGoiyQ5V30 4/iKRdA7rU9RhZL3VxypoODZRNP/iQ95EpvRdT5Px+mRn1Bqng7XG8j+2gUqrlk3zS2z yZNH8v/kQZF7gYfB0byMZsY/lB4voyGu8fOyXqOCpktm84zUk1tr5uhQh51l2axOgDqw wKGANhWIxOaJmqNHBfdKQCUhJa5LGZ1NVlzwh+YoQ1Sfvx6VjhjFfZH9yvLNwzr1NKfe BehQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lXIf352S8ywk9VerMOfmfooA+x1KAAa0VUtbvfKq0Yc=; b=to0jZ+Sdy+COylUc78VvImrKFXAbpUZ9Dgizfo05rgFzM8q81GGQQmRPTXkm8pjaFe bA8ZKh1bVvKgP3Tzsj8pXwk8YkXdC/D6a+M9bzJMoNbU4WaGKWAoRU+zicBXzRfCicD+ C1RevxTHvHGBpgwRm5IMcsWCgTuuuCZUJnOIeeW7tB7V77If3amhGsHaoElZxYBD4CSB s8mHKKsTnMnLhjFanZiql0pKo8CM7PAKRJxOZTl4HcHvCDpn8WHzsK7DQxz7imrvSf5p CKYW2uueHK1bl472+IJz/oKEZA7mmWgIv6JC67vE2vmwMC+ooOWfd6lWoTgrXonlibgT xDew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=A8IUXsCP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y15si28999111pfa.131.2021.10.18.06.31.52; Mon, 18 Oct 2021 06:32:05 -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=@linuxfoundation.org header.s=korg header.b=A8IUXsCP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232870AbhJRNbl (ORCPT + 99 others); Mon, 18 Oct 2021 09:31:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:41820 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232017AbhJRN3y (ORCPT ); Mon, 18 Oct 2021 09:29:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8AA616135A; Mon, 18 Oct 2021 13:27:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634563663; bh=lO0DuIKUZ5zkgHkfV2sRjPBl0xkSfEwWiAYLq1/9Cq4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A8IUXsCPRbRkAJpz3kCnqkvJZF/pDuOm1cSGyeJYvVktI8Fw708Fi9GSkkjEsstcv zHgGtM+B/h8+TWMHzYP1Q/1CIdsIyDMyMgKullFsaB/HOn45LUea+vDGr8bJQAfCZ/ e461U7uQYurJoWodopM2dWG1YfWz6F+b/JbBZ3Og= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann Subject: [PATCH 4.19 15/50] cb710: avoid NULL pointer subtraction Date: Mon, 18 Oct 2021 15:24:22 +0200 Message-Id: <20211018132327.040545561@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132326.529486647@linuxfoundation.org> References: <20211018132326.529486647@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann commit 42641042c10c757fe10cc09088cf3f436cec5007 upstream. clang-14 complains about an unusual way of converting a pointer to an integer: drivers/misc/cb710/sgbuf2.c:50:15: error: performing pointer subtraction with a null pointer has undefined behavior [-Werror,-Wnull-pointer-subtraction] return ((ptr - NULL) & 3) != 0; Replace this with a normal cast to uintptr_t. Fixes: 5f5bac8272be ("mmc: Driver for CB710/720 memory card reader (MMC part)") Cc: stable Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20210927121408.939246-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/misc/cb710/sgbuf2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/misc/cb710/sgbuf2.c +++ b/drivers/misc/cb710/sgbuf2.c @@ -50,7 +50,7 @@ static inline bool needs_unaligned_copy( #ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS return false; #else - return ((ptr - NULL) & 3) != 0; + return ((uintptr_t)ptr & 3) != 0; #endif }