Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933250AbbKRQaw (ORCPT ); Wed, 18 Nov 2015 11:30:52 -0500 Received: from mail-bn1bon0066.outbound.protection.outlook.com ([157.56.111.66]:18866 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933196AbbKRQau (ORCPT ); Wed, 18 Nov 2015 11:30:50 -0500 Authentication-Results: spf=softfail (sender IP is 137.71.25.57) smtp.mailfrom=gmail.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=gmail.com; From: Dan Bogdan Nechita To: Arnd Bergmann , Greg Kroah-Hartman CC: Michael Hennerich , , Dan Bogdan Nechita Subject: [PATCH] misc: ad525x_dpot: Fix the enabling of the "otpXen" attributes Date: Wed, 18 Nov 2015 18:16:15 +0200 Message-ID: <1447863375-2195-1-git-send-email-dan.bogdan.nechita@gmail.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Matching-Connectors: 130923369907428987;(52f37747-95c3-483a-bd05-08d153b03fac);() X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD043;1:cQ12Sbxi5pjXZW2S/HsUrvpZJAJnvm9Bvb+m/YySaFeb26Q1xKGip7AEAnD7BYN4roZyG6OFsDCH/yitUMf9omXqSLzpfgehv/r9kN1BRt9yvYy+9B64Sh8qMSExe97bKpBAS4cohuoBes+tDTEsTNa1qyxKlwjRnwJTadrtqPKf1nOeQ/dHePT6n16A/7kxjgPuJm3ZBv+m8OL65hqj4x9WXjt87D/HuGhhaKEqqVWCIrvZzeniiVhLqpmorV9G6ed2fGYwm7sfgjS1vZmyMnRKfZ/ZrsWOLaO6PRFTr/5mFkQ2gZX53jsl8KfPQ39sLFVoMZBHO/ulZVEtvLSyevby4bXjfkCVy6KXkCf1pw/AspRCWRFpmZCb9EE1RX156HuDqlw5MgBWYkLADZzyc9lEN1HftcGB+vEHb74rCaYdQWh9AeaLRDXNYym2SMEa X-Forefront-Antispam-Report: CIP:137.71.25.57;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(189002)(199003)(189998001)(19580395003)(86362001)(81442002)(5001770100001)(76482005)(5001970100001)(19580405001)(105596002)(82202001)(48376002)(36756003)(53416004)(92566002)(5003940100001)(83322999)(586003)(50466002)(87936001)(11100500001)(6260500002)(106466001)(5008740100001)(6806005)(5007970100001)(50226001)(229853001)(77096005)(87572001)(50986999)(55446002)(73392002)(73972006)(33646002)(47776003)(61266001);DIR:OUT;SFP:1101;SCL:1;SRVR:CH1PR03MB622;H:nwd2mta2.analog.com;FPR:;SPF:SoftFail;PTR:nwd2mail11.analog.com;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;CH1PR03MB622;2:ExPHBaoCzylCm2y/p3WKXwYgayI1C8h1Zj9LhOny9cxaOvGDfMmVSseGq8U972pa0RewY+Dk9R2gn4Wuo1+nMO2rjtFnT7ELVBLAdPx78ARfTTF4nq0XZ2AB7ID9KQz2jUHCnWJosae5Hbyppc3IukvXmGxFgrLM8g/jpn8ux34=;3:+m1LUMZDOdMmYAFn6FIlaob4G72rDjOw4/99Aq7Qshnnn0TbwKjDp85elni8RAqg4V39eZMpdf+XrL8nqbeaBqt5qvTyv4CptFbKJeqFURCQHx5m5U9NjXhHiUxbezOtkCqL/BwU6vz5xavVo9uGz+orfX2lFphLexi8hJE0PZXoH0wK9KlSE/zH2EfJJww+hM7UiGsBQx1vNA0YCcHRYgP7mVwCT2Gh5PGSRx/Qwxo=;25:8lwqStCuHAVJmFKt5w8kZGAX6iEEkI0G0BYF0bL8PeEVeqY2ow7hDW0PUdrtBDLLnlmjKgtim8WNmYMPRgg8EWR6cFJnUhJRK6KJF33XORe7fVtQHngk5Tcxp3sbD9oxLEU9L2Zm9eOwoeGqpvFBZpOzFlVrTf/YaQGdexuDV9F4Ggk+Difp8cmwSii8U6wOmGADwD/OfnifTsZTBN6zTGK1qhCM76yNVkDpHmRfXXZ5wHA8nbUkcBowbDEkL9GSM3/sCUwsG/iblHo8Zh3TJw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CH1PR03MB622; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(10201501046)(3002001);SRVR:CH1PR03MB622;BCL:0;PCL:0;RULEID:(400006);SRVR:CH1PR03MB622; X-Microsoft-Exchange-Diagnostics: 1;CH1PR03MB622;4:efw5Dd21zki2aKo1s8aClVXnu/CgSFmGoRyODLbtqLcg2O4RFAF/5qmdFN8WFCaQMrWh+G9rOKUe4ticYy/bwlcMheA1cztOuZ+CIYQ/hULqw7FjWTe3H4fTk4NlsymmY5yYLVazIcjfimeS6++2UyM8IdgI8tBCAmfYPYgIOjzlX1NG2rXkV9CxeTkBDQfzg8XOvthrqTY+udwa7fZ68+rKTkvs5Ws951m4ECj8iyLWFYCGyyYO15D0ALPqTesOh37XnL2nXt4jfZ9chlFTLscqYcuF0HMGqlkNwJWWkowdCDhUn8fu2RUz9OOhayeCzLPLXP+IVuDZrHPm7VvT8QT+a4RemQKCcDPuUGn76ND27iveelz8SE68U9Pug13h X-Forefront-PRVS: 0764C4A8CD X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CH1PR03MB622;23:MQH9CrUefwhxoa1cYlbTtItRYgmLaHHSW48xCY+xNs?= =?us-ascii?Q?qShFghkkJoCgm6TD/lf7vnW8zaM8FUXDQUpgxU8tnOJtnELY46felK26U8Ve?= =?us-ascii?Q?7sbvgLXS57jLl0QdSMfVbosQcxKPw8OBsAACbbDLDUT/RaqFiN6iF5XeFEyl?= =?us-ascii?Q?LFcOPmMaSNJrgv9SW2CPnwLMuQ0a+FO315P+FMGOCKIwq7WWAfpgjzEB10B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6RoWLvm8WE/gMnQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;CH1PR03MB622;5:vYfhj1R2VItnzZsVkLWdU0POMqUAmF+pZFcDfjXLR0nUC0CVAghlnfhYy4aj82gkDax82vnntR1eIktAkdUo/tt+UybaG07bFzDf3Hs09YipbN8lBBIu6ANgxS6I57pbPgPOgB4zuJGP9ZrLV0NGcXwx1fQQxpOBdZyK6oH/HI8=;24:l80Rz391U+2uXVp0C42XqMGugSNya+IH522mrYC9gn//v1R9k5Wrvx92JVOiCle0pXPNpQbGQZ3nvia3p5lOcZG+avV2BKBwCLlTgM1SKxU= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2015 16:16:30.3996 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[137.71.25.57];Helo=[nwd2mta2.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH1PR03MB622 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1152 Lines: 32 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 --- 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); -- 1.7.9.5 -- 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/