Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3862658pxb; Mon, 8 Feb 2021 01:55:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJw9v40OABFLbZvmKYV08CmP1Y+jo0BQsTw2sk34lsY0BSM6hzx3gX/9SPuA97ZGbqFwOxK7 X-Received: by 2002:a17:906:c081:: with SMTP id f1mr8344099ejz.97.1612778131372; Mon, 08 Feb 2021 01:55:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612778131; cv=none; d=google.com; s=arc-20160816; b=TJanIHmbftKDpI1cOiQ65nysFMgrXbkzSRilXpha3bj28x2oEFFhPjD1IEjhSlm0Xx PBE8AtGBYlolpduwLYTXKkGOBBBVn0A60j2n28Yh65XD9uTaklnaxCW+LtXK/ZyRZQEj 3V21c58a994epcVhdM/MVcp7ceafmm4WFKQHUaCOLxs2oxDjE4rBxzFiHxhwt00Qi6Kg Te83IMfztgBTMoA+XdGP7QmRRuh8Iu978T96GOmmhUltyeu5IwPiJyS/9aAov/fy7u4T HNU87VjntmlIaT3sqSjcp6rGfcJ0aZmG80vjIJLIfqeIoxV+Q5/9W1fUSpAlbsvLAb4P Js2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=TFMxrL29RVpgXVjucIEhmDqKlJat5xJib/NlFFiNuQo=; b=Tkbmj2wnsgYT8fmWUgLy4RQL4QpcHvHtgqzF08dB/J9U4rrnWkr2em82C2CeSilZZT yQtTZgDoLGQEW1/jw2rDU7cW96KdAsqSS8m9ZgvkJsrK7GAa4UabfGCo7WXQ0hms0C1o /Wm1QueyPJ/Qf/rcyfUb5SsuhYD+yf3WijXhxb4aD/qq2mKr1Emlzb4KiPc7dM1WuNrW mbjL1sfi0l3KfQuPygQsEc/HbM7tEiN0E+s5qLmrbhBA9PikqeP/RTR1kJSEhMnhwhRx DKTHwt/Cti476/l9Bcx/e0umh2vTiMNX9XT9EB+JiXqwRBQmTr1DkwzzWuv6TrleTTAn NWlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UndgtQlD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id li7si5137038ejb.615.2021.02.08.01.55.08; Mon, 08 Feb 2021 01:55:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UndgtQlD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232181AbhBHJyI (ORCPT + 99 others); Mon, 8 Feb 2021 04:54:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231788AbhBHJou (ORCPT ); Mon, 8 Feb 2021 04:44:50 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6381BC0617AA for ; Mon, 8 Feb 2021 01:43:08 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id f16so11950753wmq.5 for ; Mon, 08 Feb 2021 01:43:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=TFMxrL29RVpgXVjucIEhmDqKlJat5xJib/NlFFiNuQo=; b=UndgtQlDPAeKtPWb9bsNDWMRGnQrd1pAW/mMraMFTf4urQE7+5N9WeQo0fCwYR7i+d tZoR66RNIWLhQ8lyaIfVNcW5CTfOB8VboOH+CoFJS1/JnklSk/utEp1OsgF0z0KDhPig FLkVbUxS17sCoEt50/a+kIU7I1REze3wx3ug9MvtomhpwzwHyT3o3H6bupS5SuSzD3fP ZrkTyhC45v+8JvtMF19cuUeeAZhb7hBB72QIDQif9e1oZUyNWbwEG/sBDH455fNM1QL9 YP4JEHulIe/9yx1w2K9kx1nYSShn792RSPZ/czA6TaOHjEO6k4VfaEXfhressHp8Qw5C TaPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=TFMxrL29RVpgXVjucIEhmDqKlJat5xJib/NlFFiNuQo=; b=tzg8yGQvR6vKhEvLmMcic1qJBDUzmPJb8oWpC/yqp3ivtOCPee8ppeHz06KzhL/R+1 QDyT24+mghzc5cecX/J/YX9cgZ4BhkTL6E/a3aUM2S7+LNu5tG51DYfSY1QrIbHTpZLd WB7nM4Ws+sTA+gL0bGYhd/5Asb11pPMBK6w7a2Qc/pVq+UJh8OWpqZsoaSlYXaJKt0SL F8HklMCu+mNQFL2f9fWyOvLciwX2+P4/PIaXUCRMEV3rsT8kS3SfyHD1yfE3gL54QBnC To+fr3tDKU0H1Ba5AfFQRwambAsGCrvTuvUJFBZkpf2Fu5TKsV+3sG3ZHL0vOrNQCsnM iWlA== X-Gm-Message-State: AOAM530HJwxgSicsAW5Lr/Hh+n/JMJf2OndOuFKJ7CIaiDxx/ntOvH34 2VV+Goj3vV8UneSrACgc9weG3Q== X-Received: by 2002:a1c:1d8b:: with SMTP id d133mr13984489wmd.172.1612777386189; Mon, 08 Feb 2021 01:43:06 -0800 (PST) Received: from maple.lan (cpc141216-aztw34-2-0-cust174.18-1.cable.virginm.net. [80.7.220.175]) by smtp.gmail.com with ESMTPSA id s64sm21145060wms.21.2021.02.08.01.43.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Feb 2021 01:43:05 -0800 (PST) Date: Mon, 8 Feb 2021 09:43:03 +0000 From: Daniel Thompson To: Sumit Garg Cc: kgdb-bugreport@lists.sourceforge.net, jason.wessel@windriver.com, dianders@chromium.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] kdb: Simplify kdb commands registration Message-ID: <20210208094303.csu2kkyi25d7a25y@maple.lan> References: <1611915427-3196-1-git-send-email-sumit.garg@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1611915427-3196-1-git-send-email-sumit.garg@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 29, 2021 at 03:47:07PM +0530, Sumit Garg wrote: > @@ -1011,25 +1005,17 @@ int kdb_parse(const char *cmdstr) > ++argv[0]; > } > > - for_each_kdbcmd(tp, i) { > - if (tp->cmd_name) { > - /* > - * If this command is allowed to be abbreviated, > - * check to see if this is it. > - */ > - > - if (tp->cmd_minlen > - && (strlen(argv[0]) <= tp->cmd_minlen)) { > - if (strncmp(argv[0], > - tp->cmd_name, > - tp->cmd_minlen) == 0) { > - break; > - } > - } > - > - if (strcmp(argv[0], tp->cmd_name) == 0) > + list_for_each_entry(tp, &kdb_cmds_head, list_node) { > + /* > + * If this command is allowed to be abbreviated, > + * check to see if this is it. > + */ > + if (tp->cmd_minlen && (strlen(argv[0]) <= tp->cmd_minlen) && > + (strncmp(argv[0], tp->cmd_name, tp->cmd_minlen) == 0)) > break; Looks like you forgot to unindent this line. I will fix it up but... checkpatch would have found this. Daniel.