Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758165AbbKSK75 (ORCPT ); Thu, 19 Nov 2015 05:59:57 -0500 Received: from mail-bn1on0081.outbound.protection.outlook.com ([157.56.110.81]:50801 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752892AbbKSK7z (ORCPT ); Thu, 19 Nov 2015 05:59:55 -0500 X-Greylist: delayed 8210 seconds by postgrey-1.27 at vger.kernel.org; Thu, 19 Nov 2015 05:59:54 EST Authentication-Results: spf=pass (sender IP is 137.71.25.57) smtp.mailfrom=analog.com; arndb.de; dkim=none (message not signed) header.d=none;arndb.de; dmarc=bestguesspass action=none header.from=analog.com; Reply-To: Subject: Re: [PATCH] misc: ad525x_dpot: Fix the enabling of the "otpXen" attributes References: <1447863375-2195-1-git-send-email-dan.bogdan.nechita@gmail.com> To: Dan Bogdan Nechita , Arnd Bergmann , Greg Kroah-Hartman CC: From: Michael Hennerich Organization: Analog Devices Inc. Message-ID: <564D86E3.4030509@analog.com> Date: Thu, 19 Nov 2015 09:22:59 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1447863375-2195-1-git-send-email-dan.bogdan.nechita@gmail.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD052;1:zKnaCHzclkJO3R9QH8ce7AD2LB/NleI9wEcBf+jL2UzWsrbcULyVu6V3y8ZIBLjOy0GIrnqh2Y5rX8/JZiQeNmaL19JtbrZFuhiHmjdCOYoKWWRAGP64L/tMrqok6qoq6pIw5ScDi79BVSt5JYX0u/maNVnMSDdsvsm5NrxENEEc2LcOuP3eU2eynz/TF+8uwzakOrkCFK7tlndyIfs95UgM9DailzO0q4M4cKzihxrQgMnoOAwS77G6CFW65UAX7DDGCFdsHvu27ap0USw5E/dvVr7Y33XdjipWJ5prP1dMoLXkJeDoCjtobPOP83alqaxE1qHceuJNdP9qUFMM5euv3EBL+jaIKIpLJvORkNU/PsP54qIzx0F/fBswWR2zRf4x6HH9d5wuvE7SDLAMMsLINvE6yGBVrWfozDU1sCE= X-Forefront-Antispam-Report: CIP:137.71.25.57;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(438002)(189002)(199003)(479174004)(24454002)(377454003)(54356999)(87266999)(5007970100001)(43066003)(11100500001)(76176999)(65806001)(50466002)(230700001)(586003)(53806999)(5008740100001)(65816999)(83506001)(19580405001)(5001970100001)(65956001)(2950100001)(87936001)(80316001)(50986999)(47776003)(189998001)(106466001)(59896002)(77096005)(6806005)(19580395003)(64126003)(36756003)(33656002)(86362001)(5001770100001)(4001350100001)(23746002);DIR:OUT;SFP:1101;SCL:1;SRVR:BL2PR03MB242;H:nwd2mta2.analog.com;FPR:;SPF:Pass;PTR:nwd2mail11.analog.com;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BL2PR03MB242;2:uvQCm9fPPMrcOvwWS28YMkrN4oR1hMe+BBhbj4N3B1LZhKWpLYUzUfrJsDCpZpKwHsAo3YEfOv2FOagBXEp9TEHVqd+rE78eRnFVqvK89bLg9xBieeC8FornwTUTDkQf/SaGCuQeRUFJPa503q78aCsX6tQUUg68L9uNzdClqbc=;3:GDWRH6FB1Xd9liDgO1KHCV4bEl+OIotx+xXfvO0rsBmZdj62e94hyd7XgiUNhMbchA7UZ7Ae/2C/gQm3HFMuzeE1eyy8pXV2vKpmZ5Ghb2uFbbNydfJEAMDgR+tUZb7U9UU4RVg/mH9pb/fqiMeD8In1QR4lridBWrHvDRLew2vK6KWxGSxHx5tlvWsHfPEziNtvQFEoC+0MwdEZhz0ft8eF0DnC/cBKZ4Z0Z6qSNj5bnTkcR8u+DzWEmSygZIDe;25:XXR/4cPLd9GspaC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Z6wWLPvUrzyZXbV6Ve2GY9p41BEIwJtEyjnbe9qBFojF25OCM/IEMSc+BEtJrlORGw6juYS1w9XcZHYeSfVyvt3zYEOp5SVjF5Z+uSODn0GNYHfKpwWSqNhGSWUsazKtOFoCZHoV1ee95y2rBqQEnycY6W7Sg8szJruc8+iYeIXQYmdsvMM8QqRxD2jHv X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(232431446821674); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(10201501046)(3002001);SRVR:BL2PR03MB242;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB242; X-Forefront-PRVS: 07658B8EA3 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;BL2PR03MB242;23:118W5Ww9AXiAVDV6v6tthaQAU11l6A7fPPoDt3?= =?Windows-1252?Q?No1fx8wjo4vex1zMTyJJVkYFjXBjYyF28ITUobMoRbeN4jiRg3YjxhA4?= =?Windows-1252?Q?8NChn3hYUGKwskxeIoIi5vNOdNWNi/3NCbDQq9w/qdKR7NhUYrKLbE61?= =?Windows-1252?Q?ir3yJh2PxxWA7+zPn408tH0sTjbtPUOd9THwsowtK2F5zHgg+R/hYS/B?= =?Windows-1252?Q?/zYEOl3DqMmWGAuZxJeekeMYVkSHPF42s4sIdyfIhpLXiPVKGQmWQufJ?= =?Windows-1252?Q?NWYA787UaEddKB6gkbtDlrqsjVRCIpHx2H/vUlMHeKLCNvA/kc78Td5A?= =?Windows-1252?Q?xukBY2lUPjkGK5nfqSXEtyjqhle8mtvcLp5dGCh/bgPii0cO3fvr1sHg?= =?Windows-1252?Q?AzSnyW1XRugRrIeDn9E2YVtcilL1Nmb+55z9b/2513FioZAkTfXYwveV?= =?Windows-1252?Q?BE3+GgXltoO8YZNWAwtOyR74gPr84Wm7okQUQ0kCLH8bnjtaWIaIjweU?= =?Windows-1252?Q?IJ0Vi5aA3PRpYOW834KvNQ6Vdbb23rXCOZ9/LKxpjcRfxe7B6pFjtovI?= =?Windows-1252?Q?ACz+ku2sVRYY+7mAOWYnb63794wKuabocuEmkAgFBSZrAmamot8f60j+?= =?Windows-1252?Q?5QVBB3d+LQG/hpMDzlTeUU+irlro3/VyYtGTs/ZaxYk7M2hILxgBOWfG?= =?Windows-1252?Q?Fa3l86/iAZUX9A1nN6V14Mhtp0Bun8AxPiojGy6iFznqC4qN009MO/nO?= =?Windows-1252?Q?TQlOf8bb79dnT8tVDabmnQYkAmERw+KcdVAabXDfLmEp5oMNXat2h7AO?= =?Windows-1252?Q?2chXaMyvNW9Wo7XJ9QQcxEZTNwnE4TM3xWMNjAYWRecpNdm59m3u8gpg?= =?Windows-1252?Q?GPNI68nZA2EuirGy8lbgdVSOnqzaqbAlx0IkRCT9xsqwzNqE7ZRuhoNW?= =?Windows-1252?Q?Dfxtpp7v9c8QvKFkIYxyZgCHcJwHoTzheX5CrSUgvGoq2gnt0mYTHRfG?= =?Windows-1252?Q?0TNCorrQFb1iZGZco9M48WHSq86F9YF79h7zDV9d6KerCkjdhO8SCr5P?= =?Windows-1252?Q?YSt8tV76Cw/1+d+be1fL+x1Lby7D8aJHXmk/KLc1gcGBFEjEcGGKeUJO?= =?Windows-1252?Q?p7l5IhJYKUDDWR0+vGZ2dOVAtn5qxBoUW6iVItV3FAS5pbJIT6fX51Nx?= =?Windows-1252?Q?Zt6z2meIHwRXPAsIIyd4gim23HspXURgQrG2WxEr2O/HnXZGkMgiVSsS?= =?Windows-1252?Q?ZPbs5oJHJMKfeXkw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;BL2PR03MB242;5:jGjPAoc4W8nhOhkPtX8wsjB6hsQDy6owh2QXjO3SLH4Al0NsLGAEEUd0vruX056cTZcggF+WD0eXwwS7/zgVNouvuq2Q1Pin46y0ZcJ3uk8iZupLa2xiyTlRmrHcHXV6x8n9TWNPzY4F+AesJ950eQ==;24:GuNpU+pmjIRRep4o1q6FpNwEwiuVSXstUnCOjygZ6/p1DhHuKmwFNfXdNtxZ62mIbMQRxnfHBdtqzilnynYx/fyM+MlGkGGP2WHU0NKWE8o=;20:dl8SHoEYgw3KJsfZBl9DL2+R/0ezpVZFBXwJUKidWI160wdteJ8f8KtfEWpxn5S9t/uW5JcmExKAehGID/bDrg== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2015 08:28:58.3610 (UTC) X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.57];Helo=[nwd2mta2.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR03MB242 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1304 Lines: 36 On 11/18/2015 05:16 PM, Dan Bogdan Nechita wrote: > Currently writing the attributes with "echo" will result in comparing: > "enabled\n" with "enabled\0" and attribute is always set to false. > > Use the sysfs_streq() instead because it treats both NUL and > new-line-then-NUL as equivalent string terminations. > > Signed-off-by: Dan Bogdan Nechita Acked-by: Michael Hennerich > --- > drivers/misc/ad525x_dpot.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c > index 15e8807..4230e6a 100644 > --- a/drivers/misc/ad525x_dpot.c > +++ b/drivers/misc/ad525x_dpot.c > @@ -452,7 +452,7 @@ static ssize_t sysfs_set_reg(struct device *dev, > int err; > > if (reg & DPOT_ADDR_OTP_EN) { > - if (!strncmp(buf, "enabled", sizeof("enabled"))) > + if (sysfs_streq(buf, "enabled")) > set_bit(DPOT_RDAC_MASK & reg, data->otp_en_mask); > else > clear_bit(DPOT_RDAC_MASK & reg, data->otp_en_mask); > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/