From: Philipp Hortmann <philipp.g.hortmann@gmail.com>
To: Christopher Carbone <chris.m.carbone@gmail.com>,
sudipm.mukherjee@gmail.com, teddy.wang@siliconmotion.com,
gregkh@linuxfoundation.org, linux-fbdev@vger.kernel.org,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Split multiple assignments to individual lines.
Date: Mon, 22 Aug 2022 20:05:57 +0200 [thread overview]
Message-ID: <434d644b-2688-c3e8-814e-b9b2f2b86f85@gmail.com> (raw)
In-Reply-To: <YwOjt+ZrQkKFGRH9@valhalla>
On 8/22/22 17:41, Christopher Carbone wrote:
> Adhere to Linux kernel coding style.
>
> Reported by checkpatch:
>
> CHECK: multiple assignments should be avoided
>
> Signed-off-by: Christopher Carbone <chris.m.carbone@gmail.com>
> ---
> drivers/staging/sm750fb/sm750.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index dbd1159a2ef0..a0f8ae359248 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -386,7 +386,8 @@ static int lynxfb_ops_set_par(struct fb_info *info)
>
> ret = lynxfb_set_color_offsets(info);
>
> - var->height = var->width = -1;
> + var->width = -1;
> + var->height = var->width;
> var->accel_flags = 0;/*FB_ACCELF_TEXT;*/
>
> if (ret) {
> @@ -498,7 +499,8 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var,
> return ret;
> }
>
> - var->height = var->width = -1;
> + var->width = -1;
> + var->height = var->width;
> var->accel_flags = 0;/* FB_ACCELF_TEXT; */
>
> /* check if current fb's video memory big enough to hold the onscreen*/
> @@ -723,7 +725,8 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
> 0x800f0 + (int)crtc->channel * 0x140;
>
> pr_info("crtc->cursor.mmio = %p\n", crtc->cursor.mmio);
> - crtc->cursor.max_h = crtc->cursor.max_w = 64;
> + crtc->cursor.max_w = 64;
> + crtc->cursor.max_h = crtc->cursor.max_w;
> crtc->cursor.size = crtc->cursor.max_h * crtc->cursor.max_w * 2 / 8;
> crtc->cursor.vstart = sm750_dev->pvMem + crtc->cursor.offset;
>
> @@ -1027,7 +1030,8 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
> if (!sm750_dev)
> return err;
>
> - sm750_dev->fbinfo[0] = sm750_dev->fbinfo[1] = NULL;
> + sm750_dev->fbinfo[1] = NULL;
> + sm750_dev->fbinfo[0] = sm750_dev->fbinfo[1];
> sm750_dev->devid = pdev->device;
> sm750_dev->revid = pdev->revision;
> sm750_dev->pdev = pdev;
Hi,
the subsystem and the device is missing in the Subject.
I propose you look into https://kernelnewbies.org/FirstKernelPatch to
read about the Subject.
I personally prefer more this:
> + sm750_dev->fbinfo[1] = NULL;
> + sm750_dev->fbinfo[0] = NULL;
That gives a better overview.
Thanks for your support.
Bye Philipp
next prev parent reply other threads:[~2022-08-22 18:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-22 15:41 [PATCH] Split multiple assignments to individual lines Christopher Carbone
2022-08-22 18:05 ` Philipp Hortmann [this message]
2022-08-23 8:41 ` Dan Carpenter
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=434d644b-2688-c3e8-814e-b9b2f2b86f85@gmail.com \
--to=philipp.g.hortmann@gmail.com \
--cc=chris.m.carbone@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=sudipm.mukherjee@gmail.com \
--cc=teddy.wang@siliconmotion.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).