Received: by 2002:a05:6520:2f93:b029:af:d4db:7a05 with SMTP id 19csp2374306lkf; Fri, 5 Feb 2021 11:27:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJxOSKwjapKW7qt5IyG4WkObPU08dO48/w74sZhBDu2nOGklACeoh7Qy+OdKftfyZICjrmIz X-Received: by 2002:a05:6402:149:: with SMTP id s9mr5043793edu.247.1612553257454; Fri, 05 Feb 2021 11:27:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612553257; cv=none; d=google.com; s=arc-20160816; b=cpOMtmse1gyhoE5WKYtuH35OJw8SVllouRnuCyTkZ+qbF2VhsbYmlwO0e9jiv6i8I+ cGjJPVoqXHqtsvgdBBZurRLED8JlBgc0wELyGaOTYzj+tvL0P2TQVWgOHF8YlvoZMc4Q DG8RZczP1wjsbfrXpC9Fpnvdzv8YKmMdMufo27bwr/XBs0K9wNZUTd13i3cGod/cYOeU wxG3EaFppYtQXGlWTdrFdI2W1mz1phHJPIayVsLXvfiVP3hPUfktssy3rE7rjIk7yGTp 9Dey+4oT2uQ8Jl0dYE/ITWRBx+6D6VJ1VtPQIiucaM0LDyLWuqER2RrMO2KVIHXQGNa6 jLXQ== 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=EzButGrSaMS3tpn14dm5oBUBI4ta0YCz3Bh4qddD9Gs=; b=j7dpxBjkSNbilejasLZC415joxQRSiFXkOKM4aUbFlamfVoqVxlIUbIc8THaIMhPSv 2kk1L/mHKPtbJXZ7bw30Mm1K1eKgWD1Rt/DRNUFl6S2vp8wa1vNwDI7wl/lDtl4ZO7Eq UEdzt/FObyGONBf+EjILRy1I5Ef6tf/muPKXYgfciPpDtdd2Mm11p15ew+gIqHV6S2xi tFfrAMGMG7+CTnmRza6G0GKQH2Pzg+sU1axAk7OSKnoCOumLFuagLHMP87idSKeZ+2xA jjRrn9S3Twtdu6a7KbSlxyMevHb6uVA3Ul0cVM3qH8CKSusuKMnMWgYIPAhHzJN+Xu30 fwlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UIK8+EM7; 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 qx24si5744965ejb.494.2021.02.05.11.27.13; Fri, 05 Feb 2021 11:27:37 -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=UIK8+EM7; 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 S233411AbhBERno (ORCPT + 99 others); Fri, 5 Feb 2021 12:43:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233409AbhBEPzd (ORCPT ); Fri, 5 Feb 2021 10:55:33 -0500 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6883C0617AB for ; Fri, 5 Feb 2021 09:36:33 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id u14so8609218wri.3 for ; Fri, 05 Feb 2021 09:36:33 -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=EzButGrSaMS3tpn14dm5oBUBI4ta0YCz3Bh4qddD9Gs=; b=UIK8+EM7LIY0MJuZ/VuN3u1aXuD+m68zxN0voPQhmWdmcQKRLSzO3rHZWCZiLj+ifr Jg+RyoW/1DpUwU5kx6JLYzyX3eliXyKZeYcDZ2pMZJ3N3OSje6Rajxnrash+2Xh1GoV8 WxxgiOWtLAkRrb42yugwZtFKJ65MX2NLlqdQwWcXoi/yV6aL+AmRm9aNzfMftOTbG0ni ZklrDpDKg7tWySyLqyBmvEh8ZyD4P5UNK/hkicJFbPtmW3mwWlZTnqZM+xSPPcCNXwNb 9Y2gRGB1o9P7XOuHECT7uyNXXDBpdx/sGpaBDoD55H4SKWwYj8oafTVLPF97J4qcP8jc tRJQ== 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=EzButGrSaMS3tpn14dm5oBUBI4ta0YCz3Bh4qddD9Gs=; b=XAYXPhEP7aBbjC2UDC7GLbeixBoBKxzFFyxvMnGuy6mbClzva9Gqafgabt3/O3y0WP 3CnfGIdqcGrX3dLrQXyu9NR8Zjjmzz4mSpN7MD8SGzmrT2jhkWaRcTSNoa6V6w+U8wXi ytvrPaS7YN3a1gaOEMRDOwDN3g2PF3fxuPuZDtd32AZZAYhnjuLIPMAbRddl27pOprGH vQqwzlAOO/Z003I6moVm278Yuj4G2SgSZdorUcLHkDrvCtTUWGJH3TV45m09sr5NyEbq 2kO0oOR1TsVj74rFkLPFLOgcKc/+VVJnGrYPNR45VnGAJ/g6RLhxaNquaSACA4U+LaY9 lAFQ== X-Gm-Message-State: AOAM530fvp8bvwVTkvkgUpmGYN9kxrhfqtuqewDv1Tc3kZC7gVZ1WpoM +95mSO/t0okLXnAsJznQo66S4Q== X-Received: by 2002:adf:b749:: with SMTP id n9mr6100347wre.267.1612546592701; Fri, 05 Feb 2021 09:36:32 -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 r17sm12875145wro.46.2021.02.05.09.36.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 09:36:29 -0800 (PST) Date: Fri, 5 Feb 2021 17:36:27 +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 v2] kdb: Refactor env variables get/set code Message-ID: <20210205173627.guzsj4lfczimvp6d@maple.lan> References: <1612433660-32661-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: <1612433660-32661-1-git-send-email-sumit.garg@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 04, 2021 at 03:44:20PM +0530, Sumit Garg wrote: > @@ -318,6 +318,65 @@ int kdbgetintenv(const char *match, int *value) > } > > /* > + * kdb_setenv() - Alter an existing environment variable or create a new one. > + * @var: Name of the variable > + * @val: Value of the variable > + * > + * Return: Zero on success, a kdb diagnostic on failure. > + */ > +static int kdb_setenv(const char *var, const char *val) > +{ > + int i; > + char *ep; > + size_t varlen, vallen; > + > + varlen = strlen(var); > + vallen = strlen(val); > + ep = kdballocenv(varlen + vallen + 2); > + if (ep == (char *)0) > + return KDB_ENVBUFFULL; > + > + sprintf(ep, "%s=%s", var, val); > + > + ep[varlen+vallen+1] = '\0'; What is this line for? It looks pointless to me. I know it's copied from the original code but it doesn't look like the sort of code you should want your name to appear next to in a git blame ;-) . Daniel.