linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gaston Gonzalez <gascoar@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-staging@lists.linux.dev, gregkh@linuxfoundation.org,
	nsaenz@kernel.org, stefan.wahren@i2se.com, ojaswin98@gmail.com,
	linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	bcm-kernel-feedback-list@broadcom.com,
	linux-kernel@vger.kernel.org, gascoar@gmail.com
Subject: Re: [PATCH 2/2] staging: vchiq_arm: add prototype of function vchiq_platform_init()
Date: Fri, 4 Mar 2022 16:30:15 -0300	[thread overview]
Message-ID: <20220304193015.wgofp34efl2loplj@debian-BULLSEYE-live-builder-AMD64> (raw)
In-Reply-To: <20220303122546.GH2794@kadam>

On Thu, Mar 03, 2022 at 03:25:47PM +0300, Dan Carpenter wrote:
> On Wed, Mar 02, 2022 at 06:36:38PM -0300, Gaston Gonzalez wrote:
> > Fix "no previous prototype" W=1 warning by adding the prototype of the
> > function vchiq_platform_init().
> > 
> > Note: vchiq_platform_init() is only called once in vchiq_probe(), so
> > presumably should be static function. However, making the function
> > static breaks the build.
> > 
> 
> That's weird.  I don't have an ARM cross compile set up.  How does the
> build break?
> 
> regards,
> dan carpenter
>

Hi Dan,

Test building the driver in x86 I get the error pasted below.

However, now that you mention it, I made an ARM (64 bit) cross
compilation: making the function static builds OK without the warning.
I'll to do the same for a 32 bit setup.

So I suppose that making the function static is the right approach ?

FWIW, branch and cross-compiler:

- Remote: https://github.com/raspberrypi/linux.git
- Branch: rpi-5.17.y
- gcc: aarch64-linux-gnu-gcc (Debian 10.2.1-6) 10.2.1 20210110


-> x86 build error:

CC [M]  drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.o
In function ‘free_pagelist’,
    inlined from ‘vchiq_complete_bulk’ at drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:650:3:
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:434:4: error: argument 2 null where non-null expected [-Werror=nonnull]
  434 |    memcpy((char *)kmap(pages[0]) +
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  435 |     pagelist->offset,
      |     ~~~~~~~~~~~~~~~~~
  436 |     fragments,
      |     ~~~~~~~~~~
  437 |     head_bytes);
      |     ~~~~~~~~~~~
In file included from ./arch/x86/include/asm/string.h:5,
                 from ./include/linux/string.h:20,
                 from ./include/linux/bitmap.h:11,
                 from ./include/linux/cpumask.h:12,
                 from ./arch/x86/include/asm/cpumask.h:5,
                 from ./arch/x86/include/asm/msr.h:11,
                 from ./arch/x86/include/asm/processor.h:22,
                 from ./arch/x86/include/asm/timex.h:5,
                 from ./include/linux/timex.h:65,
                 from ./include/linux/time32.h:13,
                 from ./include/linux/time.h:60,
                 from ./include/linux/stat.h:19,
                 from ./include/linux/module.h:13,
                 from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:8:
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c: In function ‘vchiq_complete_bulk’:
./arch/x86/include/asm/string_64.h:14:14: note: in a call to function ‘memcpy’ declared here
   14 | extern void *memcpy(void *to, const void *from, size_t len);
      |              ^~~~~~
cc1: all warnings being treated as errors
make[1]: *** [scripts/Makefile.build:288: drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.o] Error 1
make: *** [Makefile:1831: drivers/staging/vc04_services] Error 2

regards,

Gaston

  reply	other threads:[~2022-03-04 20:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-02 21:36 [PATCH 0/2] staging: vc04_services: address W=1 warnings Gaston Gonzalez
2022-03-02 21:36 ` [PATCH 1/2] staging: vchiq_arm: make vchiq_platform_get_arm_state() static Gaston Gonzalez
2022-03-02 21:36 ` [PATCH 2/2] staging: vchiq_arm: add prototype of function vchiq_platform_init() Gaston Gonzalez
2022-03-03 12:25   ` Dan Carpenter
2022-03-04 19:30     ` Gaston Gonzalez [this message]
2022-03-07  7:45       ` Dan Carpenter
2022-03-14 15:05   ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220304193015.wgofp34efl2loplj@debian-BULLSEYE-live-builder-AMD64 \
    --to=gascoar@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=nsaenz@kernel.org \
    --cc=ojaswin98@gmail.com \
    --cc=stefan.wahren@i2se.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).