All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Bur <cyrilbur@gmail.com>
To: Nan Li <bjlinan@cn.ibm.com>
Cc: Jeremy Kerr <jk@ozlabs.org>, openbmc@lists.ozlabs.org
Subject: Re: [PATCH openpower-host-ipmi-oem v2] Fix endianness issue5
Date: Thu, 26 May 2016 13:37:14 +1000	[thread overview]
Message-ID: <20160526133714.7dcb60cf@camb691> (raw)
In-Reply-To: <57465E9E.2000502@ozlabs.org>

On Thu, 26 May 2016 10:25:34 +0800
Jeremy Kerr <jk@ozlabs.org> wrote:

> Hi Nan,
> 

Hi Nan,

I responded to v1 of your patch. You have sent exactly the same code as v2. 

One of two things has happened:
One you accidentally triggered github to send a v2 (which admittedly is easy to
do), please try to be more careful in future, this creates a lot of pointless
noise on the list and leads to double reviews, Jeremy has made the same point
I previously have.
Two you're ignoring reviews to your patches and sending subsequent versions...
why do you do this?

> You seem to have a minor typo in the commit title there.
> 
> > -	// TODO: Issue 5: This is not endian-safe.
> > -	short *recid  =  (short*) &reqptr->selrecordls;
> > -	short *offset =  (short*) &reqptr->offsetls;
> > +
> > +	unsigned short recid  =  ((unsigned short) reqptr->selrecordms) << 8 + reqptr->selrecordls;
> > +	unsigned short offset =  ((unsigned short) reqptr->offsetms) << 8 + reqptr->offsetls;  
> 
> That won't do the endian conversion correctly. Can you use one of the
> existing endian conversion functions?
> 
> The le16toh() function is probably what you want here, from endian.h.
> 
> Also, be careful of the change from 'short' to 'unsigned short'.
> 
> Regards,
> 
> 
> Jeremy
> _______________________________________________
> openbmc mailing list
> openbmc@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/openbmc

  parent reply	other threads:[~2016-05-26  3:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-26  2:00 [PATCH openpower-host-ipmi-oem v2] Fix endianness issue5 OpenBMC Patches
2016-05-26  2:00 ` OpenBMC Patches
2016-05-26  2:25   ` Jeremy Kerr
2016-05-26  3:17     ` Nan KX Li
2016-05-26  3:37     ` Cyril Bur [this message]
2016-05-26  6:19       ` Nan KX Li

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=20160526133714.7dcb60cf@camb691 \
    --to=cyrilbur@gmail.com \
    --cc=bjlinan@cn.ibm.com \
    --cc=jk@ozlabs.org \
    --cc=openbmc@lists.ozlabs.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.