secure-kernel: Add support for 5.15 kernel

Add following changes.

Fix switch case
  latest compiler throwing error where CASE statement does
  not have break or return under all the execution paths.

Rename size_add to size_add_
  There is a name collision between this one and one coming from
  overflow.h. Hence renaming it.

Modify IRQ handling for qce50 module

Change PDE_DATA to pde_data

Signed-off-by: Smita Ghosh <quic_smitag@quicinc.com>

Change-Id: I4226fb41df12273b45d2e114f1aad2709dc36eb7
Signed-off-by: Smita Ghosh <quic_smitag@quicinc.com>
Šī revīzija ir iekļauta:
Smita Ghosh
2022-10-05 20:40:18 -07:00
revīziju iesūtīja Gerrit - the friendly Code Review server
vecāks 8a7364d25d
revīzija 0f28e48cbc
6 mainīti faili ar 21 papildinājumiem un 14 dzēšanām

Parādīt failu

@@ -882,14 +882,13 @@ static struct smcinvoke_cb_txn *find_cbtxn_locked(
}
/*
* size_add saturates at SIZE_MAX. If integer overflow is detected,
* size_add_ saturates at SIZE_MAX. If integer overflow is detected,
* this function would return SIZE_MAX otherwise normal a+b is returned.
*/
static inline size_t size_add(size_t a, size_t b)
static inline size_t size_add_(size_t a, size_t b)
{
return (b > (SIZE_MAX - a)) ? SIZE_MAX : a + b;
}
/*
* pad_size is used along with size_align to define a buffer overflow
* protected version of ALIGN
@@ -905,7 +904,7 @@ static inline size_t pad_size(size_t a, size_t b)
*/
static inline size_t size_align(size_t a, size_t b)
{
return size_add(a, pad_size(a, b));
return size_add_(a, pad_size(a, b));
}
static uint16_t get_server_id(int cb_server_fd)
@@ -1729,7 +1728,7 @@ static size_t compute_in_msg_size(const struct smcinvoke_cmd_req *req,
/* each buffer has to be 8 bytes aligned */
while (i < OBJECT_COUNTS_NUM_buffers(req->counts))
total_size = size_add(total_size,
total_size = size_add_(total_size,
size_align(args_buf[i++].b.size,
SMCINVOKE_ARGS_ALIGN_SIZE));
@@ -2802,3 +2801,4 @@ module_exit(smcinvoke_exit);
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("SMC Invoke driver");
MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
MODULE_IMPORT_NS(DMA_BUF);