From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 22260356746; Tue, 21 Jul 2026 19:51:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784663484; cv=none; b=NEFXqZM2fhY5Tbd+R62pbPsAmhulW/8K63dnyQiL7rORfFXqUp+2M/mhTUL/sZrZXK2+iFdmsoB6EM6JwTwhLC01cYsQnL/tZfW7j68ffO1l4k2KrSiMmJ5TNrasjzEehlyHjUACGjIi/ebiPlQvAiPv/1JcMzTAVhdx/kL6xRQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784663484; c=relaxed/simple; bh=bdnk5d/BSqUvtrl0gv7jCZA40xfbX/8Ld5snzSF8F+4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SAEzgeiqwsI74IE9eHT6vet3UwIWGyyUuGCGX/LFxthsqhy5dvimsZim8zwY1yaG6lFFTjfKS1q1YHd9CXmu+YbLbrAs/kP5pLUl74VRVbsMn35n4HJ6jddfrFWTBXlIzrT+/GeoXeNXCJ4+zuI2krbquWa9TuqkwRZd8+hqLQQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Uij/VCfu; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Uij/VCfu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 875FE1F000E9; Tue, 21 Jul 2026 19:51:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784663483; bh=+T0cnOYANVUrWmHbFZDGm6Sp/4/XksVBGDoViKBpkwc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Uij/VCfu/tM7VVYUqbXTu8IxWTc0oArgIKJiSaNAq4Nbk/i0Th3tCxdZW5Ji/SK8g uy4PrtiltWTxDkzLQAOf2Vp92W2suv7+KEfDe2T5J+R0mfypsV0vLrmlOKwhGV51rf TWOB3yUCGg/7XgPTsMT8hBVdbVPvPkcoNmfPZNig= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Li RongQing , Helge Deller Subject: [PATCH 6.12 0841/1276] fbdev: sm712: Fix operator precedence in big_swap macro Date: Tue, 21 Jul 2026 17:21:24 +0200 Message-ID: <20260721152504.875422950@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152446.065700225@linuxfoundation.org> References: <20260721152446.065700225@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Li RongQing commit 5dbe5b65df0b0c0ec77492427c274b7b5011890e upstream. The big_swap(p) macro was intended to swap bytes within 16-bit halves of a 32-bit value. However, because the bitwise shift operators (<<, >>) have higher precedence than the bitwise AND operator (&), the original code failed to perform any shifting on the masked bits. For example, 'p & 0xff00ff00 >> 8' was evaluated as 'p & (0xff00ff00 >> 8)', effectively neutralizing the intended swap. Fix this by adding parentheses to ensure the bitwise AND is performed before the shift, correctly implementing the byte swap logic. Fixes: 1461d66728648 ("staging: sm7xxfb: merge sm712fb with fbdev") Cc: stable@vger.kernel.org Signed-off-by: Li RongQing Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman --- drivers/video/fbdev/sm712.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/video/fbdev/sm712.h +++ b/drivers/video/fbdev/sm712.h @@ -101,7 +101,7 @@ struct modeinit { #define mmio_addr 0x00800000 #define seqw17() smtc_seqw(0x17, 0x30) #define big_pixel_depth(p, d) {if (p == 24) {p = 32; d = 32; } } -#define big_swap(p) ((p & 0xff00ff00 >> 8) | (p & 0x00ff00ff << 8)) +#define big_swap(p) (((p & 0xff00ff00) >> 8) | ((p & 0x00ff00ff) << 8)) #else #define pal_rgb(r, g, b, val) val #define big_addr 0