mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Johan Hovold <johan@kernel.org>
Cc: Julia Lawall <julia.lawall@lip6.fr>,
	Michal Marek <mmarek@suse.com>,
	Gilles Muller <Gilles.Muller@lip6.fr>,
	Nicolas Palix <nicolas.palix@imag.fr>,
	linux-kernel@vger.kernel.org, cocci@systeme.lip6.fr
Subject: Re: [PATCH] coccinelle: misc: remove "complex return code" warnings
Date: Fri, 2 Oct 2015 23:33:46 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.02.1510022328560.2163@localhost6.localdomain6> (raw)
In-Reply-To: <20151001174718.GJ4284@localhost>

Do you consider that this function would be better off in two lines?

static int mxt_acquire_irq(struct mxt_data *data)
{
        int error;

        enable_irq(data->irq);

        error = mxt_process_messages_until_invalid(data);
        if (error)
                return error;

        return 0;
}

Would simplifying the code at the end of the following function be helpful
or not?

static int adnp_gpio_setup(struct adnp *adnp, unsigned int num_gpios)
{
        struct gpio_chip *chip = &adnp->gpio;
        int err;

        adnp->reg_shift = get_count_order(num_gpios) - 3;

        chip->direction_input = adnp_gpio_direction_input;
        chip->direction_output = adnp_gpio_direction_output;
        chip->get = adnp_gpio_get;
        chip->set = adnp_gpio_set;
        chip->can_sleep = true;

        if (IS_ENABLED(CONFIG_DEBUG_FS))
                chip->dbg_show = adnp_gpio_dbg_show;

        chip->base = -1;
        chip->ngpio = num_gpios;
        chip->label = adnp->client->name;
        chip->dev = &adnp->client->dev;
        chip->of_node = chip->dev->of_node;
        chip->owner = THIS_MODULE;

        err = gpiochip_add(chip);
        if (err)
                return err;

        return 0;
}

thanks,
julia

  reply	other threads:[~2015-10-02 21:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-30 22:37 Johan Hovold
2015-10-01  5:20 ` Julia Lawall
2015-10-01 17:47   ` Johan Hovold
2015-10-02 21:33     ` Julia Lawall [this message]
2015-10-04 10:50       ` Johan Hovold
2015-10-03 16:24     ` Julia Lawall
2015-10-04 10:52       ` Johan Hovold
2015-10-03 16:25 ` Julia Lawall
2015-10-28  9:54   ` Johan Hovold
2015-10-28 10:04     ` Michal Marek
2015-10-28 10:09       ` Johan Hovold

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=alpine.DEB.2.02.1510022328560.2163@localhost6.localdomain6 \
    --to=julia.lawall@lip6.fr \
    --cc=Gilles.Muller@lip6.fr \
    --cc=cocci@systeme.lip6.fr \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.com \
    --cc=nicolas.palix@imag.fr \
    /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

all inboxes | Powered by JetHome®