public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: ospite@studenti.unina.it
Cc: Richard Purdie <rpurdie@rpsys.net>,
	open list <linux-kernel@vger.kernel.org>
Subject: [sparse stuff] bug in lp3944_led_set_brightness()
Date: Wed, 5 Oct 2011 12:32:48 +0300	[thread overview]
Message-ID: <20111005093248.GA6792@mwanda> (raw)

Hi Antonio,

I was going through some Sparse warnings and this one seems pretty
valid.

drivers/leds/leds-lp3944.c +292 23:
	warning: mixing different enum types

   284  static void lp3944_led_set_brightness(struct led_classdev *led_cdev,
   285                                        enum led_brightness brightness)
   286  {
   287          struct lp3944_led_data *led = ldev_to_led(led_cdev);
   288  
   289          dev_dbg(&led->client->dev, "%s: %s, %d\n",
   290                  __func__, led_cdev->name, brightness);
   291  
   292          led->status = brightness;
                ^^^^^^^^^^^^^^^^^^^^^^^^
   293          schedule_work(&led->work);
   294  }

led->status should be values between 0-3.  brightness is 0, 127 and
255.

regards,
dan carpenter

             reply	other threads:[~2011-10-05  9:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-05  9:32 Dan Carpenter [this message]
2011-10-05 20:21 ` [sparse stuff] bug in lp3944_led_set_brightness() Antonio Ospite
2011-10-06 21:34   ` [PATCH] leds: leds-lp3944, fix "sparse" warning "mixing different enum types" Antonio Ospite
2011-11-16 15:00     ` Antonio Ospite
2011-11-16 18:43       ` 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=20111005093248.GA6792@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ospite@studenti.unina.it \
    --cc=rpurdie@rpsys.net \
    /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