From patchwork Thu Mar 23 00:40:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Huewe X-Patchwork-Id: 9640325 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3FD1F6020B for ; Thu, 23 Mar 2017 00:39:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31E572842C for ; Thu, 23 Mar 2017 00:39:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 266B6284ED; Thu, 23 Mar 2017 00:39:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28502284E8 for ; Thu, 23 Mar 2017 00:39:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755197AbdCWAjT (ORCPT ); Wed, 22 Mar 2017 20:39:19 -0400 Received: from mout.gmx.net ([212.227.15.19]:58096 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754977AbdCWAjS (ORCPT ); Wed, 22 Mar 2017 20:39:18 -0400 Received: from lamerx.fritz.box ([79.249.171.200]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MPUZ7-1cm9w406rZ-004j1P; Thu, 23 Mar 2017 01:37:57 +0100 From: Peter Huewe To: Guenter Roeck Cc: Jean Delvare , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Huewe Subject: [PATCH 2/4] w83627ehf: Use octal values for access rights of sysfs files Date: Thu, 23 Mar 2017 01:40:25 +0100 Message-Id: <20170323004027.20982-2-peterhuewe@gmx.de> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170323004027.20982-1-peterhuewe@gmx.de> References: <20170323004027.20982-1-peterhuewe@gmx.de> X-Provags-ID: V03:K0:traybGK182Fhi3iAu4SSzowIvyr8tkuZOkxB+kCciaxrsymPD10 fQnj6AYXcLqSPrZ/SzccsHlHLMzDRRRmzIi31v5INH81/AUsk6IDXrYTRaEu4L7lKoz7a3w yNb9x6oMBYGatjkZuKaDmrHBKmH1ACyFUQO8QorDJKQ3ciYq5ouJ8vwBEmCpxQ8zHD3U/zi agNFnGK/k3rX+8+89ax7Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:csx/cysr+lM=:nJFw4Lj948zKnF0I/nRAkA 0lUwgWiO6KohyZCW9kL+H9nX7g5FjLzlk4Wg61f8Ka8ON4EFOCD7Z4GjYFvyvc6CjL4DpnD/z +lR4K95pXAC2UvH+POpIfXvCujRxEUYBzgMhyOA6g71nXD+JeREDVF/nTdkdTi74wL0PSqaCk 6YoqcecH0SCyPG6ai5UfLSnEnxLXIRkyGtm2fngJaFH5t8KG//Mq8kcf0PXx/gBck4AVdfere ac1ycwS7fbJrCkMTn9KxY+r38GOPNk4u7A66mZqq/FmvRle9qVEdrK4xVw4cM3S12ePNIANrx Mt9ebhektVW5ltROqjcBQ7H3IkLOrQ7ueBrPISChPhEz5X2Nb01L6h5f3p4eIMzpC8OgDUbEI etVdXJ2CzWWSHhjz29mbuZ9O/uyBCCbyNbx8Ip+C3sB2tiolE48EJ/6/POczDG8iOAwSTYJio oIgnRSiiAFJ3TsA9e+m4mojZnjM/fHiFGUmnL5paA3QvsK8b+1e9lSCvbDFtvkcmDimYW2CTN pwIcX+8o5MUaX1eEdB55ZE0IbsNqpfv1FsC9qcrLaCWr9LhrVwxmvEwAgSrCzlF0hJFxzjuhh UXZfUXz5oO3b7R7mpTJ1MjWXTdMr1Vf3DxvIgjG4FjYRJJcPJsCbVRTiBJCjBUtqLMP6pZG5n OnWViA2+guVhpH2JxyLUZZcoWvhy/IKOm1CL8QKZ95GFRErZ1VcerZAw7+FYX7+3PUAkv2OGQ ZIUuuuoTAADJhoHCjts8aNOfMTvl0Zm782I19CE9zjo/bAgDO5LVt0l9CJ0= Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As indicated by checkpatch, use the octal representation for the access rights. S_IWUSR | S_IRUGO => 0644 S_IRUGO => 0444 Signed-off-by: Peter Huewe --- drivers/hwmon/w83627ehf.c | 52 ++++++++++++++++++++--------------------------- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c index 785ddd47c588..b0eac8e35cc5 100644 --- a/drivers/hwmon/w83627ehf.c +++ b/drivers/hwmon/w83627ehf.c @@ -1094,25 +1094,17 @@ store_tolerance(struct device *dev, struct device_attribute *attr, } static struct sensor_device_attribute sda_target_temp[] = { - SENSOR_ATTR(pwm1_target, S_IWUSR | S_IRUGO, show_target_temp, - store_target_temp, 0), - SENSOR_ATTR(pwm2_target, S_IWUSR | S_IRUGO, show_target_temp, - store_target_temp, 1), - SENSOR_ATTR(pwm3_target, S_IWUSR | S_IRUGO, show_target_temp, - store_target_temp, 2), - SENSOR_ATTR(pwm4_target, S_IWUSR | S_IRUGO, show_target_temp, - store_target_temp, 3), + SENSOR_ATTR(pwm1_target, 0644, show_target_temp, store_target_temp, 0), + SENSOR_ATTR(pwm2_target, 0644, show_target_temp, store_target_temp, 1), + SENSOR_ATTR(pwm3_target, 0644, show_target_temp, store_target_temp, 2), + SENSOR_ATTR(pwm4_target, 0644, show_target_temp, store_target_temp, 3), }; static struct sensor_device_attribute sda_tolerance[] = { - SENSOR_ATTR(pwm1_tolerance, S_IWUSR | S_IRUGO, show_tolerance, - store_tolerance, 0), - SENSOR_ATTR(pwm2_tolerance, S_IWUSR | S_IRUGO, show_tolerance, - store_tolerance, 1), - SENSOR_ATTR(pwm3_tolerance, S_IWUSR | S_IRUGO, show_tolerance, - store_tolerance, 2), - SENSOR_ATTR(pwm4_tolerance, S_IWUSR | S_IRUGO, show_tolerance, - store_tolerance, 3), + SENSOR_ATTR(pwm1_tolerance, 0644, show_tolerance, store_tolerance, 0), + SENSOR_ATTR(pwm2_tolerance, 0644, show_tolerance, store_tolerance, 1), + SENSOR_ATTR(pwm3_tolerance, 0644, show_tolerance, store_tolerance, 2), + SENSOR_ATTR(pwm4_tolerance, 0644, show_tolerance, store_tolerance, 3), }; /* Smart Fan registers */ @@ -1190,24 +1182,24 @@ store_##reg(struct device *dev, struct device_attribute *attr, \ fan_time_functions(fan_stop_time, FAN_STOP_TIME) static struct sensor_device_attribute sda_sf3_arrays_fan4[] = { - SENSOR_ATTR(pwm4_stop_time, S_IWUSR | S_IRUGO, show_fan_stop_time, + SENSOR_ATTR(pwm4_stop_time, 0644, show_fan_stop_time, store_fan_stop_time, 3), - SENSOR_ATTR(pwm4_start_output, S_IWUSR | S_IRUGO, show_fan_start_output, + SENSOR_ATTR(pwm4_start_output, 0644, show_fan_start_output, store_fan_start_output, 3), - SENSOR_ATTR(pwm4_stop_output, S_IWUSR | S_IRUGO, show_fan_stop_output, + SENSOR_ATTR(pwm4_stop_output, 0644, show_fan_stop_output, store_fan_stop_output, 3), - SENSOR_ATTR(pwm4_max_output, S_IWUSR | S_IRUGO, show_fan_max_output, + SENSOR_ATTR(pwm4_max_output, 0644, show_fan_max_output, store_fan_max_output, 3), - SENSOR_ATTR(pwm4_step_output, S_IWUSR | S_IRUGO, show_fan_step_output, + SENSOR_ATTR(pwm4_step_output, 0644, show_fan_step_output, store_fan_step_output, 3), }; static struct sensor_device_attribute sda_sf3_arrays_fan3[] = { - SENSOR_ATTR(pwm3_stop_time, S_IWUSR | S_IRUGO, show_fan_stop_time, + SENSOR_ATTR(pwm3_stop_time, 0644, show_fan_stop_time, store_fan_stop_time, 2), - SENSOR_ATTR(pwm3_start_output, S_IWUSR | S_IRUGO, show_fan_start_output, + SENSOR_ATTR(pwm3_start_output, 0644, show_fan_start_output, store_fan_start_output, 2), - SENSOR_ATTR(pwm3_stop_output, S_IWUSR | S_IRUGO, show_fan_stop_output, + SENSOR_ATTR(pwm3_stop_output, 0644, show_fan_stop_output, store_fan_stop_output, 2), }; @@ -1229,17 +1221,17 @@ static SENSOR_DEVICE_ATTR(pwm2_stop_output, 0644, show_fan_stop_output, * Need to check support while generating/removing attribute files. */ static struct sensor_device_attribute sda_sf3_max_step_arrays[] = { - SENSOR_ATTR(pwm1_max_output, S_IWUSR | S_IRUGO, show_fan_max_output, + SENSOR_ATTR(pwm1_max_output, 0644, show_fan_max_output, store_fan_max_output, 0), - SENSOR_ATTR(pwm1_step_output, S_IWUSR | S_IRUGO, show_fan_step_output, + SENSOR_ATTR(pwm1_step_output, 0644, show_fan_step_output, store_fan_step_output, 0), - SENSOR_ATTR(pwm2_max_output, S_IWUSR | S_IRUGO, show_fan_max_output, + SENSOR_ATTR(pwm2_max_output, 0644, show_fan_max_output, store_fan_max_output, 1), - SENSOR_ATTR(pwm2_step_output, S_IWUSR | S_IRUGO, show_fan_step_output, + SENSOR_ATTR(pwm2_step_output, 0644, show_fan_step_output, store_fan_step_output, 1), - SENSOR_ATTR(pwm3_max_output, S_IWUSR | S_IRUGO, show_fan_max_output, + SENSOR_ATTR(pwm3_max_output, 0644, show_fan_max_output, store_fan_max_output, 2), - SENSOR_ATTR(pwm3_step_output, S_IWUSR | S_IRUGO, show_fan_step_output, + SENSOR_ATTR(pwm3_step_output, 0644, show_fan_step_output, store_fan_step_output, 2), };