linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Gioh Kim <gi-oh.kim@profitbricks.com>
Cc: sergio.paracuellos@gmail.com, devel@driverdev.osuosl.org,
	gurugio@hanmail.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] staging: wlan-ng: introduce a macro read_u16
Date: Tue, 14 Mar 2017 08:02:50 +0800	[thread overview]
Message-ID: <20170314000250.GA32002@kroah.com> (raw)
In-Reply-To: <1489410866-19639-2-git-send-email-gi-oh.kim@profitbricks.com>

On Mon, Mar 13, 2017 at 02:14:25PM +0100, Gioh Kim wrote:
> read_u16 is wrapper of le16_to_cpu to read u16 variable,
> rather than __le16.
> 
> Signed-off-by: Gioh Kim <gi-oh.kim@profitbricks.com>
> ---
>  drivers/staging/wlan-ng/prism2mgmt.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/staging/wlan-ng/prism2mgmt.h b/drivers/staging/wlan-ng/prism2mgmt.h
> index 88b979f..97ede25 100644
> --- a/drivers/staging/wlan-ng/prism2mgmt.h
> +++ b/drivers/staging/wlan-ng/prism2mgmt.h
> @@ -63,6 +63,9 @@
>  extern int prism2_reset_holdtime;
>  extern int prism2_reset_settletime;
>  
> +#define read_u16(x) ({ u32 __r = (u32)le16_to_cpu((__force __le16)(x)); \
> +			__r; })
> +

Eeek, no, this should not be needed at all, if the code is written
correctly.  Please fix things up to work properly, don't paper over them
with forced casts.

thanks,

greg k-h

  reply	other threads:[~2017-03-14  0:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-13 13:14 [PATCH 0/2] staging: wlan-ng: remove Sparse warnings for reading __le16 Gioh Kim
2017-03-13 13:14 ` [PATCH 1/2] staging: wlan-ng: introduce a macro read_u16 Gioh Kim
2017-03-14  0:02   ` Greg KH [this message]
2017-03-13 13:14 ` [PATCH 2/2] staging: wlan-ng: prism2sta.c: apply read_u16 macro Gioh Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170314000250.GA32002@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=gi-oh.kim@profitbricks.com \
    --cc=gurugio@hanmail.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sergio.paracuellos@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).