From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Date: Fri, 25 May 2012 09:24:24 +0000 Subject: Re: [PATCH v2] spapr: Add "memop" hypercall Message-Id: <1337937864.16119.20.camel@pasglop> List-Id: References: <1337585042.2779.4.camel@pasglop> <4FBA0F23.5040601@redhat.com> <1337594641.2779.59.camel@pasglop> <4FBA13DF.7040009@redhat.com> <1337918007.16119.13.camel@pasglop> <678ADF6E-BA35-48A4-865A-C45D1353022B@suse.de> <1337934969.16119.18.camel@pasglop> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Alexander Graf Cc: "kvm@vger.kernel.org" , kvm-ppc , Avi Kivity , "qemu-devel@nongnu.org" On Fri, 2012-05-25 at 10:54 +0200, Alexander Graf wrote: > >> case x: > >> foo(); > >> break(); > >> > >>> break; > >>> + case 1: tmp = lduw_phys(src); break; > >>> + case 2: tmp = ldl_phys(src); break; > >>> + case 3: tmp = ldq_phys(src); break; > >>> + default: > >>> + return H_PARAMETER; > > > > Checkpatch absolutely complained and I decided to ignore it, seriously, > > you really want to replace a nice & readable piece of code with > > something that takes 3 pages and is generally gross & ugly ? > > > > Some times, you have to ignore check patch and let sanity prevail. > > I'm not all that keen on coding style rules. But check out > arch/powerpc/kvm/emulate.c and tell me that it's a good idea to go > with this "clean" approach. If you want it really clean, put the whole > chunk above into a geberic helper that allows for everyone to say > "read n bytes of data with native endianness into a u64". In that > code, the more verbose coding style checkpatch suggests doesn't hurt > and your function becomes even easier to read :) I find your lack of taste disturbing Luke :-) > Yeah, it's a shame I didn't read through it more thoroughly earlier - at least it didn't take weeks in this round ;). > > No worries though, if you can't make it until Monday, I'll fix it up myself afterwards :). There's no black magic involved here, > so I should be ok to respin myself. Sure. No worries. To test it properly you really need a newer SLOF and the patch to add -vga tho, I'll sort that out when I'm back. Cheers, Ben. > Alex