From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC096C55179 for ; Thu, 5 Nov 2020 15:06:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8073521D81 for ; Thu, 5 Nov 2020 15:06:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730822AbgKEPGI (ORCPT ); Thu, 5 Nov 2020 10:06:08 -0500 Received: from mga03.intel.com ([134.134.136.65]:53579 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730501AbgKEPGH (ORCPT ); Thu, 5 Nov 2020 10:06:07 -0500 IronPort-SDR: pnXp52/wALCp1rz0f1t91QuvuQYFil+VY4RFWhfCs+Ds/SfgjxgW3q82qW9Y7s6j4RX/lG8mpP Y87VLW04Hubg== X-IronPort-AV: E=McAfee;i="6000,8403,9795"; a="169505029" X-IronPort-AV: E=Sophos;i="5.77,453,1596524400"; d="scan'208";a="169505029" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Nov 2020 07:06:06 -0800 IronPort-SDR: iAgcZfHuOCTIT26pyIor40uA+gSy9PsKDBlTIwRxyO6MdG590hAg2FmisUF4pH/jcq+AXjHnO9 L/hnYpz8jtIw== X-IronPort-AV: E=Sophos;i="5.77,453,1596524400"; d="scan'208";a="364367834" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Nov 2020 07:06:04 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1kagqw-00459k-Sm; Thu, 05 Nov 2020 17:07:06 +0200 Date: Thu, 5 Nov 2020 17:07:06 +0200 From: Andy Shevchenko To: Linus Walleij Cc: Jonathan Cameron , linux-iio , Lars-Peter Clausen , Peter Meerwald-Stadler Subject: Re: [PATCH v1] iio: gyro: mpu3050: Use get_unaligned_leXX() Message-ID: <20201105150706.GT4077@smile.fi.intel.com> References: <20201026175340.19570-1-andriy.shevchenko@linux.intel.com> <20201029150444.28f4e18d@archlinux> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Thu, Nov 05, 2020 at 03:23:07PM +0100, Linus Walleij wrote: > On Thu, Oct 29, 2020 at 6:10 PM Andy Shevchenko > wrote: > > On Thu, Oct 29, 2020 at 5:05 PM Jonathan Cameron wrote: > > > > > > On Mon, 26 Oct 2020 19:53:40 +0200 > > > Andy Shevchenko wrote: > > > > > > > This makes the driver code slightly easier to read. > > > > > > > > Cc: Linus Walleij > > > > Signed-off-by: Andy Shevchenko > > > > > > What you have is good, but could we do better? > > > > > > Why not use an __le64 to grab the whole thing, convert it to a local > > > cpu endian u64 then use FIELD_GET or similar to pull out the right bits. > > > Would be fairly self documenting as well which is always nice. > > > > > > Or am I missing something? > > > > My laziness. I shared this as a leftover from a big series of > > converting a lot of drivers to get_unligned_.eXX(). If you consider > > this is not good enough, just don't apply (no hard feelings :-) I will > > drop it from my local branches. > > I would suggest to apply it anyways because the kernel will look > better after than before this patch. > > Possibly Jonathan could just slip in a TODO comment for this? Sorry, I have already dropped, but if you convince Jonathan to apply, I agree on whatever you propose (TODO comment as I see). I think patchwork or lore still keeps a track of this. -- With Best Regards, Andy Shevchenko