From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757059AbbE2TGI (ORCPT ); Fri, 29 May 2015 15:06:08 -0400 Received: from mail.skyhub.de ([78.46.96.112]:40570 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755347AbbE2TF6 (ORCPT ); Fri, 29 May 2015 15:05:58 -0400 Date: Fri, 29 May 2015 21:05:42 +0200 From: Borislav Petkov To: Aravind Gopalakrishnan Cc: dougthompson@xmission.com, mchehab@osg.samsung.com, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/6] edac, mce_amd_inj: Modify flags attrigute to use string arguments Message-ID: <20150529190542.GQ31435@pd.tnic> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5568ADEF.6080907@amd.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. I'd leave the NULL array terminator. > 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. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. --