Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1617380rwd; Tue, 16 May 2023 21:40:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6GS6bLtSjZatVG7vnjm5PJ7PrFOnzzd7hsQox/ixQdYJakpT4l9jf6Leen7Qo+qAxoIXWr X-Received: by 2002:a05:6a00:15c6:b0:647:7ee8:6251 with SMTP id o6-20020a056a0015c600b006477ee86251mr37574783pfu.21.1684298434740; Tue, 16 May 2023 21:40:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684298434; cv=none; d=google.com; s=arc-20160816; b=kYjVvaCX71MEBTRo0lNLWZx/QcQL6H5gMAf3WKJq8daVf89C8+eS3odOCLyM9xaFH/ gt0fmaelCPBR2qVDYqWE2vswKhGJQzM2YQ4lvnQ3Pwiw8tArYCb0/SLN4XpWHAV0ET4N dM7muxJzXtgF7XAmPb97Lz2jDampw0TK7IBi5OJUDw6RUeclA1nr/c48hzPLlOA+UB0H nysE9ishjbjQnwUzN238XvvygFhweZ29HQ3GhMReKzcuSpVG1lx2/FMMCXwC0NRtZivJ XgekooC99/Sc58ft6vADs7zNAY5imUzFpVU1gj2B3/EflBaByl7e3weaodpOJ3Qj8yOx ssBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=jpZda0FZS0dTdXDat0KP/EouwpETMA61W1x6UloerPY=; b=PKJbsdEFwSIFr6tjWuMS6z9WIDWXhZo4xAj5WA2eT1GgpMOSBUANCL6SQR+uqwKSU8 bgiROqwizGyliQl1QP2rEAJuDV8CWiJBPK5QznMjR3Z/de9Y2MRxXfJg2SAlPGYFyOm4 oUNyrT3PwBRi2JBaDhBPzXl6DGelzjq55YrmNuUlKWgdmCtPVOYqT0otI1hLajU7oVCG 9tigfRCqt0ZvjRedjq51NQpG6WXrXgv4rgMN45flxbi21HLye96uSehryl9HQ782zyQK mFjuF9e1FFVhv4TuXwdw0+jr1qXFZMX2eEFEYthSfSx58CEVfuixUx7WEa3sLOHjqXuE dMuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="TMpI/uGH"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d70-20020a633649000000b0053070f4df43si15412392pga.450.2023.05.16.21.40.22; Tue, 16 May 2023 21:40:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="TMpI/uGH"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231912AbjEQEN4 (ORCPT + 99 others); Wed, 17 May 2023 00:13:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229509AbjEQENy (ORCPT ); Wed, 17 May 2023 00:13:54 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 972E7A0 for ; Tue, 16 May 2023 21:13:53 -0700 (PDT) Received: from [192.168.1.106] (unknown [103.86.18.166]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6165C4A9; Wed, 17 May 2023 06:13:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1684296818; bh=lyeq9xynt3Pmu7ryH7FI2XE8pDgGlxYkbKBvNQwzJOo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=TMpI/uGHr2RyPS32+DR1zOzffsRBHj+IZoAkuO4+uvMNGPAORrNmvct5wbWJXvlJh 1w+yBRuOxPrBcjGKmvav5L354ocURBAn6F6NFYaSlI4dJGNuTMqFK4Tnu3R9Aa6gWN fw4S4WlnrKvQrYuqnJrolhfbMNo/ehkaUFZzPyJY= Message-ID: Date: Wed, 17 May 2023 09:43:38 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH] staging: vchiq_arm: mark vchiq_platform_init() static Content-Language: en-US To: Arnd Bergmann , Florian Fainelli , Greg Kroah-Hartman , Stefan Wahren Cc: Arnd Bergmann , Broadcom internal kernel review list , Adrien Thierry , Phil Elwell , Peter Zijlstra , =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org References: <20230516202603.560554-1-arnd@kernel.org> From: Umang Jain In-Reply-To: <20230516202603.560554-1-arnd@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi On 5/17/23 1:55 AM, Arnd Bergmann wrote: > From: Arnd Bergmann > > This function has no callers from other files, and the declaration > was removed a while ago, causing a W=1 warning: > > drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:465:5: error: no previous prototype for 'vchiq_platform_init' > > Marking it static solves this problem but introduces a new warning > since gcc determines that 'g_fragments_base' is never initialized > in some kernel configurations: > > In file included from include/linux/string.h:254, > from include/linux/bitmap.h:11, > from include/linux/cpumask.h:12, > from include/linux/mm_types_task.h:14, > from include/linux/mm_types.h:5, > from include/linux/buildid.h:5, > from include/linux/module.h:14, > from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:8: > In function 'memcpy_to_page', > inlined from 'free_pagelist' at drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:433:4: > include/linux/fortify-string.h:57:33: error: argument 2 null where non-null expected [-Werror=nonnull] > include/linux/highmem.h:427:9: note: in expansion of macro 'memcpy' > 427 | memcpy(to + offset, from, len); > | ^~~~~~ > > Add a NULL pointer check for this in addition to the static annotation > to avoid both. > > Fixes: 89cc4218f640 ("staging: vchiq_arm: drop unnecessary declarations") > Signed-off-by: Arnd Bergmann Reviewed-by: Umang Jain > --- > drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > index 90a3958d1f29..aa2313f3bcab 100644 > --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > @@ -415,7 +415,7 @@ free_pagelist(struct vchiq_instance *instance, struct vchiq_pagelist_info *pagel > pagelistinfo->scatterlist_mapped = 0; > > /* Deal with any partial cache lines (fragments) */ > - if (pagelist->type >= PAGELIST_READ_WITH_FRAGMENTS) { > + if (pagelist->type >= PAGELIST_READ_WITH_FRAGMENTS && g_fragments_base) { > char *fragments = g_fragments_base + > (pagelist->type - PAGELIST_READ_WITH_FRAGMENTS) * > g_fragments_size; > @@ -462,7 +462,7 @@ free_pagelist(struct vchiq_instance *instance, struct vchiq_pagelist_info *pagel > cleanup_pagelistinfo(instance, pagelistinfo); > } > > -int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state) > +static int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state) > { > struct device *dev = &pdev->dev; > struct vchiq_drvdata *drvdata = platform_get_drvdata(pdev);