From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id 862412C6B for ; Fri, 13 Jan 2017 19:29:12 +0100 (CET) Received: by mail-wm0-f52.google.com with SMTP id c85so76413371wmi.1 for ; Fri, 13 Jan 2017 10:29:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=UPjtVtX2BbbcbI3I/7BKQjwWgsjRrx39Fgcm6x3AJk8=; b=QsFmnpTR4PMOXLba40vA2W/Ixf1flcQfcpYMay08yMyQZc0W+PmQNtnrVE8yF/lPI2 +giK3cti/DDi5aH6eyRgtbAWzx9JoN70dwmahLBQ4GDz9Vo9icVmkhk1xUWKHFuA5qRK vt6zuJc651FKJsiGMqQGl21EVhOd/xFdWDegfWw0+cflimEYdX6AWQ7yvxO+s0ST/LCD jKKYplIoiB0GaUSdS/jNEAwoV48J3UfaK2mSqBzcKEY7XQabZ+j4mIwp+eAI5CLc2Tzy 478HQMNJgvenv40F7Qo1kV7cZdPQM2NlZXpIO7ZL2hcdUp6JD3LF6LKmUSUa0r/0ZqF4 MtZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=UPjtVtX2BbbcbI3I/7BKQjwWgsjRrx39Fgcm6x3AJk8=; b=aFMT8i38GPkAtwn414SqGDsM7EyvmJdnZJtS9bwwwF+/+vbQQeuUHsi5XY+jB5Dp6e pt8VWU6XQXRlIVgh2YPZRZD78o2Y5dQqPB+YSEKdN75M4VekuN22IjR4dsRoAM0cJoSJ 7hWRJFSc/jdvtzSXg6z7vkfC4Z1Wy8+wvtXhBtp9AOOiEg7n9GSffGi1Ih2Ht84qDij+ D+nUuDjIgfWdXV4ruVWVEptLRM4BFC+rIWahZgzX5K6mWIDQahQZrVy4FFOLOHiFTLAo ojI6HY7t13vdizTPhMUS62Se10kC/7rOk20tCSAYDdDuTiJGzq4Q8uwtSNePpiAcIpWG 0xQQ== X-Gm-Message-State: AIkVDXITjZXLWc8WlBwTnfaBongxFbYRx3HmKUNyPE/M/neUcuZm/8iON83Gf4+crZ14TXJ4 X-Received: by 10.28.228.87 with SMTP id b84mr3320538wmh.0.1484332152089; Fri, 13 Jan 2017 10:29:12 -0800 (PST) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id w7sm5917562wmd.24.2017.01.13.10.29.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jan 2017 10:29:11 -0800 (PST) From: Thomas Monjalon To: Bruce Richardson Cc: dev@dpdk.org, Olivier Matz Date: Fri, 13 Jan 2017 19:29:09 +0100 Message-ID: <4014355.qTqRYq3TGR@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <20170113184445.7d719306@platinum> References: <1484237907-30717-1-git-send-email-bruce.richardson@intel.com> <20170113184445.7d719306@platinum> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] kvargs: make pointers in string arrays const X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 18:29:12 -0000 2017-01-13 18:44, Olivier Matz: > On Thu, 12 Jan 2017 16:18:27 +0000, Bruce Richardson > wrote: > > Change the parameters of functions from const char *valid[] to > > const char * const valid[]. This additional const is needed to > > allow us to fix some checkpatch warnings, as well as being good > > programming practice. > > > > For the checkpatch warnings, if we have a set of command line > > args that we want to check defined as: > > static const char *args[] = { "arg1", "arg2", NULL }; > > kvlist = rte_kvargs_parse(params, args); > > > > checkpatch will complain: > > WARNING:STATIC_CONST_CHAR_ARRAY: static const char * > > array should probably be static const char * const > > > > Adding the additional const to the definition of the args > > will then trigger a compiler error in the absense of this > > change to the kvargs library, as we lose the const in the > > call to kvargs_parse. > > > > Signed-off-by: Bruce Richardson > > Acked-by: Olivier Matz Applied, thanks