From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lothar =?UTF-8?B?V2HDn21hbm4=?= Date: Tue, 22 Aug 2017 08:41:58 +0200 Subject: [U-Boot] [PATCH] cmd: blk: Use LBAFD in the common block command In-Reply-To: <1503377621-22024-1-git-send-email-bmeng.cn@gmail.com> References: <1503377621-22024-1-git-send-email-bmeng.cn@gmail.com> Message-ID: <20170822084158.14b5d2fd@karo-electronics.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de Hi, On Mon, 21 Aug 2017 21:53:41 -0700 Bin Meng wrote: > There are already two macros LBAF and LBAFU to aid formatted print > with lbaint_t variables. Now let's add another one LBAFD and use it > in the common block command codes. >=20 > Signed-off-by: Bin Meng > --- >=20 > cmd/blk_common.c | 10 ++++------ > include/blk.h | 1 + > 2 files changed, 5 insertions(+), 6 deletions(-) >=20 > diff --git a/cmd/blk_common.c b/cmd/blk_common.c > index 86c75e7..2626eef 100644 > --- a/cmd/blk_common.c > +++ b/cmd/blk_common.c > @@ -68,9 +68,8 @@ int blk_common_cmd(int argc, char * const argv[], enum = if_type if_type, > ulong cnt =3D simple_strtoul(argv[4], NULL, 16); > ulong n; > =20 > - printf("\n%s read: device %d block # %lld, count %ld ... ", > - if_name, *cur_devnump, (unsigned long long)blk, > - cnt); > + printf("\n%s read: device %d block # "LBAFD", count %ld ... ", > + if_name, *cur_devnump, blk, cnt); > =20 > n =3D blk_read_devnum(if_type, *cur_devnump, blk, cnt, > (ulong *)addr); > @@ -84,9 +83,8 @@ int blk_common_cmd(int argc, char * const argv[], enum = if_type if_type, > ulong cnt =3D simple_strtoul(argv[4], NULL, 16); > ulong n; > =20 > - printf("\n%s write: device %d block # %lld, count %ld ... ", > - if_name, *cur_devnump, (unsigned long long)blk, > - cnt); > + printf("\n%s write: device %d block # "LBAFD", count %ld ... ", > + if_name, *cur_devnump, blk, cnt); > =20 > n =3D blk_write_devnum(if_type, *cur_devnump, blk, cnt, > (ulong *)addr); > Are there devices that have valid negative block numbers? Otherwise using LBAFU would be fine here. Lothar Wa=C3=9Fmann