lkml.org 
[lkml]   [2018]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.4 094/193] staging: ste_rmi4: avoid unused function warnings
    Date
    4.4-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Arnd Bergmann <arnd@arndb.de>

    commit 9045a4a7e686a6316129d6d0b21b4fe2520968e4 upstream.

    The rmi4 touchscreen driver encloses the power-management
    functions in #ifdef CONFIG_PM, but the smtcfb_pci_suspend/resume
    functions are only really used when CONFIG_PM_SLEEP is also
    set, as a frequent gcc warning shows:

    ste_rmi4/synaptics_i2c_rmi4.c:1050:12: warning: 'synaptics_rmi4_suspend' defined but not used
    ste_rmi4/synaptics_i2c_rmi4.c:1084:12: warning: 'synaptics_rmi4_resume' defined but not used

    This changes the driver to remove the #ifdef and instead mark
    the functions as __maybe_unused, which is a nicer anyway, as it
    provides build testing for all the code in all configurations
    and is harder to get wrong.

    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Acked-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c | 7 ++-----
    1 file changed, 2 insertions(+), 5 deletions(-)

    --- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
    +++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
    @@ -1039,7 +1039,6 @@ static int synaptics_rmi4_remove(struct
    return 0;
    }

    -#ifdef CONFIG_PM
    /**
    * synaptics_rmi4_suspend() - suspend the touch screen controller
    * @dev: pointer to device structure
    @@ -1047,7 +1046,7 @@ static int synaptics_rmi4_remove(struct
    * This function is used to suspend the
    * touch panel controller and returns integer
    */
    -static int synaptics_rmi4_suspend(struct device *dev)
    +static int __maybe_unused synaptics_rmi4_suspend(struct device *dev)
    {
    /* Touch sleep mode */
    int retval;
    @@ -1081,7 +1080,7 @@ static int synaptics_rmi4_suspend(struct
    * This function is used to resume the touch panel
    * controller and returns integer.
    */
    -static int synaptics_rmi4_resume(struct device *dev)
    +static int __maybe_unused synaptics_rmi4_resume(struct device *dev)
    {
    int retval;
    unsigned char intr_status;
    @@ -1112,8 +1111,6 @@ static int synaptics_rmi4_resume(struct
    return 0;
    }

    -#endif
    -
    static SIMPLE_DEV_PM_OPS(synaptics_rmi4_dev_pm_ops, synaptics_rmi4_suspend,
    synaptics_rmi4_resume);


    \
     
     \ /
      Last update: 2018-02-23 21:28    [W:4.143 / U:0.524 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site