From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757428AbdJQLuj (ORCPT ); Tue, 17 Oct 2017 07:50:39 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:45877 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755133AbdJQLuh (ORCPT ); Tue, 17 Oct 2017 07:50:37 -0400 X-Google-Smtp-Source: AOwi7QCazSoYTQu+gqKeOEPezLVAXqAS9iBuPjvevCz4L+dXrgD1yQ/Eh57zZsbGGfn4BNu1fwDMEA== Date: Tue, 17 Oct 2017 17:20:29 +0530 From: Himanshu Jha To: Greg KH Cc: bianpan2016@163.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] usb: wusbcore: Use put_unaligned_le32 Message-ID: <20171017115029.GA8652@himanshu-Vostro-3559> References: <1507302487-4004-1-git-send-email-himanshujha199640@gmail.com> <20171017095114.GA19685@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171017095114.GA19685@kroah.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 17, 2017 at 11:51:14AM +0200, Greg KH wrote: > On Fri, Oct 06, 2017 at 08:38:07PM +0530, Himanshu Jha wrote: > > Use put_unaligned_le32 rather than using byte ordering function and > > memcpy which makes code clear. > > Also, add the header file where it is declared. > > > > Done using Coccinelle and semantic patch used is : > > > > @ rule1 @ > > identifier tmp; expression ptr,x; type T; > > @@ > > > > - tmp = cpu_to_le32(x); > > > > <+... when != tmp > > - memcpy(ptr, (T)&tmp, ...); > > + put_unaligned_le32(x,ptr); > > ...+> > > > > @ depends on rule1 @ > > type j; identifier tmp; > > @@ > > > > - j tmp; > > ...when != tmp > > > > Signed-off-by: Himanshu Jha > > --- > > v2: > > * added correct header file. > > > > drivers/usb/wusbcore/security.c | 9 ++++----- > > 1 file changed, 4 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/usb/wusbcore/security.c b/drivers/usb/wusbcore/security.c > > index 170f2c3..256b56f 100644 > > --- a/drivers/usb/wusbcore/security.c > > +++ b/drivers/usb/wusbcore/security.c > > @@ -22,6 +22,7 @@ > > * > > * FIXME: docs > > */ > > +#include > > Ick, really? asm/ ? As the first include? That feels wrong, at the > very least, it needs to be at the end of the include list please. I just sent a v3 patch with the necessary change! Also, would you mind explaining as to why asm/ should not be the first include ? Thanks > thanks, > > greg k-h