[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YL8+NOdz+ue3MTGg@kroah.com>
Date: Tue, 8 Jun 2021 11:53:56 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Jiří Prchal <jiri.prchal@...ignal.cz>
Cc: devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
Rob Herring <robh+dt@...nel.org>,
Christian Eggers <ceggers@...i.de>,
Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH v7 4/5] nvmem: eeprom: at25: export FRAM serial num
On Tue, Jun 08, 2021 at 11:45:56AM +0200, Jiří Prchal wrote:
>
>
> On 08. 06. 21 11:03, Greg Kroah-Hartman wrote:
> > On Mon, Jun 07, 2021 at 04:47:44PM +0200, Jiří Prchal wrote:
> > >
> > >
> > > On 07. 06. 21 14:36, Greg Kroah-Hartman wrote:
> > > > On Mon, Jun 07, 2021 at 02:26:39PM +0200, Jiri Prchal wrote:
> > > > > + return sysfs_emit(buf, "%016llx\n", *(unsigned long long *)at25->sernum);
> > > >
> > > > That's a horrid hack, why not use the %*phN modifier?
> > >
> > > Prints as little endian, is that OK?
> >
> > You tell me! What tool is going to be reading this? What do they
> > expect it to look like?
>
> sh, php in my usecase as unique id.
I am sorry, I do not understand.
> So endianess does not matter to me too much. The question is what is usual
> (like mac address, uuid...?).
What does the device export? Why not just export it as:
0123456789ABCDEF
if it is 8 bytes long?
> > And it's a byte array, why would there be endian issues?
>
> Now is printed as one big number. Not real issue. Just human readability?
> Should I turn back it to space separated bytes?
It's up to you, what do you want to do with it and what does a tool want
it to look like?
thanks,
greg k-h
Powered by blists - more mailing lists