From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754995AbdGCQiG (ORCPT ); Mon, 3 Jul 2017 12:38:06 -0400 Received: from mail-qk0-f181.google.com ([209.85.220.181]:33729 "EHLO mail-qk0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754952AbdGCQiB (ORCPT ); Mon, 3 Jul 2017 12:38:01 -0400 MIME-Version: 1.0 In-Reply-To: <20170703133602.ejcdu35ku3i63cj2@earth> References: <1498937290-12285-1-git-send-email-Julia.Lawall@lip6.fr> <20170703133602.ejcdu35ku3i63cj2@earth> From: Andy Shevchenko Date: Mon, 3 Jul 2017 19:37:59 +0300 Message-ID: Subject: Re: [PATCH] coccinelle: api: detect unnecessary le16_to_cpu To: Sebastian Reichel Cc: Julia Lawall , kernel-janitors@vger.kernel.org, Gilles Muller , Nicolas Palix , Michal Marek , cocci@systeme.lip6.fr, "linux-kernel@vger.kernel.org" , Benjamin Tissoires , Bastien Nocera , Stephen Just , "Rafael J . Wysocki" , Len Brown , Robert Moore , Lv Zheng , Mika Westerberg , "linux-acpi@vger.kernel.org" , devel@acpica.org, "linux-pm@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 3, 2017 at 4:36 PM, Sebastian Reichel wrote: > On Sat, Jul 01, 2017 at 09:28:10PM +0200, Julia Lawall wrote: > * drivers/gpio/gpio-pca953x.c (line 190-192) It has double conversion there: 1. LE CPU: Read as LE and converted to LE (no-op), so, just u16 2. BE CPU: Read as BE and converted to LE, makes it __le16 Looks like the conversion is not needed, only get_unaligned() is necessary. P.S. What about lines 244-245 there? I think they are no-op. Interesting that those two parts were added in quite different commits. -- With Best Regards, Andy Shevchenko