From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: ** X-Spam-Status: No, score=2.5 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 994BAC43331 for ; Wed, 25 Mar 2020 09:38:12 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5246420714 for ; Wed, 25 Mar 2020 09:38:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Z6mFjV7y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5246420714 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92.3) (envelope-from ) id 1jH2TU-0004GI-5R; Wed, 25 Mar 2020 05:37:24 -0400 Received: from mail-vs1-xe2a.google.com ([2607:f8b0:4864:20::e2a]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) (envelope-from ) id 1jH2TR-0004GC-Fm for kernelnewbies@kernelnewbies.org; Wed, 25 Mar 2020 05:37:21 -0400 Received: by mail-vs1-xe2a.google.com with SMTP id x206so1076108vsx.5 for ; Wed, 25 Mar 2020 02:37:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=VG65awO+xsz1z2RPIDvbspEyE+L/X6PhDJuWuwzAt7M=; b=Z6mFjV7ydP8GOdBGqCSZLGxNln8Q6OcOlk9O6LG5JpVTlPnHzFMyqIRCLUNlAO+jfs B28SZIzSka3d22VrL+sTtOLEx0ey4xDsk6pT5v8f8I8Ikd6KJWS95wih9oqWYySTtZEL XTccCAfnfmMg4h3/g5zc17UbRfDgfRubWwHJEtdjIOztU31zM9ludcJCop4B5DXNNOtP htFfS/TL1hqGDL0/WHYUSs2L5oJ2s27h+luwpq1/tobntf6Qb1iFCQp5B6i7qG+h6OV0 Qxo7gabiQDj1mBUfESKSiw+PdEG505AkqL4VD9eK5XJXBqAhBVdxAAM9plQbuiV7mT5/ YowQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=VG65awO+xsz1z2RPIDvbspEyE+L/X6PhDJuWuwzAt7M=; b=N3NzzUMxOgbvg5paf8hrbemLKiFxU068Fg/py9TdJiYww6xK8FQSS+WGt3NVZkBcwP Ru8Fku1yC5kQBMXkYFP8Zi2xBI+GZmivmMUnYToWHL8XhMdCBBL0wDgJtstIjcAYUEnm eRFv9e46RJ7+srrImreU+mJQZyJ9Fgp2CM4jGQXYHrLZWLuRHwGLvrDXFKG8Hag983ZA ZKkSiWrIsZ0qRea4DSCIFnrjtIXwVN8CecCC4xAz1YHn+5n2dnEqtPYVb7pSyeAKUqRT iJixtg90LpZ3igaPa9smACt4ghe6ohG88LxuNaVjiYbQ8ZrbJJz+0F0oc9ixVlBU/dGh MKKw== X-Gm-Message-State: ANhLgQ1T6ErbEBXaZfYljMVPMGayQ6fkLc0etuINAac9SdfZOb/V/niP Hoxl1fQMHI3QIYMot37vqAYNc2wlZvDq4lISKTe8H7MZ X-Google-Smtp-Source: ADFU+vv9q8fgzxOxQ9Zb2SEw6coR1gaqpQbRx+LALmKVkTn4id8OhcPEtyXZSdJqvaK51WfQCkuDZFKuEKt41zkxkSQ= X-Received: by 2002:a67:4c5:: with SMTP id 188mr1669028vse.43.1585128979293; Wed, 25 Mar 2020 02:36:19 -0700 (PDT) MIME-Version: 1.0 From: Tomek The Messenger Date: Wed, 25 Mar 2020 10:36:08 +0100 Message-ID: Subject: linux kernel coding style and checkpatch.pl script To: kernelnewbies@kernelnewbies.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============0474879459560827674==" Errors-To: kernelnewbies-bounces@kernelnewbies.org --===============0474879459560827674== Content-Type: multipart/alternative; boundary="000000000000bbe8b705a1aa993a" --000000000000bbe8b705a1aa993a Content-Type: text/plain; charset="UTF-8" Hi There is checkpatch.pl script where You can check if You wrote code in your kernel module according to linux kernel style. However can I ignore warning message? WARNING: quoted string split across lines #974: FILE: fpgax67-core.c:974: + dev_err(&pdev->dev, "registration not done, driver is already " + "registered\n"); If I don't split line I will have another warning that 80 characters is exceeded. For sure I can ignore warnings about: WARNING: struct should normally be const #998: FILE: fpgax67-core.c :998: +int fpgax67_unregister(struct platform_device *pdev) For sure all errors must be fixed like: const char* tmp -> change to -> const char *tmp; if( => if ( #insert space Generally I don't know how much warnings should I correct. If it is mandatory or only good practise and I can omit some if it doesn't make sense. --000000000000bbe8b705a1aa993a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi
There is checkpatc= h.pl script where You can check if You wrote code in your kernel module= according to linux kernel style.=C2=A0
However can I ignore=C2= =A0warning message?
WARNING: quoted string split across lines
= #974: FILE: fpgax67-core.c:974:
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 dev_err(&pdev->dev, "registration not done, driver i= s already "
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "regist= ered\n");

If I don't split line I wil= l have another warning that 80 characters is exceeded.

=
For sure I can ignore warnings about:
WARNING: struct =C2=A0= should normally be const
#998: FILE:=20 fpgax67-core.c :998:
+int=20 fpgax67_unregister(struct platform_device *pdev)

For sure all errors must be fixed like:
const char* tmp -> = change to -> const char *tmp;
if(=C2=A0 =3D> if (=C2=A0 =C2= =A0#insert space

Generally I don't know how mu= ch warnings should I correct. If it is mandatory or only good practise and = I can omit some if it doesn't make sense.
--000000000000bbe8b705a1aa993a-- --===============0474879459560827674== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============0474879459560827674==--