From: Hauke Mehrtens <hauke@hauke-m.de>
To: Luca Coelho <luca@coelho.fi>, backports@vger.kernel.org
Cc: Luca Coelho <luciano.coelho@intel.com>
Subject: Re: [PATCH 13/14] backport: convert int led activate op to void when needed
Date: Sun, 23 Sep 2018 14:30:30 +0200 [thread overview]
Message-ID: <1aadb207-75fa-83e6-d838-2ac878b1c7c8@hauke-m.de> (raw)
In-Reply-To: <20180920112842.27198-14-luca@coelho.fi>
[-- Attachment #1.1: Type: text/plain, Size: 1431 bytes --]
On 09/20/2018 01:28 PM, Luca Coelho wrote:
> From: Luca Coelho <luciano.coelho@intel.com>
>
> In kernel v4.19-rc1, the activate op in struct led_trigger, changed
> from void to int. To solve this, add a semantic patch to insert a
> wrapper function that returns void and calls the function that returns
> int.
>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> ---
> patches/led_activate.cocci | 24 ++++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
> create mode 100644 patches/led_activate.cocci
>
> diff --git a/patches/led_activate.cocci b/patches/led_activate.cocci
> new file mode 100644
> index 000000000000..df8211d29462
> --- /dev/null
> +++ b/patches/led_activate.cocci
> @@ -0,0 +1,24 @@
> +@act@
> +identifier activate_fn, p;
> +identifier m =~ "rx_led|tx_led|assoc_led|radio_led|tpt_led";
> +fresh identifier activate_fn_wrap = "bp_" ## activate_fn;
> +@@
> +<...
> ++#if LINUX_VERSION_IS_GEQ(4,19,0)
> +p->m.activate = activate_fn;
> ++#else
> ++p->m.activate = activate_fn_wrap;
> ++#endif
> +...>
Please use <+--- ---+> here it improves the speed by some magnitudes.
> +
> +@@
> +identifier act.activate_fn;
> +identifier act.activate_fn_wrap;
> +@@
> +int activate_fn(...) {...}
> ++#if LINUX_VERSION_IS_LESS(4,19,0)
> ++static void activate_fn_wrap(struct led_classdev *led_cdev)
> ++{
> ++ activate_fn(led_cdev);
> ++}
> ++#endif
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2018-09-23 18:27 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-20 11:28 [PATCH 00/14] backport: updates for 4.19 Luca Coelho
2018-09-20 11:28 ` [PATCH 01/14] backport: fix compilation with IPV6 not set Luca Coelho
2018-09-20 11:28 ` [PATCH 02/14] backports: add wait_event_killable_timeout backport support Luca Coelho
2018-09-20 11:28 ` [PATCH 03/14] backport: introduce match_string() for kernels < 4.6 Luca Coelho
2018-09-20 11:28 ` [PATCH 04/14] backport: add patch to ignore iwlwifi removal on < 3.14 kernels Luca Coelho
2018-09-20 11:28 ` [PATCH 05/14] backport: convert tree section names to ascii Luca Coelho
2018-09-20 11:28 ` [PATCH 06/14] backport: add rhashtable-types.h Luca Coelho
2018-09-20 11:28 ` [PATCH 07/14] backport: remove duplicate leds.h inclusion from backport-4.5.c Luca Coelho
2018-09-20 11:28 ` [PATCH 08/14] backport: prevent unused subclass variable warning in < 3.18 Luca Coelho
2018-09-20 11:28 ` [PATCH 09/14] backport: make ktime_get_boottime_seconds() non-inline Luca Coelho
2018-09-20 11:28 ` [PATCH 10/14] backport: update u64_stats_init() to a new version in kernels < 4.2 Luca Coelho
2018-09-20 11:28 ` [PATCH 11/14] backports: improve skb->xmit_more handling Luca Coelho
2018-09-20 11:28 ` [PATCH 12/14] backport: update lib-rhashtable.c Luca Coelho
2018-09-20 16:23 ` Luciano Coelho
2018-09-20 11:28 ` [PATCH 13/14] backport: convert int led activate op to void when needed Luca Coelho
2018-09-23 12:30 ` Hauke Mehrtens [this message]
2018-09-24 9:24 ` Luca Coelho
2018-09-20 11:28 ` [PATCH 14/14] backports: add __alloc_bucket_spinlocks() for < 4.19 Luca Coelho
2018-09-23 14:14 ` [PATCH 00/14] backport: updates for 4.19 Hauke Mehrtens
2018-09-24 9:26 ` Luca Coelho
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=1aadb207-75fa-83e6-d838-2ac878b1c7c8@hauke-m.de \
--to=hauke@hauke-m.de \
--cc=backports@vger.kernel.org \
--cc=luca@coelho.fi \
--cc=luciano.coelho@intel.com \
/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).