All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: Christopher Li <sparse@chrisli.org>
Cc: Linux-Sparse <linux-sparse@vger.kernel.org>
Subject: Re: [PATCH] cleanup: remove evaluate_arguments()'s unused argument
Date: Thu, 17 Nov 2016 12:13:37 +0100	[thread overview]
Message-ID: <20161117111336.GA499@macpro.local> (raw)
In-Reply-To: <CANeU7Q=SJXw41JNRLJtKGOCgEPSnWhKZyRfMicS=suJwH73LNg@mail.gmail.com>

On Thu, Nov 17, 2016 at 05:57:52PM +0800, Christopher Li wrote:
> On Thu, Nov 3, 2016 at 1:16 AM, Luc Van Oostenryck
> <luc.vanoostenryck@gmail.com> wrote:
> > Was slightly confusing when reading some code.
> > Better to remove it.
> >
> > @@ -2885,7 +2885,7 @@ static struct symbol *evaluate_call(struct expression *expr)
> >                 if (!sym->op->args(expr))
> >                         return NULL;
> >         } else {
> > -               if (!evaluate_arguments(sym, ctype, arglist))
> > +               if (!evaluate_arguments(ctype, arglist))
> >                         return NULL;
> 
> I think this is more or less fine, even though sym is not currently
> used in evaluate_arguments().
> ctype contain the function declare which usually is in a line earlier
> than the call expression.
> The "sym" argument in the most common case contain the symbol node,
> the ctype contain
> the base function type.
> 
> One case might be useful for "exvaluate_arguments" to use symbol node
> is to output
> the beginning position of the call expression. The "fn" symbol point
> to the previous line
> and arglist in the later part of the expression.
> 
> As I said, the node argument is currently not used. If you feel
> strongly about it
> I am fine with removing it as well.

Not much important to me, but said above, it's confusing: two args,
one called 'f', the other one 'fn' and one of them is unused ...

> Or maybe change it to "node" instead of "f", will that be better to understand?
Not much I think, 'node' has even less meaning to me than 'f'or 'fn'.
Better then to focus on the (potential) purpose of this arg.
If it's for the position, maybe pass only sym->pos.

But again, it's not important at all. Let not waste our time on it.

Luc

  reply	other threads:[~2016-11-17 11:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-02 17:16 [PATCH] cleanup: remove evaluate_arguments()'s unused argument Luc Van Oostenryck
2016-11-17  9:57 ` Christopher Li
2016-11-17 11:13   ` Luc Van Oostenryck [this message]
2016-11-17 16:27     ` Christopher Li

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=20161117111336.GA499@macpro.local \
    --to=luc.vanoostenryck@gmail.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=sparse@chrisli.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.