smem.c (eba757022fc2935c8a1392278a26d86761a70c60) smem.c (eb68cf09092233716b31fad42cf2a4dad3959e3c)
1/*
2 * Copyright (c) 2015, Sony Mobile Communications AB.
3 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 and
7 * only version 2 as published by the Free Software Foundation.
8 *

--- 802 unchanged lines hidden (view full) ---

811 entry = &ptable->entry[i];
812 if (!le32_to_cpu(entry->offset))
813 continue;
814 if (!le32_to_cpu(entry->size))
815 continue;
816
817 host0 = le16_to_cpu(entry->host0);
818 host1 = le16_to_cpu(entry->host1);
1/*
2 * Copyright (c) 2015, Sony Mobile Communications AB.
3 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 and
7 * only version 2 as published by the Free Software Foundation.
8 *

--- 802 unchanged lines hidden (view full) ---

811 entry = &ptable->entry[i];
812 if (!le32_to_cpu(entry->offset))
813 continue;
814 if (!le32_to_cpu(entry->size))
815 continue;
816
817 host0 = le16_to_cpu(entry->host0);
818 host1 = le16_to_cpu(entry->host1);
819 if (host0 != local_host && host1 != local_host)
820 continue;
821
822 if (host0 == local_host)
823 remote_host = host1;
819 if (host0 == local_host)
820 remote_host = host1;
824 else
821 else if (host1 == local_host)
825 remote_host = host0;
822 remote_host = host0;
823 else
824 continue;
826
827 if (remote_host >= SMEM_HOST_COUNT) {
828 dev_err(smem->dev,
829 "Invalid remote host %d\n",
830 remote_host);
831 return -EINVAL;
832 }
833

--- 190 unchanged lines hidden ---
825
826 if (remote_host >= SMEM_HOST_COUNT) {
827 dev_err(smem->dev,
828 "Invalid remote host %d\n",
829 remote_host);
830 return -EINVAL;
831 }
832

--- 190 unchanged lines hidden ---