From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756945AbbE2TNA (ORCPT ); Fri, 29 May 2015 15:13:00 -0400 Received: from mail-bl2on0147.outbound.protection.outlook.com ([65.55.169.147]:19264 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756343AbbE2TMw (ORCPT ); Fri, 29 May 2015 15:12:52 -0400 Authentication-Results: spf=none (sender IP is 165.204.84.222) smtp.mailfrom=amd.com; alien8.de; dkim=none (message not signed) header.d=none; X-WSS-ID: 0NP4LD8-08-BGM-02 X-M-MSG: Message-ID: <5568BA2F.4040706@amd.com> Date: Fri, 29 May 2015 14:12:47 -0500 From: Aravind Gopalakrishnan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Borislav Petkov CC: , , , Subject: Re: [PATCH 3/6] edac, mce_amd_inj: Modify flags attrigute to use string arguments References: <1432753418-2985-1-git-send-email-Aravind.Gopalakrishnan@amd.com> <1432753418-2985-4-git-send-email-Aravind.Gopalakrishnan@amd.com> <20150529134943.GF31435@pd.tnic> <5568ADEF.6080907@amd.com> <20150529190542.GQ31435@pd.tnic> In-Reply-To: <20150529190542.GQ31435@pd.tnic> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.180.168.240] X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD052;1:LbSr5tPI58p1vs+5THlItbMYnsL/hRAtJ4/v5RNIHlnAivkj6/DFMSb8QWgRM0ddVyBKVzSVfR7WddfyRHsixAI4V2xFJnLmJQqSivjeunQgwfbvIAujMrMZaU6FkbE2e5khVK0yGdt3baWYHk4Wl5KPQG4gDL0XbwnC/yJMjd5dKjepKBqb6UL8dpI2n4nMynlwr53wi+39lNJubmsrBfeE3XQ0bc6vf1gDu6S8YBQwDAl3sBzON2vAuNOkhJCGk248lA2rQFlEktXfPovOUA== X-Forefront-Antispam-Report: CIP:165.204.84.222;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(428002)(199003)(377454003)(479174004)(51704005)(189002)(164054003)(24454002)(97736004)(76176999)(87266999)(80316001)(92566002)(4001350100001)(46102003)(110136002)(50986999)(105586002)(65816999)(83506001)(65956001)(54356999)(77096005)(59896002)(101416001)(93886004)(64706001)(86362001)(68736005)(2950100001)(23676002)(4001540100001)(189998001)(33656002)(87936001)(62966003)(65806001)(120886001)(47776003)(106466001)(36756003)(77156002)(5001830100001)(50466002)(64126003)(5001860100001);DIR:OUT;SFP:1102;SCL:1;SRVR:BN3PR02MB1111;H:atltwp02.amd.com;FPR:;SPF:None;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR02MB1111; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(520003)(5005006)(3002001);SRVR:BN3PR02MB1111;BCL:0;PCL:0;RULEID:;SRVR:BN3PR02MB1111; X-Forefront-PRVS: 059185FE08 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2015 19:12:49.0567 (UTC) X-MS-Exchange-CrossTenant-Id: fde4dada-be84-483f-92cc-e026cbee8e96 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fde4dada-be84-483f-92cc-e026cbee8e96;Ip=[165.204.84.222];Helo=[atltwp02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR02MB1111 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/29/2015 2:05 PM, Borislav Petkov wrote: > On Fri, May 29, 2015 at 01:20:31PM -0500, Aravind Gopalakrishnan wrote: >> Hmm. That should work. Will simplify it in the next version. >> I think I had a NULL in flags_options[] to denote the invalid option. > Still a good thing to have it as a terminator. But the loop I proposed > doesn't even touch it: i < N_INJ_TYPES. Which was exactly why I was thinking of removing it. But.. > I'd leave the NULL array > terminator. .. OK. Shall retain. >> Shall I make err = -EINVAL by default and return that here if the >> condition is not satisfied? > We have to make sure to not be overeager to error out - this'll make > using this facility a bit more cumbersome. > > So I think your approach was correct to trim it to MAX_FLAG_OPT_SIZE. > __set_inj() will catch any string mismatches anyway. > OK then, Will retain the original method, and move the 'ret = cnt' assignment after this check. (Forgot to ack that in earlier reply) Thanks, -Aravind.