media: s5p-jpeg: fix number of components macro
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Tue, 8 Aug 2017 11:27:07 +0000 (07:27 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Sun, 20 Aug 2017 12:02:04 +0000 (08:02 -0400)
The value to be processed must be first masked and then shifted,
not the other way round.

Fixes: 6c96dbbc2aa9f5b4a ("[media] s5p-jpeg: add support for 5433")

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/s5p-jpeg/jpeg-regs.h

index 1870400468b2061e885a28c6b49fbf1688d31cca..df790b10140ca667f0c2dfa443f96658162a3248 100644 (file)
 #define EXYNOS4_NF_SHIFT                       16
 #define EXYNOS4_NF_MASK                                0xff
 #define EXYNOS4_NF(x)                          \
-       (((x) << EXYNOS4_NF_SHIFT) & EXYNOS4_NF_MASK)
+       (((x) & EXYNOS4_NF_MASK) << EXYNOS4_NF_SHIFT)
 
 /* JPEG quantizer table register */
 #define EXYNOS4_QTBL_CONTENT(n)        (0x100 + (n) * 0x40)