[PATCH v5 006/101] net: Move the checksum functions to lib/

Simon Glass sjg at chromium.org
Thu Dec 5 05:28:10 CET 2019


Hi Bin,

On Mon, 25 Nov 2019 at 08:11, Bin Meng <bmeng.cn at gmail.com> wrote:
>
> Hi Simon,
>
> On Mon, Nov 25, 2019 at 12:11 PM Simon Glass <sjg at chromium.org> wrote:
> >
> > These functions are used by code outside the network support, so move them
> > to lib/ to be more accessible.
> >
> > Without this, the functions are only accessible if CONFIG_NET is defined.
>
> I still don't understand this. net/checksum.c is built unconditionally
> and is not controlled by CONFIG_NET.

The net/ subdir is built unconditionally for U-Boot but not for SPL
and TPL. So if we want this function without networking, we must move
it.


>
> > Many boards do not enable that option but still want to do checksums in
> > this format.
> >
> > Fix up a few code-style nits while we are here.
> >
> > Signed-off-by: Simon Glass <sjg at chromium.org>
> > ---
> >
> > Changes in v5: None
> > Changes in v4:
> > - Expand commit message to better explain the need to checksum functions
> >
> > Changes in v3: None
> > Changes in v2: None
> >
> >  lib/Makefile    |  2 +-
> >  lib/net_utils.c | 48 ++++++++++++++++++++++++++++++++++++++++
> >  net/Makefile    |  1 -
> >  net/checksum.c  | 59 -------------------------------------------------
> >  4 files changed, 49 insertions(+), 61 deletions(-)
> >  delete mode 100644 net/checksum.c
> >
>

Regards,
Simon


More information about the U-Boot mailing list