From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753303AbbGITIR (ORCPT ); Thu, 9 Jul 2015 15:08:17 -0400 Received: from mail-la0-f54.google.com ([209.85.215.54]:34112 "EHLO mail-la0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752139AbbGITIJ convert rfc822-to-8bit (ORCPT ); Thu, 9 Jul 2015 15:08:09 -0400 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Subject: Re: [RESEND 2][PATCH v4] hexdump: fix for non-aligned buffers From: "H. Mijail" In-Reply-To: Date: Thu, 9 Jul 2015 21:08:04 +0200 Cc: Andrew Morton , Andy Shevchenko , David Howells , Vivek Goyal , "linux-kernel@vger.kernel.org" , Jiri Kosina , Joe Perches Content-Transfer-Encoding: 8BIT Message-Id: <02992F9C-657D-4ED9-B47E-379C477A44DA@gmail.com> References: <20150708234418.GA9541@mija-VirtualBox> <20150708170341.322f6eb3fcbad5ec3c77f10e@linux-foundation.org> <256A84C1-DB36-454A-8730-ED7C5C6217F8@gmail.com> <20150708190700.45d6b577.akpm@linux-foundation.org> To: Geert Uytterhoeven X-Mailer: Apple Mail (2.2102) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On 09 Jul 2015, at 09:16, Geert Uytterhoeven wrote: > > On Thu, Jul 9, 2015 at 4:07 AM, Andrew Morton 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.