From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756806AbcHBOhU (ORCPT ); Tue, 2 Aug 2016 10:37:20 -0400 Received: from mga14.intel.com ([192.55.52.115]:61524 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935184AbcHBOeQ (ORCPT ); Tue, 2 Aug 2016 10:34:16 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,460,1464678000"; d="asc'?scan'208";a="1028327205" From: Felipe Balbi To: Baole Ni , gregkh@linuxfoundation.org, m.chehab@samsung.com, m.szyprowski@samsung.com, kyungmin.park@samsung.com, k.kozlowski@samsung.com Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, chuansheng.liu@intel.com, baolex.ni@intel.com, mina86@mina86.com, deepa.kernel@gmail.com, mathias.nyman@linux.intel.com, stern@rowland.harvard.edu, oneukum@suse.com Subject: Re: [PATCH 0986/1285] Replace numeric parameter like 0444 with macro In-Reply-To: <20160802120531.15807-1-baolex.ni@intel.com> References: <20160802120531.15807-1-baolex.ni@intel.com> User-Agent: Notmuch/0.22+58~g3a45d29 (https://notmuchmail.org) Emacs/25.0.95.2 (x86_64-pc-linux-gnu) Date: Tue, 02 Aug 2016 16:53:57 +0300 Message-ID: <87eg67qnt6.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Baole Ni writes: > I find that the developers often just specified the numeric value > when calling a macro which is defined with a parameter for access permiss= ion. > As we know, these numeric value for access permission have had the corres= ponding macro, > and that using macro can improve the robustness and readability of the co= de, > thus, I suggest replacing the numeric parameter with the macro. > > Signed-off-by: Chuansheng Liu > Signed-off-by: Baole Ni > --- > drivers/usb/phy/phy-tahvo.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/phy/phy-tahvo.c b/drivers/usb/phy/phy-tahvo.c > index ab5d364..a297861 100644 > --- a/drivers/usb/phy/phy-tahvo.c > +++ b/drivers/usb/phy/phy-tahvo.c > @@ -73,7 +73,7 @@ static ssize_t vbus_state_show(struct device *device, > struct tahvo_usb *tu =3D dev_get_drvdata(device); > return sprintf(buf, "%s\n", tu->vbus_state ? "on" : "off"); > } > -static DEVICE_ATTR(vbus, 0444, vbus_state_show, NULL); > +static DEVICE_ATTR(vbus, S_IRUSR | S_IRGRP | S_IROTH, vbus_state_show, N= ULL); >=20=20 > static void check_vbus_state(struct tahvo_usb *tu) > { > @@ -318,7 +318,7 @@ static ssize_t otg_mode_store(struct device *device, >=20=20 > return r; > } > -static DEVICE_ATTR(otg_mode, 0644, otg_mode_show, otg_mode_store); > +static DEVICE_ATTR(otg_mode, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, otg_= mode_show, otg_mode_store); line too long =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXoKX1AAoJEIaOsuA1yqREjmYQAJKWeBwV5swqv8BgkpOxXKUa FFQAG09rjQQHUbDRCjwkKkP00l4ZziTKISK2I/R1RTn4SCHSv0BEE82crMizyfyL 8P7Rfebqlj9ntDUZ2l/R15fD4JdYVFWzKlr/UpkOl7kcg/6d5OoeNjisq3d33H3h cbweGWIzbHrMyKMxnT7NaCGfAgUAYPt5N5pB+/AkMUR2VvJqJolN3oMQl5wiHd5B +Y4awMXSUM7NzN3TvINa8EmzbMjPqguhxuZDLxvS9xnuNIIoxOaV3gk7PW3xPzVy 540QG24JpP8ABFgN5wRBwXU/9hi48Qnfnvk+yahjeN8aRvGrvFaEwQSI+HYxvUKA 5obNrX9oKs27rhb50RQzHCRpb1DgVWlQbAcwAHg4y3pypjPixt767At55eDVpZXG Y/ZQ1dzgVLzsRyxzJnYVzA9xADFiRmOoOfYNMYYZiKfnLGUISicyvwdqPdLjNOmE cl7Qq61CIGA6+7htPm698jPDv+k6N6AxDQ5OAAwiMP2DbIEDABU7cpJDh8k/w+L/ lVhqWIbRu5r22JnJMByldZnBxE0juav8TcwCDLvpHKu4A38lfc1zovCHeVuH6ZOW /TtKuoiaW9vIm1vf5g+lJkntB6pjNU9ksxSHjqzOruTKDj8TSe3ugkf8XXHRYeMS dVXKrl/dEMVkDUbdLDt1 =4sL2 -----END PGP SIGNATURE----- --=-=-=--