From patchwork Thu Mar 23 13:03:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Huewe X-Patchwork-Id: 9641029 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 48A3A60328 for ; Thu, 23 Mar 2017 13:01:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B9A527317 for ; Thu, 23 Mar 2017 13:01:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39CAF2851F; Thu, 23 Mar 2017 13:01:50 +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 20D4827317 for ; Thu, 23 Mar 2017 13:01:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933255AbdCWNBs (ORCPT ); Thu, 23 Mar 2017 09:01:48 -0400 Received: from mout.gmx.net ([212.227.17.22]:58126 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754136AbdCWNBo (ORCPT ); Thu, 23 Mar 2017 09:01:44 -0400 Received: from lamerx.fritz.box ([79.249.178.48]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LxxNo-1c5a1R3Myi-015FEY; Thu, 23 Mar 2017 14:00:37 +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/5] w83627ehf: Use octal values for access rights of sysfs files Date: Thu, 23 Mar 2017 14:03:05 +0100 Message-Id: <20170323130308.29166-2-peterhuewe@gmx.de> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170323130308.29166-1-peterhuewe@gmx.de> References: <20170323130308.29166-1-peterhuewe@gmx.de> X-Provags-ID: V03:K0:/peDnH75muZcVFx0grn60dQ069zFSafY4g/nZy3i1a9JxTaT+Bz O4yNo9gZdl3JQQwH8M2FlRaDXixJKqvZxOxNoLV1wrcOnfeLdm1jSIV0oKZkRIvCjMG+Sxh AdUbExm8pcwRZAxNn4r9lTUmL6RLAnscOxuq9rxV7LuB2SPQhwYjkCDyKbpR340NV2gQVND DPZTJ/xqx1ib5vV7Y7M2Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:5/uW8enw9oo=:UsJ8jJkKT/NBa+jaxXMFa7 4pVC9mv4IC+/SWitKPGc2IY8Q1xKzjAs3+JQU7NkBaff0dY2+Jfv8X57hHS+wI9gbq4k1AVfs 4ZHVkCNo4cZg3Ju0dTtRpLjHjwfkVfsXjNBTpDwo+7L/6/wYbygy6RKlzz8dZJP46upi3BlSS /yvA3roGjaJ6udXok8YOVGF+PmePoXxVeNZOCv7jF3CEcZUzvkN1rLL9aiDrbIRCGXsAwCivz mWL4p0FEHJEVd9VcA+93TnUyiC0xRelZqiMr79qRb9uyhtSXAn5D8d/3nTQij11qqR1SNtqsZ 4C447VUGV3PGGJ9DhuhWHP+se2xsofaIcPe90UEd8a3yq5piegAxO0kUNAfx1B8KOGFhxHiAf OPdnI+vSzfIzqQybwKA1cqZHgvL41JegP4AJ9keaCZn87maQnypOGwloXt9cdxCJZ9lxdPaFm LUuftTxwe9IdA5Ll3L+c/fOgy4b3RXBy1+IuiCVPJOOh18uUEBhtVP1GLRvzeflpxDiNX0+rN tqW8uNUtnwBVsDPU5nfkzENnChUf1XDFdInnoCKGZuFm8HmdVjlby6hhaI8Fb4KPMbr97IvE4 BA7pFXStvrOhEuA7tPswoYB6LnvbjIpAAc+jOg+u55qCWaKqtV6yLYpeZjGTMHUUkWALBnM5U NgpCu/xRQdHr9hQZbHQK4PLKNSh4bEdazY0RU2Ei+7S67gVtpFXNS8yexO0HJWbK9fvSCk+0K wxQcXQ+YB54rWmTYsQtUkT2MO6LG0sKo0uBeSLWemFgVg3DbYuvPYam1LwI= 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 f2f33dd35fd4..0acadeece509 100644 --- a/drivers/hwmon/w83627ehf.c +++ b/drivers/hwmon/w83627ehf.c @@ -1098,25 +1098,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 */ @@ -1194,24 +1186,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), }; @@ -1233,17 +1225,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), };