diff mbox

[v2,3/3] ath10k: make target endianess more explicit

Message ID 878umaxujj.fsf@kamboji.qca.qualcomm.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Kalle Valo Aug. 27, 2014, 7:26 a.m. UTC
Michal Kazior <michal.kazior@tieto.com> writes:

> Some copy engine structures are target specific
> and are uploaded to the device during
> init/configuration.
>
> This also cleans up a bit diag_mem_read/write
> implicit byteswap mess leaving only
> diag_access_read/write with an implicit endianess
> byteswap.
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>

[...]

>  static int ath10k_pci_diag_read32(struct ath10k *ar, u32 address, u32 *value)
>  {
> -	return ath10k_pci_diag_read_mem(ar, address, value, sizeof(u32));
> +	__le32 val = 0;
> +	int ret;
> +
> +	ret = ath10k_pci_diag_read_mem(ar, address, &val, sizeof(__le32));
> +	*value = __le32_to_cpu(val);
> +
> +	return ret;
>  }

For consistency, I folded a patch below. Is that ok?


https://github.com/kvalo/ath/commit/1850a415873cb34a6f84b699dfb9a283df3252ec

Comments

Michal Kazior Aug. 27, 2014, 8:15 a.m. UTC | #1
On 27 August 2014 09:26, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> Michal Kazior <michal.kazior@tieto.com> writes:
>
>> Some copy engine structures are target specific
>> and are uploaded to the device during
>> init/configuration.
>>
>> This also cleans up a bit diag_mem_read/write
>> implicit byteswap mess leaving only
>> diag_access_read/write with an implicit endianess
>> byteswap.
>>
>> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
>
> [...]
>
>>  static int ath10k_pci_diag_read32(struct ath10k *ar, u32 address, u32 *value)
>>  {
>> -     return ath10k_pci_diag_read_mem(ar, address, value, sizeof(u32));
>> +     __le32 val = 0;
>> +     int ret;
>> +
>> +     ret = ath10k_pci_diag_read_mem(ar, address, &val, sizeof(__le32));
>> +     *value = __le32_to_cpu(val);
>> +
>> +     return ret;
>>  }
>
> For consistency, I folded a patch below. Is that ok?
>
> --- a/drivers/net/wireless/ath/ath10k/pci.c
> +++ b/drivers/net/wireless/ath/ath10k/pci.c
> @@ -620,7 +620,7 @@ static int ath10k_pci_diag_read32(struct ath10k *ar, u32 address, u32 *value)
>         __le32 val = 0;
>         int ret;
>
> -       ret = ath10k_pci_diag_read_mem(ar, address, &val, sizeof(__le32));
> +       ret = ath10k_pci_diag_read_mem(ar, address, &val, sizeof(val));
>         *value = __le32_to_cpu(val);
>
>         return ret;
>
> https://github.com/kvalo/ath/commit/1850a415873cb34a6f84b699dfb9a283df3252ec

I'm okay with that, thanks.


Micha?
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -620,7 +620,7 @@  static int ath10k_pci_diag_read32(struct ath10k *ar, u32 address, u32 *value)
        __le32 val = 0;
        int ret;
 
-       ret = ath10k_pci_diag_read_mem(ar, address, &val, sizeof(__le32));
+       ret = ath10k_pci_diag_read_mem(ar, address, &val, sizeof(val));
        *value = __le32_to_cpu(val);
 
        return ret;