All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: Grant Erickson <gerickson@nuovations.com>
Cc: connman@lists.linux.dev
Subject: Re: [PATCH v4 5/9] wispr: Refactor 'wispr_portal_web_result' to leverage 'GError'.
Date: Tue, 25 Mar 2025 11:53:29 -0500	[thread overview]
Message-ID: <a4619dde-3046-4ee7-b707-755a21f2fffa@gmail.com> (raw)
In-Reply-To: <73E10B6A-822A-4950-A698-F545E93BB1DB@nuovations.com>

Hi Grant,

 >>
>> But now you have a simple return at the end of the function.  Which by the way is discouraged and should have been picked up by the compiler or static analysis.
> 
> I tried to keep the original block of logic as-is.
> 
> Personally, I’m a fan of single points of exit—so much easier to audit. But, happy to keep 

Kernel often prefers the 'exit-early' approach, but this is situational.

whatever style is preferred. It sounds like the preference is to replace the 
prior ‘goto done’ with ‘return’, correct?

Rule of thumb is not to have return at the end of a void function.  Static 
analysis will for sure flag that and I'll kick off a coverity run once I get the 
rest of your patches merged.

The question really is: Is the now-empty-done label hiding a bug?

> 
>>> + g_web_parser_end_data(wp_context->wispr_parser);
>>> +
>>> + DBG("wp_context->wispr_msg.message_type %d", wp_context->wispr_msg.message_type);
>>
>> We still use 80 character lines, so please break up accordingly.
> 
> Surprisingly, checkpatch.pl did not squawk about this. Fixed, regardless.
> 

The default is now 100 for the kernel.  We're sticking to 80 for now.  Maybe:

   --max-line-length=n        set the maximum line length, (default 100)
                              if exceeded, warn on patches
                              requires --strict for use with --file

works?

Regards,
-Denis

  reply	other threads:[~2025-03-25 16:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-25  4:59 [PATCH v4 0/9] Close Two GWeb Request "Bookend" Failure "Holes" Grant Erickson
2025-03-25  4:59 ` [PATCH v4 1/9] gweb: Adopt optional, immutable GError instance for GWeb result errors Grant Erickson
2025-03-25  4:59 ` [PATCH v4 2/9] gweb: Added and leveraged 'call_result_func_{failure,success}' wrappers Grant Erickson
2025-03-25  4:59 ` [PATCH v4 3/9] gweb: Close web request session finalization 'hole' Grant Erickson
2025-03-25  4:59 ` [PATCH v4 4/9] gweb: Add documentation to 'received_data_{finalize,continue}' Grant Erickson
2025-03-25  4:59 ` [PATCH v4 5/9] wispr: Refactor 'wispr_portal_web_result' to leverage 'GError' Grant Erickson
2025-03-25 14:28   ` Denis Kenzior
2025-03-25 16:29     ` Grant Erickson
2025-03-25 16:53       ` Denis Kenzior [this message]
2025-03-25  4:59 ` [PATCH v4 6/9] wispr: Document 'wispr_portal_web_result_failure' Grant Erickson
2025-03-25  4:59 ` [PATCH v4 7/9] wispr: Document 'wispr_portal_web_result_success' Grant Erickson
2025-03-25  4:59 ` [PATCH v4 8/9] wispr: Document 'wispr_portal_web_result' Grant Erickson
2025-03-25  4:59 ` [PATCH v4 9/9] wispr: Add an optional 'message' parameter to '__connman_wispr_cb_t' Grant Erickson
2025-03-25 15:00 ` [PATCH v4 0/9] Close Two GWeb Request "Bookend" Failure "Holes" patchwork-bot+connman

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=a4619dde-3046-4ee7-b707-755a21f2fffa@gmail.com \
    --to=denkenz@gmail.com \
    --cc=connman@lists.linux.dev \
    --cc=gerickson@nuovations.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.