From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034371AbcIVStM (ORCPT ); Thu, 22 Sep 2016 14:49:12 -0400 Received: from smtprelay0198.hostedemail.com ([216.40.44.198]:57766 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1030464AbcIVStI (ORCPT ); Thu, 22 Sep 2016 14:49:08 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 30,2,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::,RULES_HIT:41:355:379:541:599:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2734:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3872:3873:4321:5007:7903:10004:10400:10848:11026:11232:11657:11658:11914:12043:12048:12295:12296:12740:12760:13069:13255:13311:13357:13439:13523:13524:14659:14721:21080:21433:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: door63_152ca475e3146 X-Filterd-Recvd-Size: 2082 Message-ID: <1474570144.8253.19.camel@perches.com> Subject: Re: [PATCH 14/14] GPU-DRM-TTM: Mark an array of text strings as "const" in ttm_dma_pool_init() From: Joe Perches To: SF Markus Elfring , dri-devel@lists.freedesktop.org, Daniel Vetter , David Airlie , Emil Velikov Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall Date: Thu, 22 Sep 2016 11:49:04 -0700 In-Reply-To: <9bb7cfe3-c230-93b5-01b8-697ad8f67843@users.sourceforge.net> References: <566ABCD9.1060404@users.sourceforge.net> <4d34446f-05ad-c3ce-5d33-8fb4f25af25c@users.sourceforge.net> <9bb7cfe3-c230-93b5-01b8-697ad8f67843@users.sourceforge.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.21.91-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2016-09-22 at 19:46 +0200, SF Markus Elfring wrote: > The local variable "n" was not modified after it was initialized with > a few text strings. > Thus express this detail also by the data type qualifier "const". [] > diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c [] > @@ -574,7 +574,7 @@ static int ttm_dma_pool_match(struct device *dev, void *res, void *match_data) > static struct dma_pool *ttm_dma_pool_init(struct device *dev, gfp_t flags, > enum pool_type type) > { > - char *n[] = {"wc", "uc", "cached", " dma32", "unknown",}; > + char const * const n[] = {"wc", "uc", "cached", " dma32", "unknown",}; > enum pool_type t[] = {IS_WC, IS_UC, IS_CACHED, IS_DMA32, IS_UNDEFINED}; Please think a little deeper about what you are changing here and look at the line immediately below it too. Both should be static const to avoid unnecessary reload.