All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Edmundo Carmona Antoranz <eantoranz@gmail.com>
Cc: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH -next 1/3] staging: vt6655: remove unused variable
Date: Tue, 16 Mar 2021 12:24:40 +0100	[thread overview]
Message-ID: <YFCVeNKuaZ28564M@kroah.com> (raw)
In-Reply-To: <CAOc6etYyX6kxKXAQBK4K7eXJdaB=Y1+RJAwPF8kC6VrhPwvppw@mail.gmail.com>

On Mon, Mar 15, 2021 at 07:46:35PM -0600, Edmundo Carmona Antoranz wrote:
> On Sun, Mar 14, 2021 at 10:01 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > > -                     byData = inb(0x61);                     \
> > > +                     inb(0x61);                              \
> >
> > Are you sure that the compiler does not make the inb() now go away?
> 
> Hey, Greg!
> 
> Take what you are about to read with a BIG grain of salt because I'm
> just learning about the details of what's going on and the tools at my
> disposal.
> 
> On v5.11 with an allyesconfig, by changing the value of
> CB_DELAY_LOOP_WAIT in mac.h to 100 to force the compiler to include
> the `else` path that includes the for with the inb() call, comparing
> the resulting srom.o files before/after the patch:
> 
> Compiling with only the value in mac.h changed:
> 
> $ size drivers/staging/vt6655/srom.o
>   text    data     bss     dec     hex filename
>    959       0       0     959     3bf drivers/staging/vt6655/srom.o
> 
> By removing the variable in the macro:
> 
> $ size drivers/staging/vt6655/srom.o
>   text    data     bss     dec     hex filename
>    959       0       0     959     3bf drivers/staging/vt6655/srom.o
> 
> By also removing the inb() call, in other words, keeping an empty for:
> 
> $ size drivers/staging/vt6655/srom.o
>   text    data     bss     dec     hex filename
>    865       0       0     865     361 drivers/staging/vt6655/srom.
> 
> 
> That being the case, I think that inb is not fading away by removing
> the variable... at least in my environment.
> 
> Just in case, it's not like I _want_ the patch to be accepted. I took
> it as an exercise and if you think that you want to play safe and
> reject it, it's fine. It was still valuable to me because of your
> question about the function going away and me trying to find out.

Ok, I'll leave this as-is because the inb() needs to happen, so saving
the value is normal for stuff like this.

thanks,

greg k-h

  reply	other threads:[~2021-03-16 11:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-14 14:59 [PATCH -next 1/3] staging: vt6655: remove unused variable Edmundo Carmona Antoranz
2021-03-14 14:59 ` [PATCH -next 2/3] staging: vt6655: correct documentation warnings Edmundo Carmona Antoranz
2021-03-14 14:59 ` [PATCH -next 3/3] staging: vt6655: remove duplicate code Edmundo Carmona Antoranz
2021-03-14 16:01 ` [PATCH -next 1/3] staging: vt6655: remove unused variable Greg KH
2021-03-16  1:46   ` Edmundo Carmona Antoranz
2021-03-16 11:24     ` Greg KH [this message]
2021-03-16 11:39   ` Dan Carpenter

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=YFCVeNKuaZ28564M@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=eantoranz@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.