Linux SPARSE checker discussions
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Sparse Mailing-list <linux-sparse@vger.kernel.org>
Subject: Re: [PATCH 4/9] add helpers for pseudo's user-list's size
Date: Mon, 12 Feb 2018 23:28:04 +0100	[thread overview]
Message-ID: <20180212222802.cyr2iwtfjb4pli2o@ltop.local> (raw)
In-Reply-To: <CA+55aFzwX8CKAeDuTwVg3MKa+LHXNaphi+mqoZE+2C7gaG61wg@mail.gmail.com>

On Mon, Feb 12, 2018 at 02:11:34PM -0800, Linus Torvalds wrote:
> On Mon, Feb 12, 2018 at 2:02 PM, Luc Van Oostenryck
> <luc.vanoostenryck@gmail.com> wrote:
> > Also add has_user(), a wrapper around the above that
> > can directly be used on a pseudo.
> 
> You add that wrapper, but then:
> 
> > -       if (ptr_list_size((struct ptr_list *) *list) == 0)
> > +       if (pseudo_user_list_size(*list) == 0)
> 
> you don't actually *use* it. That seems pointless.

Yes, I know it's not ideal.
My intention when I made has_users() was to use it too,
but I also made it to directly take a pseudo as argument
(which is the common case). And then when wanting to use
it I saw that there is pseudo here, only the pseudo_user_list.
So, I had to use the intermediate pseudo_user_list_size()
here instead of has_users().

I may change has_users() to take the user list instead
of the pseudo but my mental model was pseudos. 

-- Luc

  reply	other threads:[~2018-02-12 22:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-12 22:02 [PATCH 0/9] fix usage when killing loads & stores Luc Van Oostenryck
2018-02-12 22:02 ` [PATCH 1/9] add testcases for converted loads Luc Van Oostenryck
2018-02-12 22:02 ` [PATCH 2/9] fix killing of " Luc Van Oostenryck
2018-02-12 22:02 ` [PATCH 3/9] fix usage of deadborn loads Luc Van Oostenryck
2018-02-12 22:02 ` [PATCH 4/9] add helpers for pseudo's user-list's size Luc Van Oostenryck
2018-02-12 22:11   ` Linus Torvalds
2018-02-12 22:28     ` Luc Van Oostenryck [this message]
2018-02-12 23:25       ` Luc Van Oostenryck
2018-02-12 22:02 ` [PATCH 5/9] use has_users() in dead_insn() too Luc Van Oostenryck
2018-02-12 22:02 ` [PATCH 6/9] let kill_instruction() report if changes were made Luc Van Oostenryck
2018-02-12 22:02 ` [PATCH 7/9] kill dead loads Luc Van Oostenryck
2018-02-12 22:02 ` [PATCH 8/9] add testcase for bad killing of dominated stores Luc Van Oostenryck
2018-02-12 22:02 ` [PATCH 9/9] kill dead stores when simplifying symbols Luc Van Oostenryck

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=20180212222802.cyr2iwtfjb4pli2o@ltop.local \
    --to=luc.vanoostenryck@gmail.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox