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 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 299CAC43331 for ; Thu, 26 Mar 2020 10:59:02 +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 CC8B62070A for ; Thu, 26 Mar 2020 10:59:00 +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="uS5GLIQ/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC8B62070A 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 1jHQDK-0001wh-Nt; Thu, 26 Mar 2020 06:58:18 -0400 Received: from mail-il1-x135.google.com ([2607:f8b0:4864:20::135]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) (envelope-from ) id 1jHQDI-0001wb-5D for kernelnewbies@kernelnewbies.org; Thu, 26 Mar 2020 06:58:16 -0400 Received: by mail-il1-x135.google.com with SMTP id j69so4861893ila.11 for ; Thu, 26 Mar 2020 03:58:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gKWQH2enInULpEElQqbpDSAoMnevFHrvJ0VUnPAZedM=; b=uS5GLIQ/LJWaJI8mgkt+JYWI+iwL3VTA1/QYxLEKMAx2TAraNSL01teuqhEfWiN4Vq JN2Ha7ZBt8JjX2wBBygiH4qABdcwYC2SVdWCgU0aZiYxwaaxFigBRkZQcxKWXLcddecj gloB4RFgMwAoBI6/F0e4qe5aRxaTQqwWkfA46YPpvxIAC6sj1Zi77LiK6xsANVM4PhJS HwzTGf5yDYli1dMqtk0evVU58LOusHi5e74JSV//GmKkoVnLO1lZZh0lhl/OLXKhUuwp 279PG8SwyTYk34NOXo8KsJDVODekaR9Me2JQWxZo81fmmkwjnXmjtMkmsB0gcVfyDkUs w0QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gKWQH2enInULpEElQqbpDSAoMnevFHrvJ0VUnPAZedM=; b=iHhK3q0J3/5qpaGG2b4o2YEkU/BRH2nsK2Tew1TsLlsQjce/MK35mtUe4+ma9nkXsD xBQuAQEvtgSPREk/7q8/ewuTzVgUesd+p7ih3k5wiQsp71Gx5tMkIFZy8ucbdgSRCaoL joP+9grWy3ez8z0FIm2aQT9DdHyAar27Us28mB1sxJoiZZ0NarzzOHin1GHzFX7Q4ZRi rPWXe5ODMei+ywG8ZMXe2YZ8n0jADl6bHEhOQs1u5WiprUiOVl8pJKwPizYrqcqK9z/O Kq+SeypN4L6VSr57dQTnapE/EgL12PJTBuHv2IWSkK/kA+Ir5lOZBaHFLy+gzftivGeg IKcw== X-Gm-Message-State: ANhLgQ3N7r57rsjbccVPJhPwASJ7SCZBo2TFnoIy1DG6mcPWHKt7H4Ff TCrxCZeEFfCM3qNSleYQaAzIoOwLoaar0+qckRQ= X-Google-Smtp-Source: ADFU+vs0ABgh2WrC6q3+HlvefyPe0GRwFxEahO4rW0QIZvXRERquvRbcMlc3xHvpZyD8tHA9lbJtuJvsV2t37+tVNBU= X-Received: by 2002:a92:83ca:: with SMTP id p71mr7373274ilk.278.1585220232219; Thu, 26 Mar 2020 03:57:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Anuz Pratap Singh Tomar Date: Thu, 26 Mar 2020 10:57:01 +0000 Message-ID: Subject: Re: linux kernel coding style and checkpatch.pl script To: Tomek The Messenger Cc: kernelnewbies 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="===============8637652349454604902==" Errors-To: kernelnewbies-bounces@kernelnewbies.org --===============8637652349454604902== Content-Type: multipart/alternative; boundary="000000000000d5122a05a1bfd8c1" --000000000000d5122a05a1bfd8c1 Content-Type: text/plain; charset="UTF-8" On Wed, Mar 25, 2020 at 9:38 AM Tomek The Messenger < tomekthemessenger@gmail.com> wrote: > 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. > > you can put the whole string on next line and/or use "\" for splitting long string. 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. > _______________________________________________ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > -- Thank you Warm Regards Anuz --000000000000d5122a05a1bfd8c1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Mar 25, 2020 at 9:38 AM Tomek= The Messenger <tomekthem= essenger@gmail.com> wrote:
Hi
There is checkpatch.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: qu= oted 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, &q= uot;registration not done, driver is 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 "registered\n");

If I don't split line I will have another warning that 80 charact= ers is exceeded.

you can put th= e whole string on next line and/or use "\" for splitting long str= ing.

For sure I can ignore warnings about:
WARNING: struct =C2=A0should 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.
_______________________________________________
Kernelnewbies mailing list
Kernel= newbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailma= n/listinfo/kernelnewbies


--
Thank you
Warm Regards
Anuz
--000000000000d5122a05a1bfd8c1-- --===============8637652349454604902== 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 --===============8637652349454604902==--