linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "Michał Kępień" <kernel@kempniu.pl>,
	linux-input <linux-input@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] Input: sparse-keymap - use a managed allocation for keymap copy
Date: Tue, 7 Mar 2017 10:06:51 -0800	[thread overview]
Message-ID: <20170307180651.GE13740@dtor-ws> (raw)
In-Reply-To: <CAHp75Veewvym2gVXhUSktOxb6=MLMwXXnSoTDEaMhtSa_zL2Kg@mail.gmail.com>

On Sat, Mar 04, 2017 at 07:58:51PM +0200, Andy Shevchenko wrote:
> On Thu, Mar 2, 2017 at 2:02 PM, Michał Kępień <kernel@kempniu.pl> wrote:
> > Some platform drivers use devm_input_allocate_device() together with
> > sparse_keymap_setup() in their .probe callbacks.  While using the former
> > simplifies error handling, using the latter necessitates calling
> > sparse_keymap_free() in the error path and upon module unloading to
> > avoid leaking the copy of the keymap allocated by sparse_keymap_setup().
> >
> > To help prevent such leaks and enable simpler error handling, make
> > sparse_keymap_setup() use devm_kcalloc() to allocate memory for the
> > keymap copy so that it gets automatically freed.
> 
> > + * Since sparse_keymap_setup() now uses a managed allocation for the
> > + * keymap copy, use of this function is deprecated.
> 
> So...
> 
> >   */
> >  void sparse_keymap_free(struct input_dev *dev)
> 
> ... add __deprecated then?

__deprectaed annoys innocent bystanders who just want to compile their
kernels; we can simply make sure we will not add new users and clean up
old ones in the next release or 2.

Thanks.

-- 
Dmitry

  parent reply	other threads:[~2017-03-07 18:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-02 12:02 [PATCH v2] Input: sparse-keymap - use a managed allocation for keymap copy Michał Kępień
2017-03-04 17:58 ` Andy Shevchenko
2017-03-06  7:09   ` Michał Kępień
2017-03-06  7:39     ` Andy Shevchenko
2017-03-07  8:15       ` Michał Kępień
2017-03-07 18:06   ` Dmitry Torokhov [this message]
2017-03-07 18:05 ` Dmitry Torokhov

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=20170307180651.GE13740@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=kernel@kempniu.pl \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).