Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3143699pxb; Sat, 6 Feb 2021 22:37:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJzk0UwPutgba97dDbGQjQZH8Fsy5dc8fzVGAaToj+2rBxGsewErvylArU6g3MUblKLHS2gT X-Received: by 2002:aa7:c716:: with SMTP id i22mr8228601edq.266.1612679875064; Sat, 06 Feb 2021 22:37:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612679875; cv=none; d=google.com; s=arc-20160816; b=jxFdm6Gxon3AKbHTHAfRTLGUI9yOkq5wdF4sObcBKZ0g8MEdVMlpRgLiWsN9gZAw6w pfwZEW5+tIMRhe5P3AMqQcvB0/Sr3C3NmI9cITIWJoE1daXK4rqytWB3RY8lVHSGY9sM e9FAEi29CH+gK6o/ujQTcxEO7xuxRGw1ZfZuQHd8WTj3tgHlJUzD85x2Ztj9Aq6i7D7X YnZs9yG8kFaZZKP2NvZ2gsVs9nUydMMZXvieZHNEVdV6H6ghYupj8VkOrDyAQ2E929am UwWLRkzjrcQpumtmPqPb9xqOupR2F0Kp58FwPefm1Kp1qwZzu8NK9F9CrHjdw66L1Oae ZQWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=ZPFVzifXig2kZz6v2xuq6Ogee9NAGV2n/it6kSAfNB8=; b=ci3c6bcfDnBYaCe4iXkvgApp+FDAYJvfpaazFyafDv4TafZEb5ykX/EoPkyTziD8gF GLX2XEk/LZbjlFch06sPGvz00GOcG0s8B4gh3qk9HNlYPkDgltKG0IbeXhI9Pi4uT5CP iE24ChE4wXt4ZhTenpiDU7DAcd0mzmi1MnNKWYpv7/QTDOXer//m2bLtX3Iaabwb2SDG QG1gBETPdQEU4g0dPaIVAj1ms/SSmoUbSRa+tu6vqPXmqN3t06XBBFLhfjt6xSEGrzM5 HdCL6eNB2GOXtBzt/EBZOuR1YurBnXJj7l1fe418RBdEA4AQdfHHt5Q/tKUaTc5H1Pv+ jC6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canb.auug.org.au header.s=201702 header.b=tyeLaujk; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hp10si8553075ejc.168.2021.02.06.22.37.01; Sat, 06 Feb 2021 22:37:55 -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=@canb.auug.org.au header.s=201702 header.b=tyeLaujk; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229561AbhBGGfa (ORCPT + 99 others); Sun, 7 Feb 2021 01:35:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbhBGGf3 (ORCPT ); Sun, 7 Feb 2021 01:35:29 -0500 Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F7FCC06174A for ; Sat, 6 Feb 2021 22:34:48 -0800 (PST) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4DYKBr1zhHz9sVF; Sun, 7 Feb 2021 17:34:44 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=canb.auug.org.au; s=201702; t=1612679685; bh=bpQveLnpCX/LNAs86JjxKwiHHv0Svm2bvTC0YEw3Wto=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=tyeLaujk/FYKEzkPpmotleIQVxdKhwoqTMo+WuJt2D5i0Wv9YfI9jiuY2fk2Fz1Vm pQ1mD1JRuAWCZC913yM4mpWZ6/1t/W2PE6IE1r18K9pf8LoE1TIQ6kES94o0HFkk0p QXF9Z66issAmayQ8KaQm6wxV7H4nSFUG2shm0wTJ1WZh7UFq7uxPzldd4aWWEoHwWg fFT7sIUtbXiiZ5cYzYlNvj1EiaoxZrXDJJk58ws8Emc4a97je+c5Pj64vCAtcmFSvg +r3YrF1sUN8qSkHk6kOUzWb3g2i5mNTE4x+CuEe5t95FWRkXX9WEFQy6V4Iut5jOsJ x2ayIAl8sWvrQ== Date: Sun, 7 Feb 2021 17:34:41 +1100 From: Stephen Rothwell To: Kumar Kartikeya Dwivedi Cc: devel@driverdev.osuosl.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: emxx_udc: Fix incorrectly defined global Message-ID: <20210207173441.2902acac@canb.auug.org.au> In-Reply-To: <20210207000030.256592-1-memxor@gmail.com> References: <20210207000030.256592-1-memxor@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/EFly7mjZir32_rG.96/uofl"; protocol="application/pgp-signature"; micalg=pgp-sha256 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Sig_/EFly7mjZir32_rG.96/uofl Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Kumar, On Sun, 7 Feb 2021 05:30:31 +0530 Kumar Kartikeya Dwivedi wrote: > > The global gpio_desc pointer and int were defined in the header, > instead put the definitions in the translation unit and add an extern > declaration for consumers of the header (currently only one, which is > perhaps why the linker didn't complain about symbol collisions). >=20 > This fixes sparse related warnings for this driver: > drivers/staging/emxx_udc/emxx_udc.c: note: in included file: > drivers/staging/emxx_udc/emxx_udc.h:23:18: warning: symbol 'vbus_gpio' wa= s not declared. Should it be static? > drivers/staging/emxx_udc/emxx_udc.h:24:5: warning: symbol 'vbus_irq' was = not declared. Should it be static? >=20 > Signed-off-by: Kumar Kartikeya Dwivedi Given that drivers/staging/emxx_udc/emxx_udc.h is only included by drivers/staging/emxx_udc/emxx_udc.c, shouldn't these variables just be declared static in emxx_udc.c and removed from emxx_udc.h? > --- > drivers/staging/emxx_udc/emxx_udc.c | 3 +++ > drivers/staging/emxx_udc/emxx_udc.h | 4 ++-- > 2 files changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_u= dc/emxx_udc.c > index a30b4f5b1..6983c3e31 100644 > --- a/drivers/staging/emxx_udc/emxx_udc.c > +++ b/drivers/staging/emxx_udc/emxx_udc.c > @@ -34,6 +34,9 @@ > #define DRIVER_DESC "EMXX UDC driver" > #define DMA_ADDR_INVALID (~(dma_addr_t)0) > =20 > +struct gpio_desc *vbus_gpio; > +int vbus_irq; > + > static const char driver_name[] =3D "emxx_udc"; > static const char driver_desc[] =3D DRIVER_DESC; > =20 > diff --git a/drivers/staging/emxx_udc/emxx_udc.h b/drivers/staging/emxx_u= dc/emxx_udc.h > index bca614d69..b3c4ccbe5 100644 > --- a/drivers/staging/emxx_udc/emxx_udc.h > +++ b/drivers/staging/emxx_udc/emxx_udc.h > @@ -20,8 +20,8 @@ > /* below hacked up for staging integration */ > #define GPIO_VBUS 0 /* GPIO_P153 on KZM9D */ > #define INT_VBUS 0 /* IRQ for GPIO_P153 */ > -struct gpio_desc *vbus_gpio; > -int vbus_irq; > +extern struct gpio_desc *vbus_gpio; > +extern int vbus_irq; > =20 > /*------------ Board dependence(Wait) */ > =20 > --=20 > 2.29.2 >=20 --=20 Cheers, Stephen Rothwell --Sig_/EFly7mjZir32_rG.96/uofl Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEENIC96giZ81tWdLgKAVBC80lX0GwFAmAfigEACgkQAVBC80lX 0GzVdAf/ZuxHC/+djnJBoVnV7z59At9u7Ao6hlXOy+Omihl76+GejLqgXsUDFyAy 04/F3n6OWtDkiMZPG49RD+njyHOO2SwqHX1ENT5c+QGNS2nTFQktmZl3oNENXwzZ HDWho0eZZllZocQL9gqbyzSO5gFlfSOM92uyhRfGonZ34KKiPKSLo7xwG0bUFpdV arQ2ILJf4a4YHubchu8DV0e8Q7L/ji3wDZOEyu8QukCSSWo2M+yoar8gUGaFmDc5 KnHIKnhmMrP6ySYHLQHzKF4GfytLeWCZGHsPcLECpJmYxFkv6hPaTUAKo7XFW9g7 BNjJv3E6K8HoRsOpESAeOdok2KK39Q== =fhfA -----END PGP SIGNATURE----- --Sig_/EFly7mjZir32_rG.96/uofl--