Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3008605pxb; Mon, 18 Oct 2021 06:31:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzQSeC4jceylBlmC6iYms6gQ7Orog3VNC09NzUGIvzYTKgHyN4i65HuSo9weHKoy9w4lRY X-Received: by 2002:a63:1d58:: with SMTP id d24mr24004259pgm.316.1634563875392; Mon, 18 Oct 2021 06:31:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634563875; cv=none; d=google.com; s=arc-20160816; b=jU99CxRAVj/TKBt2wdq1prtngZZPdZg8o+CUE9DuRAttrbUfD1CuPdbuyBk/l/Y2er OywDGHY05tpkBKYP7gVaVm1Tbj4LqqB7VCTiuEHxhq4X/pmKh/YE33ON78tgtkKhBidR +ig2RPUuAx8Z7TaY85rvjWE4B4j9PLV2yXptWwhYt1vLyQ+1rTASsbO5yDqulCGI9ldz 2Q5D9B5Cr0xZuBRNtChElu21wC+UNSGFSiTBunOxQKhaC2qaO9dPul2i23rfdFA/T2qo HCg3TZnAdbKl3uae7mPkkITvYG4kyW46lv7KANtPgiiQoKxPRSvwZlDka77ExdaW0QZN XfvA== 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=tJVIk8drTUPY6mrUvhkz9CeNI3opgvVrDduHiqbJEXpiynmVT0nVH1/uzd4gDJW4s0 9tsNKx7SmFzUWacfH9TOk6Jy5jzQzTtr7GNmuP3ykSzLJVBCq4Y00gU5QJujmhgIdXHv +sGs8ehbGk8Aip4G2hu5EANeEcTOKPfpu3spfccB4hNRwQcdZoRrFQPEu0mFuTViHQev 8MMIoJHtlWKRYiFnV7YBjghQAKGMcll2TCqYUkyh/JiYDxERiqZ/Si8+Sj9GwRnvtwMY 1vWv+3RiY+XXrtobMABAvHtPjeMdzsctM3KhWA/Wx1ABaqSl8CW6cBd2/VDByIKkvPBc xM4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OOn8uW3t; 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 c14si16165940plg.457.2021.10.18.06.31.02; Mon, 18 Oct 2021 06:31:15 -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=OOn8uW3t; 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 S232672AbhJRNaw (ORCPT + 99 others); Mon, 18 Oct 2021 09:30:52 -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 S232029AbhJRN3U (ORCPT ); Mon, 18 Oct 2021 09:29:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D51C460295; Mon, 18 Oct 2021 13:27:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634563629; bh=lO0DuIKUZ5zkgHkfV2sRjPBl0xkSfEwWiAYLq1/9Cq4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OOn8uW3tsgB79PpTisrrLjj1++QVj83kGSAA1xAFqqsUCcjrJ3VKMCffp+SKjCOBr 7b6YhZacFbiBZ1I7H62KJoRTjHDqYHqZOLz13aHmaAEV3N2j1i1NIuzfav1vA5RCca xspRYn2QqvBTM6BfxpA4HoG2TLx18QXlVeIZmvTI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann Subject: [PATCH 4.14 09/39] cb710: avoid NULL pointer subtraction Date: Mon, 18 Oct 2021 15:24:18 +0200 Message-Id: <20211018132325.751304440@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132325.426739023@linuxfoundation.org> References: <20211018132325.426739023@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 }