From patchwork Sat Oct 8 19:10:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jules Irenge X-Patchwork-Id: 13001859 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CE1CC433FE for ; Sat, 8 Oct 2022 19:11:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229459AbiJHTK7 (ORCPT ); Sat, 8 Oct 2022 15:10:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229791AbiJHTK6 (ORCPT ); Sat, 8 Oct 2022 15:10:58 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A21392F643; Sat, 8 Oct 2022 12:10:56 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id bv10so8062585wrb.4; Sat, 08 Oct 2022 12:10:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:date:from :from:to:cc:subject:date:message-id:reply-to; bh=1wbrHIINWpNtq1uT4Jf3QIYAe/wvpMtUNlJq6URPo7Y=; b=gWoU7Rx2ibfkGptoYG9FDbP0gxfTtzkWf1ilHfG+T3uESHxU32ANZzJ2JF4sWQOVkk YWv7mQdLwAOueULcAyuZ7rg1cuEGPUU5G5OI+h7Oecpc2SHWAVQFt4jIZDAeIJfp4INL yo3kk5sPu0gHjkXJZAXXeHRaI+/zBx4wpgiFeacC1YQ3JCnpyeks6ZC9++/XuAzbDdq0 6IazpEkmbbMePGeovpcOoVKtC9kjCUthFH35UiasyExZtoKbf/C3h0L8lEV184dDtPOG aJz/+FTM5IHHqapZ8bYyBvOa0w44qIWy191BzoxLKE4NIgGuKQkqK42tWrl6E/1JyqQ3 oq1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1wbrHIINWpNtq1uT4Jf3QIYAe/wvpMtUNlJq6URPo7Y=; b=bkqEjnrPPzWWB2cLMx/bCgioaI9Om8sON+zYXgqv9WRBZ2Pcn0be1Ce++m2F4deRGk hdwW54mm0JjNh6kp3KNxNL+c5iE629QMrfDFaSxT5fvKGptHoDE9aafJCZa5N7EfxX4e ORKxyUVeIAJuEGpTVMUwxeJ8cA6Aulbc9XrEtbOgn2jmj6wc75IflI0Huk7Ca/fJlQbb Vai+38Vv5daTNY72qnKXJiXwtPsC0SGfuwhE2KTQv4AXF/vdAPPZi4NaQ+RuFiwe5pek o6how6Sw3mMyH85iyBcmHR5jmGtFozC2XHSXGFC1g94cT/GTmCdOn/rrlhyWBP21sk4y OLlw== X-Gm-Message-State: ACrzQf0I1zixsqkLDf0MGksTXBbuVYQZUYeVLEafiBOT22zUIIbk2F/m TotVdUSOqumyEU62Un4Ubw== X-Google-Smtp-Source: AMsMyM7ds93yz+i63Lvzrb/741kz+lZLJ7NheYdFKnuCQPCx1YGqA/LKhss9WIikPqnthopYaei6UA== X-Received: by 2002:a5d:5552:0:b0:22e:6941:81f8 with SMTP id g18-20020a5d5552000000b0022e694181f8mr6563177wrw.521.1665256255039; Sat, 08 Oct 2022 12:10:55 -0700 (PDT) Received: from octinomon ([2a00:23c8:2f02:3b01:3ea1:40:8650:189]) by smtp.gmail.com with ESMTPSA id q3-20020a1c4303000000b003b4bd18a23bsm10912968wma.12.2022.10.08.12.10.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Oct 2022 12:10:54 -0700 (PDT) From: Jules Irenge X-Google-Original-From: Jules Irenge Date: Sat, 8 Oct 2022 20:10:52 +0100 To: erazor_de@users.sourceforge.net Cc: jikos@kernel.org, benjamin.tissoires@redhat.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] HID: roccat: Convert snprintf() to sysfs_emit() Message-ID: MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Coccinnelle reports a warning Warning: Use scnprintf or sprintf Following the advice on kernel documentation https://www.kernel.org/doc/html/latest/filesystems/sysfs.html For show(device *...) functions we should only use sysfs_emit() or sysfs_emit_at() especially when formatting the value to be returned to user space. Convert snprintf() to sysfs_emit() Signed-off-by: Jules Irenge --- drivers/hid/hid-roccat-kone.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/hid/hid-roccat-kone.c b/drivers/hid/hid-roccat-kone.c index 76da04801ca9..f0c35c05e702 100644 --- a/drivers/hid/hid-roccat-kone.c +++ b/drivers/hid/hid-roccat-kone.c @@ -403,7 +403,7 @@ static ssize_t kone_sysfs_show_actual_profile(struct device *dev, { struct kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev->parent->parent)); - return snprintf(buf, PAGE_SIZE, "%d\n", kone->actual_profile); + return sysfs_emit(buf, "%d\n", kone->actual_profile); } static DEVICE_ATTR(actual_profile, 0440, kone_sysfs_show_actual_profile, NULL); @@ -412,7 +412,7 @@ static ssize_t kone_sysfs_show_actual_dpi(struct device *dev, { struct kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev->parent->parent)); - return snprintf(buf, PAGE_SIZE, "%d\n", kone->actual_dpi); + return sysfs_emit(buf, "%d\n", kone->actual_dpi); } static DEVICE_ATTR(actual_dpi, 0440, kone_sysfs_show_actual_dpi, NULL); @@ -435,7 +435,7 @@ static ssize_t kone_sysfs_show_weight(struct device *dev, if (retval) return retval; - return snprintf(buf, PAGE_SIZE, "%d\n", weight); + return sysfs_emit(buf, "%d\n", weight); } static DEVICE_ATTR(weight, 0440, kone_sysfs_show_weight, NULL); @@ -444,7 +444,7 @@ static ssize_t kone_sysfs_show_firmware_version(struct device *dev, { struct kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev->parent->parent)); - return snprintf(buf, PAGE_SIZE, "%d\n", kone->firmware_version); + return sysfs_emit(buf, "%d\n", kone->firmware_version); } static DEVICE_ATTR(firmware_version, 0440, kone_sysfs_show_firmware_version, NULL); @@ -454,7 +454,7 @@ static ssize_t kone_sysfs_show_tcu(struct device *dev, { struct kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev->parent->parent)); - return snprintf(buf, PAGE_SIZE, "%d\n", kone->settings.tcu); + return sysfs_emit(buf, "%d\n", kone->settings.tcu); } static int kone_tcu_command(struct usb_device *usb_dev, int number) @@ -556,7 +556,7 @@ static ssize_t kone_sysfs_show_startup_profile(struct device *dev, { struct kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev->parent->parent)); - return snprintf(buf, PAGE_SIZE, "%d\n", kone->settings.startup_profile); + return sysfs_emit(buf, "%d\n", kone->settings.startup_profile); } static ssize_t kone_sysfs_set_startup_profile(struct device *dev, From patchwork Sat Oct 8 19:15:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jules Irenge X-Patchwork-Id: 13001860 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E37FC433FE for ; Sat, 8 Oct 2022 19:15:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229531AbiJHTPr (ORCPT ); Sat, 8 Oct 2022 15:15:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229844AbiJHTPq (ORCPT ); Sat, 8 Oct 2022 15:15:46 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E501C3D586; Sat, 8 Oct 2022 12:15:44 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id w18so11643185wro.7; Sat, 08 Oct 2022 12:15:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:date:from :from:to:cc:subject:date:message-id:reply-to; bh=Z8CtB6fqznYD0X3GM2ZD+I8J1/eW4GPOSbOmwiNyM2k=; b=lZTAkxRffPM5QjfDjXQM+C1+UP0fUwK4X+y/BpBEzPfew0S1p4cOJfRXOJ6ItKbkHS w8xapv1rNRHLNq1sLGT4iJ6dy7Lx61Qvh07sZPpcT5Yr8VUxywjobf2h1I529EJ0yAfJ yNnAb92epVMtpUwY0QLbDohsg+6/Etr3bDYizpjXqtNyla/aI6tKrlG1IZ0iw231fVjT F2FlF8BXYvFZT4aSknkR8QQAGV9OodB7yymuAPSsjSm7cHediB+w6z8qPSAicAEUIypl Mn2yDJovv3yw7y+Dq7g5l+AC9avcrT2TuO9u0MKEZR3hqQ0accfntwcyAhkO2EQu14pS BZ4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Z8CtB6fqznYD0X3GM2ZD+I8J1/eW4GPOSbOmwiNyM2k=; b=YfrXVAzNYSVhY/EI6+mxbCl9b45Z4hqaZVNXGhm/WJ152lVZdLlHdkd9E8m2dX66Rg lKPRE0b4Dni1plczDu1VYM3Xw9gl95ZEnQtjmYCHxRbBv/QiYF5LPOp12AU09TWePS7j 3ykEej+O0RUUdLVw7SwLS1RqY3dMf9R8wcolLwzeCD4KSqdoj7gXcahW8cXllUlMeC7G C+kmFdcV21xj4cmq5Bx+wAgYbn8aVhmwvSXt++Z1wZTMdKuXgCGCltjgjjKxtj+A/Sl3 ps+A859fAIU08ert52S9H1h9F0ZU4dLcZU4cLMPF73ewCIUaneWPunKTNqiPI4/cRdmE DUDg== X-Gm-Message-State: ACrzQf2WQxagXPjr8w3w/b4bGhK0WqNNUcbVkLUpVHdyIZGV+nUYfEiC OrVcBRdjkp4T71AwjDUF6A== X-Google-Smtp-Source: AMsMyM4Lhzoa5C90JWM+3UAe9iWhpBc2Jd4hYV15FZMv+wOPd9nZ4VS5ZHSI0qymsgRvOs7J2W0lPw== X-Received: by 2002:a05:6000:184e:b0:22e:4649:b3c9 with SMTP id c14-20020a056000184e00b0022e4649b3c9mr7312119wri.671.1665256543399; Sat, 08 Oct 2022 12:15:43 -0700 (PDT) Received: from octinomon ([2a00:23c8:2f02:3b01:3ea1:40:8650:189]) by smtp.gmail.com with ESMTPSA id f62-20020a1c3841000000b003b31fc77407sm12514143wma.30.2022.10.08.12.15.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Oct 2022 12:15:42 -0700 (PDT) From: Jules Irenge X-Google-Original-From: Jules Irenge Date: Sat, 8 Oct 2022 20:15:41 +0100 To: erazor_de@users.sourceforge.net Cc: jikos@kernel.org, benjamin.tissoires@redhat.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] HID: roccat: Convert snprintf() to sysfs_emit() Message-ID: MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Coccinnelle reports a warning Warning: Use scnprintf or sprintf Following the advice on kernel documentation https://www.kernel.org/doc/html/latest/filesystems/sysfs.html For show(device *...) functions we should only use sysfs_emit() or sysfs_emit_at() especially when formatting the value to be returned to user space. Convert snprintf() to sysfs_emit() Signed-off-by: Jules Irenge --- drivers/hid/hid-roccat-kovaplus.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/hid/hid-roccat-kovaplus.c b/drivers/hid/hid-roccat-kovaplus.c index 6fb9b9563769..7f6238a19739 100644 --- a/drivers/hid/hid-roccat-kovaplus.c +++ b/drivers/hid/hid-roccat-kovaplus.c @@ -274,7 +274,7 @@ static ssize_t kovaplus_sysfs_show_actual_profile(struct device *dev, { struct kovaplus_device *kovaplus = hid_get_drvdata(dev_get_drvdata(dev->parent->parent)); - return snprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_profile); + return sysfs_emit(buf, "%d\n", kovaplus->actual_profile); } static ssize_t kovaplus_sysfs_set_actual_profile(struct device *dev, @@ -327,7 +327,7 @@ static ssize_t kovaplus_sysfs_show_actual_cpi(struct device *dev, { struct kovaplus_device *kovaplus = hid_get_drvdata(dev_get_drvdata(dev->parent->parent)); - return snprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_cpi); + return sysfs_emit(buf, "%d\n", kovaplus->actual_cpi); } static DEVICE_ATTR(actual_cpi, 0440, kovaplus_sysfs_show_actual_cpi, NULL); @@ -336,7 +336,7 @@ static ssize_t kovaplus_sysfs_show_actual_sensitivity_x(struct device *dev, { struct kovaplus_device *kovaplus = hid_get_drvdata(dev_get_drvdata(dev->parent->parent)); - return snprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_x_sensitivity); + return sysfs_emit(buf, "%d\n", kovaplus->actual_x_sensitivity); } static DEVICE_ATTR(actual_sensitivity_x, 0440, kovaplus_sysfs_show_actual_sensitivity_x, NULL); @@ -346,7 +346,7 @@ static ssize_t kovaplus_sysfs_show_actual_sensitivity_y(struct device *dev, { struct kovaplus_device *kovaplus = hid_get_drvdata(dev_get_drvdata(dev->parent->parent)); - return snprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_y_sensitivity); + return sysfs_emit(buf, "%d\n", kovaplus->actual_y_sensitivity); } static DEVICE_ATTR(actual_sensitivity_y, 0440, kovaplus_sysfs_show_actual_sensitivity_y, NULL); @@ -367,7 +367,7 @@ static ssize_t kovaplus_sysfs_show_firmware_version(struct device *dev, &info, KOVAPLUS_SIZE_INFO); mutex_unlock(&kovaplus->kovaplus_lock); - return snprintf(buf, PAGE_SIZE, "%d\n", info.firmware_version); + return sysfs_emit(buf, "%d\n", info.firmware_version); } static DEVICE_ATTR(firmware_version, 0440, kovaplus_sysfs_show_firmware_version, NULL); From patchwork Sat Oct 8 19:24:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jules Irenge X-Patchwork-Id: 13001863 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E95EC433FE for ; Sat, 8 Oct 2022 19:24:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229745AbiJHTY4 (ORCPT ); Sat, 8 Oct 2022 15:24:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229720AbiJHTYz (ORCPT ); Sat, 8 Oct 2022 15:24:55 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E64A1929F; Sat, 8 Oct 2022 12:24:53 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id bk15so11615831wrb.13; Sat, 08 Oct 2022 12:24:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:date:from :from:to:cc:subject:date:message-id:reply-to; bh=ug3lOc6jfgPHpJPdL4UNADTEvLPCskKFnlfe0HCOmbw=; b=nOUzwtYiCzHdMnAmTs+5UaATq86aPTUSRjjgcsSBh3RAI+R+hT40Yta2dNH6UogZw1 rpO48kqndJN9EeQEtqZi7EIuYO6Us9jwec0lEU4PZS5Jfa0KwbQ5IwplUuIwaSvMSBfi XlHWgv8O5LXX2IKvB9Cm8SFA+m4Ytv0ye/mRWbAskJtWPIgVZFuFlqOJGYaeGwR4T183 9DZ+lbWITQ8uEAgUdvKkJYRKJf9CKs4+PqPvQMLkWgK60CfjzK1G6bstaP53Rx/2aHdY WhTV4qPLsAJV61zUZGjuobt13i5P4p8ZKCBJWSLCg5nHbApq+RXB7zU4liE4YrsKVBPv 4TKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ug3lOc6jfgPHpJPdL4UNADTEvLPCskKFnlfe0HCOmbw=; b=wscSAs4OFbTxxZpB+5kWX0KMauBD8ojHShH2sKHWr/tkuhZQgA5E8FNyR1V9nJFSpS fUrzqeaa90cMO6icAdn2nTkRFqN8nkMP85V/XR96rGsGsc2egS9Anp5Ao+uaagS5mljQ 7Bc6pJTpIoRxe+ZOP5XMf+tlj+tI3YQphOthpO+IBFJwm/uwcXnZd3uUZmNzOqF5xdcd dUw9fSTWbvgGO+5SyHS6GTlaLKjb6298XHvgGggyheErn8YhRivbDvNKb4tbwrgx1lNr W8jMOBHI0VWz9sRZ12Ix8NJ50E4sWn3PgFRQbSzzJl1YV2lTxmMAtwRDuVa4q0amEW8W S3Yw== X-Gm-Message-State: ACrzQf2RJIcgZE5CB9ieuMX14eCu7fsgzpv5Wt16sAt705l1mn3UwHPx VeoknguNN6f0o/tIuwxnCA== X-Google-Smtp-Source: AMsMyM4lCBxgUiaXnVH84Z93igGbHsYZNIcRTkdi2aMyBOcHIEkSGoCs/OWukXWdkKnWpAcR+2IaBg== X-Received: by 2002:adf:d1cc:0:b0:22e:6371:65ad with SMTP id b12-20020adfd1cc000000b0022e637165admr6946730wrd.326.1665257092268; Sat, 08 Oct 2022 12:24:52 -0700 (PDT) Received: from octinomon ([2a00:23c8:2f02:3b01:3ea1:40:8650:189]) by smtp.gmail.com with ESMTPSA id h17-20020a056000001100b00228d67db06esm5141209wrx.21.2022.10.08.12.24.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Oct 2022 12:24:51 -0700 (PDT) From: Jules Irenge X-Google-Original-From: Jules Irenge Date: Sat, 8 Oct 2022 20:24:49 +0100 To: erazor_de@users.sourceforge.net Cc: jikos@kernel.org, benjamin.tissoires@redhat.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] HID: roccat: Convert snprintf() to sysfs_emit() Message-ID: MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Coccinnelle reports a warning Warning: Use scnprintf or sprintf Following the advice on kernel documentation https://www.kernel.org/doc/html/latest/filesystems/sysfs.html For show(device *...) functions we should only use sysfs_emit() or sysfs_emit_at() especially when formatting the value to be returned to user space. Convert snprintf() to sysfs_emit() Signed-off-by: Jules Irenge --- drivers/hid/hid-roccat-koneplus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-roccat-koneplus.c b/drivers/hid/hid-roccat-koneplus.c index 1896c69ea512..1635ddc7c3cf 100644 --- a/drivers/hid/hid-roccat-koneplus.c +++ b/drivers/hid/hid-roccat-koneplus.c @@ -244,7 +244,7 @@ static ssize_t koneplus_sysfs_show_actual_profile(struct device *dev, { struct koneplus_device *koneplus = hid_get_drvdata(dev_get_drvdata(dev->parent->parent)); - return snprintf(buf, PAGE_SIZE, "%d\n", koneplus->actual_profile); + return sysfs_emit(buf, "%d\n", koneplus->actual_profile); } static ssize_t koneplus_sysfs_set_actual_profile(struct device *dev, @@ -311,7 +311,7 @@ static ssize_t koneplus_sysfs_show_firmware_version(struct device *dev, &info, KONEPLUS_SIZE_INFO); mutex_unlock(&koneplus->koneplus_lock); - return snprintf(buf, PAGE_SIZE, "%d\n", info.firmware_version); + return sysfs_emit(buf, "%d\n", info.firmware_version); } static DEVICE_ATTR(firmware_version, 0440, koneplus_sysfs_show_firmware_version, NULL);