From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751970AbdCDG3D (ORCPT ); Sat, 4 Mar 2017 01:29:03 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36098 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750731AbdCDG3C (ORCPT ); Sat, 4 Mar 2017 01:29:02 -0500 Date: Sat, 4 Mar 2017 08:28:58 +0200 From: Ernestas Kulik To: Joe Perches , gregkh@linuxfoundation.org Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: ks7010: clean up code Message-ID: <20170304062858.GA2120@gmail.com> References: <20170303205836.32557-1-ernestas.kulik@gmail.com> <1488590630.2179.41.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1488590630.2179.41.camel@perches.com> User-Agent: Mutt/1.8.0 (2017-02-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2017-03-03 at 17:23-0800, Joe Perches wrote: > On Fri, 2017-03-03 at 22:58 +0200, Ernestas Kulik wrote: > > > This fixes type warnings generated by sparse, replaces instances of > > ntohs() with be16_to_cpu() and removes unused fields in structs. > > There's no real need to convert ntohs to be16_to_cpu I noticed a patch that was merged that replaces calls to these with the more “generic” be16_to_cpu(), but I can revert that. This kind of conversion also happened in SeaBIOS, but it’s not exactly the same thing as here. > > diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c > [] > > > > @@ -297,7 +297,8 @@ static int write_to_device(struct ks_wlan_private *priv, unsigned char *buffer, > > hdr = (struct hostif_hdr *)buffer; > > > > DPRINTK(4, "size=%d\n", hdr->size); > > - if (hdr->event < HIF_DATA_REQ || HIF_REQ_MAX < hdr->event) { > > + if (le16_to_cpu(hdr->event) < HIF_DATA_REQ || > > + HIF_REQ_MAX < le16_to_cpu(hdr->event)) { > > > > This isn't mentioned and doesn't match the commit message It is and it does, but the commit message is a bit vague. I’ll try to expand it.