public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wilson Lee <wilson.lee@ni.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] lib: sha1: Change uint8_t to unsigned char for sha1_der_prefix array.
Date: Thu, 23 Nov 2017 08:29:14 +0000	[thread overview]
Message-ID: <1511425753.3296.13.camel@ni.com> (raw)
In-Reply-To: <CAPnjgZ3vpEeJ3esUN=AvL=Fb-3d-aKHKEg2ex3YzHnnkFX7N8g@mail.gmail.com>

Hi Simon,

On Mon, 2017-11-20 at 08:38 -0700, Simon Glass wrote:
> Hi Wilson,
> 
> On 7 November 2017 at 19:30, Wilson Lee <wilson.lee@ni.com> wrote:
> > 
> > uint8_t used in sha1_der_prefix array was not able to recognize by
> > compiler when try to build the tools using 'HOSTCC'. That is
> > because,
> > uint8_t is undefined when 'HOSTCC' is defined because asm/type.h is
> > not
> > included in that case. Use unsigned char for sha1_der_prefix[]
> > array
> > instead.
> > 
> > This commit is to remove and change the uint8_t to unsigned char
> > for
> > sha1_der_perfix[] array.
> nit: prefix
> 
> This change is OK I suppose. But I'm not sure what compiler you are
> using. This type should be provided in stdint.h - can you take a look
> at why it is not?
> 
> Regards,
> Simon

Kindly correct me if I am wrong. I think the uint8_t was provided in
the "inttypes.h" header file. However, when we using HOSTCC to compile
the code, the "common.h" (which include "inttypes.h") does not included
and cause compilation to fail. The summary version of the code shown
below:

#ifndef USE_HOSTCC
#include <common.h>
#include <linux/string.h>
#else
#include <string.h>
#endif /* USE_HOSTCC */


I think there have 2 solution for this:
    1. Include the "inttypes.h" header file.
    2. Change the uint8_t to unsigned char.

However, I would like to proceed with 2nd option. Because, in existing
sha1 library, variable data type was declare as unsigned char, unsigned
long... and I am thinking convert uint8_t to unsigned char will make
the variable data type more consistent in sha1 library code.


Thanks, Simon.

Best Regards,
Wilson Lee

  reply	other threads:[~2017-11-23  8:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08  2:30 [U-Boot] [PATCH] lib: sha1: Change uint8_t to unsigned char for sha1_der_prefix array Wilson Lee
2017-11-20 15:38 ` Simon Glass
2017-11-23  8:29   ` Wilson Lee [this message]
2017-11-26 11:38     ` Simon Glass

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=1511425753.3296.13.camel@ni.com \
    --to=wilson.lee@ni.com \
    --cc=u-boot@lists.denx.de \
    /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