Re: [PATCH] staging: rtl8723bs: Replace `& 0xfff` with `% 4096u`

Andy Shevchenko <[email protected]> Fri, 11 Apr 2025 15:47:40 +0300
Newsgroups dev.linux.lists.outreachy,dev.linux.lists.linux-staging,org.kernel.vger.linux-kernel
Message-ID <CAHp75VehJd4FUXBJSJh35a6KF3Qr2eBG6PiNogZ1m9SzBph0Ow@mail.gmail.com>
On Fri, Apr 11, 2025 at 1:37=E2=80=AFPM Dan Carpenter <dan.carpenter@linaro=
.org> wrote:
> On Thu, Apr 10, 2025 at 08:43:53PM +0300, Andy Shevchenko wrote:
> >
> > > $ make drivers/staging/rtl8723bs/core/rtw_xmit.o
> > > $ cmp rtw_xmit_before.o rtw_xmit_after.o
> >
> > cmp is good but not good enough in general. Here it shows the 1:1
> > binary, but in some cases code can be the same, while binaries are
> > different. To make sure the code is the same use the bloat-o-meter
> > tool instead.
>
> I don't understand what you're saying at all.  cmp shows that the compile=
r
> was automaticall tanslating the "& 0xfff" into "% 04096u" so the resultin=
g
> object files are exactly the same.

There is a possibility that the compiler changes the code to the
equivalent and cmp will break, bloat-o-meter will check at least what
happened to the size of the *code*. object file is not only a code. It
may also contain debug symbols and other stuff which may break cmp,
while the code can be *the same*.

> ./scripts/bloat-o-meter just looks at the sizes so it's less useful in
> this case.



--=20
With Best Regards,
Andy Shevchenko