Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751603AbdCRMPw (ORCPT ); Sat, 18 Mar 2017 08:15:52 -0400 Received: from mail.gw90.de ([188.40.100.199]:51084 "EHLO mail.gw90.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751025AbdCRMPv (ORCPT ); Sat, 18 Mar 2017 08:15:51 -0400 Message-ID: <1489839338.9183.68.camel@users.sourceforge.net> Subject: checkpatch: Question regarding asmlinkage and storage class From: Paul Menzel To: Andy Whitcroft , Joe Perches Cc: linux-kernel@vger.kernel.org, coreboot@coreboot.org Date: Sat, 18 Mar 2017 13:15:38 +0100 Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-YxiguMxOYdVPMvp/wig9" X-Mailer: Evolution 3.22.6-1 Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2225 Lines: 79 --=-YxiguMxOYdVPMvp/wig9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dear checkpatch developers, The coreboot project started using checkpatch.pl, and now some effort is going into fixing issues pointed out by `checkpatch.pl`. The file `src/arch/x86/acpi_s3.c` in coreboot contains the code below. ``` =C2=A0=C2=A0=C2=A0205 void (*acpi_do_wakeup)(uintptr_t vector, u32 backup_s= ource, u32 backup_target, =C2=A0=C2=A0=C2=A0206 u32 backup_size) asmlinkage =3D (void *)WAKEUP_BASE; ``` The warning is > WARNING: storage class should be at the beginning of the declaration which raised the question below [2]. > And I am waiting for someone to answer why checkpatch.pl claims > asmlinkage as a storage-class in the first place. In coreboot the macro is defined similarly to Linux. ``` #define asmlinkage __attribute__((regparm(0))) #define alwaysinline inline __attribute__((always_inline)) ``` In Linux, commit 9c0ca6f9=C2=A0(update checkpatch.pl to version 0.10) seems to have introduced the check. The commit message contains =E2=80=9Casmlinka= ge is also a storage type=E2=80=9D. Furthermore, `checkpatch.pl` doesn=E2=80=99t seem to warn about the code be= low. ``` void __attribute__((weak)) mainboard_suspend_resume(void) ``` This raises the question below. > It appears coreboot proper mostly followed this placement for > function attributes before. It would be nice if we were consistent, > specially if checkpatch starts to complaint about these. Is there another reason, besides not having that implemented? I am looking forward to your answers. Kind regards, Paul [1] https://review.coreboot.org/#/c/18865/1/src/arch/x86/acpi_s3.c@205 [2] https://review.coreboot.org/18865/ [3] https://review.coreboot.org/#/c/18865/1/src/arch/x86/acpi_s3.c@244 --=-YxiguMxOYdVPMvp/wig9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQQ8+w9d414FAVARIpk9fVorbA4dWAUCWM0k6gAKCRA9fVorbA4d WH44AJ93ZdOYLt7p+8lPZdh92gXHezls2ACeL9aIoc1eGVJFwIw9wC18Oxk1rUk= =D9gC -----END PGP SIGNATURE----- --=-YxiguMxOYdVPMvp/wig9--