From cb2d1d68c30c525a5eedfe9f67a2a3843c71bc67 Mon Sep 17 00:00:00 2001 From: Zhen Kong Date: Fri, 5 Feb 2016 17:46:40 -0800 Subject: [PATCH] qseecom: fix macro QSEECOM_ALIGN definition issue In macro QSEECOM_ALIGN, change (x + QSEECOM_ALIGN_SIZE) to (x + QSEECOM_ALIGN_MASK); otherwise, when x is already aligned, QSEECOM_ALIGN(x) will get (x + QSEECOM_ALIGN_SIZE), but it should be x. Also, remove the dulplicate QSEECOM_ALIGN definition in hdcp.c and mpq_sdmx.c, since they already include "qseecom_kernel.h" Change-Id: I9dbcadb618372fce71c2ff7ab62ca691afe7c7fa Signed-off-by: Zhen Kong --- drivers/misc/hdcp.c | 5 ----- drivers/misc/qseecom_kernel.h | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/misc/hdcp.c b/drivers/misc/hdcp.c index 460ffc79f566..33ec0c15efa6 100644 --- a/drivers/misc/hdcp.c +++ b/drivers/misc/hdcp.c @@ -97,11 +97,6 @@ */ #define SLEEP_SET_HW_KEY_MS 220 -#define QSEECOM_ALIGN_SIZE 0x40 -#define QSEECOM_ALIGN_MASK (QSEECOM_ALIGN_SIZE - 1) -#define QSEECOM_ALIGN(x)\ - ((x + QSEECOM_ALIGN_SIZE) & (~QSEECOM_ALIGN_MASK)) - /* hdcp command status */ #define HDCP_SUCCESS 0 diff --git a/drivers/misc/qseecom_kernel.h b/drivers/misc/qseecom_kernel.h index 8f981903c3a1..40426b749f60 100644 --- a/drivers/misc/qseecom_kernel.h +++ b/drivers/misc/qseecom_kernel.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2013, 2016 The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2013, 2016-2017 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -19,7 +19,7 @@ #define QSEECOM_ALIGN_SIZE 0x40 #define QSEECOM_ALIGN_MASK (QSEECOM_ALIGN_SIZE - 1) #define QSEECOM_ALIGN(x) \ - ((x + QSEECOM_ALIGN_SIZE) & (~QSEECOM_ALIGN_MASK)) + ((x + QSEECOM_ALIGN_MASK) & (~QSEECOM_ALIGN_MASK)) /* * struct qseecom_handle - -- 2.11.0