mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Ayush Tiwari <ayushtiw0110@gmail.com>
Cc: Larry.Finger@lwfinger.net, florian.c.schilhabel@googlemail.com,
	gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	linux-staging@lists.linux.dev, outreachy@lists.linux.dev
Subject: Re: [PATCH] staging: rtl8712: aggregate conditional statements
Date: Mon, 18 Mar 2024 10:46:42 +0300	[thread overview]
Message-ID: <1e45558d-2a89-4cb7-a855-2682b54bbf12@moroto.mountain> (raw)
In-Reply-To: <ZfcxGebTKxVUJONY@ayush-HP-Pavilion-Gaming-Laptop-15-ec0xxx>

On Sun, Mar 17, 2024 at 11:36:17PM +0530, Ayush Tiwari wrote:
> Aggregate the two conditional statements into one conditional
> statement to reduce code length and simplify the code structure.
> 
> Signed-off-by: Ayush Tiwari <ayushtiw0110@gmail.com>

I'm not a fan of this sort of thing.  The new code is fine but the
original code was fine.  If you were going to be taking over the
maintainership of the rtl8712 driver, then you could do whatever you
want.  But if you're just sending drive by patches, then it's just leave
the original code as is.  You might be right.  But it's not worth
debating or even thinking about for more than a second or two.

Someone was complaining about my code recently where I tend to break
things up into separate if statements and they were like "You could
combine them all on one line", and I'm like, "Yeah.  It was that way to
begin with but I was fixing some issues and I deliberately separated it
out for readability."  So that's one life hack which that if you don't
like someone's code style, just find some mistakes and re-write it.

regards,
dan carpenter


      reply	other threads:[~2024-03-18  7:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-17 18:06 Ayush Tiwari
2024-03-18  7:46 ` Dan Carpenter [this message]

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=1e45558d-2a89-4cb7-a855-2682b54bbf12@moroto.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=Larry.Finger@lwfinger.net \
    --cc=ayushtiw0110@gmail.com \
    --cc=florian.c.schilhabel@googlemail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=outreachy@lists.linux.dev \
    /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

all inboxes | Powered by JetHome®