> On 09 Jul 2015, at 09:16, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> On Thu, Jul 9, 2015 at 4:07 AM, Andrew Morton <akpm@linux-foundation.org> wrote:
>>> The other alternative in Documentation/unaligned-memory-access.txt is the
>>> macro get_unaligned() from asm/unaligned.h. However, using get_unaligned()
>>> would mean a much more intrusive patch, since each case of the groupsize
>>> would be changed, and anyway we would still need to check
>>> CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS to avoid penalising everyone.
>>
>> Actually, I think using get_unaligned() would be a better solution.
>> For architectures which have CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y,
>> get_unaligned() should be fast - just one instruction.
D’oh! You’re right, of course.
>>
>> This way we avoid having different-appearing output on different
>> architectures.
>
> Definitely.
>
> A less optimal get_unaligned() will just be noise in the snprintf() processing
> time.
>
OK, so thanks Andrew and Geert for your comments. I’ll reimplement using get_unaligned.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
>
> On Thu, Jul 9, 2015 at 4:07 AM, Andrew Morton <akpm@linux-foundation.org> wrote:
>>> The other alternative in Documentation/unaligned-memory-access.txt is the
>>> macro get_unaligned() from asm/unaligned.h. However, using get_unaligned()
>>> would mean a much more intrusive patch, since each case of the groupsize
>>> would be changed, and anyway we would still need to check
>>> CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS to avoid penalising everyone.
>>
>> Actually, I think using get_unaligned() would be a better solution.
>> For architectures which have CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y,
>> get_unaligned() should be fast - just one instruction.
D’oh! You’re right, of course.
>>
>> This way we avoid having different-appearing output on different
>> architectures.
>
> Definitely.
>
> A less optimal get_unaligned() will just be noise in the snprintf() processing
> time.
>
OK, so thanks Andrew and Geert for your comments. I’ll reimplement using get_unaligned.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/