All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: simon@mungewell.org
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jiri Kosina <jkosina@suse.cz>,
	Michael Bauer <michael@m-bauer.org>,
	Michal Maly <madcatxster@gmail.com>
Subject: Re: [PATCH 1/2] HID: hid-lg4ff: Use Private Data
Date: Mon, 02 Apr 2012 19:30:42 +0200	[thread overview]
Message-ID: <4F79E242.5090300@suse.cz> (raw)
In-Reply-To: <44acbf3ff0b6aa62eab2831ee6ecea80.squirrel@mungewell.org>

On 04/02/2012 07:01 PM, simon@mungewell.org wrote:
> 
>>> +	struct lg4ff_device_entry *uninitialized_var(entry);
>>> +	struct lg_drv_data *uninitialized_var(drv_data);
>>
>> You don't need uninitialized_var bloat anymroe, right?
> 
> I guess I don't fully understand the 'unitialized_var()' macro, and was
> just following the previous uses in the code.
> 
> Google'ing doesn't really help either. Is there a definitive guide as when
> to use and not?

The simple answer is: never.

It serves the purpose to shut up the compiler when it complains that the
variable might be uninitialized, but the programmer is sure it cannot.
In your case, the compiler should not even complain about that.

Advantage of the macro is that it adds no assembly, but still silents
the compiler.

thanks,
-- 
js
suse labs



  reply	other threads:[~2012-04-02 17:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-31  9:35 [PATCH v4] HID: lg4ff: Remove sysfs iface before deallocating memory Michal Malý
2012-04-02  1:49 ` simon
2012-04-02 14:54   ` [PATCH 1/2] HID: hid-lg4ff: Use Private Data Simon Wood
2012-04-02 14:54     ` [PATCH 2/2] HID: hid-lg4ff: Add support for G27 leds Simon Wood
2012-04-02 16:38       ` Jiri Slaby
2012-04-02 16:32     ` [PATCH 1/2] HID: hid-lg4ff: Use Private Data Jiri Slaby
2012-04-02 17:01       ` simon
2012-04-02 17:30         ` Jiri Slaby [this message]
2012-04-03  2:14         ` Jiri Kosina
2012-04-03  2:13     ` Jiri Kosina
2012-04-03  8:02       ` Michal Malý
2012-04-03  2:12 ` [PATCH v4] HID: lg4ff: Remove sysfs iface before deallocating memory Jiri Kosina

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=4F79E242.5090300@suse.cz \
    --to=jslaby@suse.cz \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=madcatxster@gmail.com \
    --cc=michael@m-bauer.org \
    --cc=simon@mungewell.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.