From patchwork Mon Jun 22 14:48:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 11618059 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2091013A0 for ; Mon, 22 Jun 2020 14:49:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E15D42071A for ; Mon, 22 Jun 2020 14:49:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E15D42071A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EA95E6B0002; Mon, 22 Jun 2020 10:49:08 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E590C6B0003; Mon, 22 Jun 2020 10:49:08 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D6F206B0005; Mon, 22 Jun 2020 10:49:08 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0056.hostedemail.com [216.40.44.56]) by kanga.kvack.org (Postfix) with ESMTP id BD6C36B0002 for ; Mon, 22 Jun 2020 10:49:08 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 51D9D180ACC68 for ; Mon, 22 Jun 2020 14:49:08 +0000 (UTC) X-FDA: 76957130376.12.crime32_280c73826e33 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id 69FC01801F1EB for ; Mon, 22 Jun 2020 14:49:06 +0000 (UTC) X-Spam-Summary: 2,0,0,b1f2d3e01fcaf12c,d41d8cd98f00b204,colin.king@canonical.com,,RULES_HIT:41:152:355:379:541:800:960:968:973:988:989:1260:1261:1277:1311:1313:1314:1345:1437:1515:1516:1518:1534:1540:1593:1594:1711:1714:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3351:3865:3866:3867:3868:3871:4250:4321:5007:6261:7576:10004:10400:11026:11658:11914:12048:12297:12438:12517:12519:12555:12679:12895:13069:13311:13357:13894:14096:14097:14181:14394:14721:21080:21451:21627:21990:30029:30054:30070,0,RBL:91.189.89.112:@canonical.com:.lbl8.mailshell.net-64.201.201.201 62.8.15.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: crime32_280c73826e33 X-Filterd-Recvd-Size: 1945 Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Mon, 22 Jun 2020 14:49:05 +0000 (UTC) Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jnNkg-00080Q-Se; Mon, 22 Jun 2020 14:48:50 +0000 From: Colin King To: Andrew Morton , Barry Song , Stephen Rothwell , Mike Kravetz , Roman Gushchin , linux-mm@kvack.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] mm: cma: remove redundant null check of the array cma->name Date: Mon, 22 Jun 2020 15:48:50 +0100 Message-Id: <20200622144850.45952-1-colin.king@canonical.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Rspamd-Queue-Id: 69FC01801F1EB X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Colin Ian King An earlier commit changed name from a pointer to an array so the cma->name null check is now redundant and can be removed. Addresses-Coverity: ("Array compared against 0") Fixes: e7f0557d7de9 ("mm: cma: fix the name of CMA areas") Signed-off-by: Colin Ian King --- mm/cma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/cma.c b/mm/cma.c index 31a61d410c59..6cf08817bac6 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -52,7 +52,7 @@ unsigned long cma_get_size(const struct cma *cma) const char *cma_get_name(const struct cma *cma) { - return cma->name ? cma->name : "(undefined)"; + return cma->name; } static unsigned long cma_bitmap_aligned_mask(const struct cma *cma,