public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-kernel@vger.kernel.org, Willy Tarreau <willy@haproxy.com>,
	Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Subject: Re: [PATCH v1 6/7] auxdisplay: hd44780: Call charlcd_alloc() from hd44780_common_alloc()
Date: Fri, 7 Mar 2025 21:01:02 +0200	[thread overview]
Message-ID: <Z8tCbjJk24ryV0DJ@smile.fi.intel.com> (raw)
In-Reply-To: <CAMuHMdV1+ftjpEcg4xYjBLH1BRJHkZcYB5W+p8WUWWLXT3DnUQ@mail.gmail.com>

On Fri, Mar 07, 2025 at 07:19:57PM +0100, Geert Uytterhoeven wrote:
> On Fri, 7 Mar 2025 at 18:08, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > On Fri, Mar 07, 2025 at 10:14:48AM +0100, Geert Uytterhoeven wrote:
> > > On Mon, 24 Feb 2025 at 18:30, Andy Shevchenko
> > > <andriy.shevchenko@linux.intel.com> wrote:

...

> > > While I like the general idea, there are two things in the API I do
> > > not like:
> > >   1. The function is called "hd44780_common_alloc()", but returns
> > >      a pointer to a different struct type than the name suggests,
> > >   2. The real "struct hd44780_common" must be obtained by the caller
> > >      from charlcd.drvdata, which is of type "void *", i.e. unsafe.
> > >
> > > What about changing it to e.g.?
> > >
> > >     struct hd44780_common *hd44780_common_alloc(struct charlcd **lcd)
> > >
> > > so you can return pointers to both structs?
> >
> > I don't like this prototype as it seems and feels confusing. Also note,
> > the APIs are using struct charlcd while being in the hd44780 namespace.
> > perhaps better to rename the function to hd44780_common_and_lcd_alloc()?
> 
> That is one option.
> 
> Another option would be to add a "charlcd *lcd" member to
> struct hd44780_common.
> 
> That would allow to fix the other odd part in the API:
> 
>     -void hd44780_common_free(struct charlcd *lcd)
>     +void hd44780_common_free(struct hd4480_common *hd)

This I like better. In a separate patch I think?

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2025-03-07 19:01 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-24 17:27 [PATCH v1 0/7] auxdisplay: charlcd: Refactor memory allocation Andy Shevchenko
2025-02-24 17:27 ` [PATCH v1 1/7] auxdisplay: charlcd: Partially revert "Move hwidth and bwidth to struct hd44780_common" Andy Shevchenko
2025-03-07  9:03   ` Geert Uytterhoeven
2025-03-07 16:57     ` Andy Shevchenko
2025-03-07 18:14       ` Geert Uytterhoeven
2025-03-07 18:57         ` Andy Shevchenko
2025-03-07 19:05           ` Geert Uytterhoeven
2025-03-10  8:12             ` Andy Shevchenko
2025-03-10  9:39               ` Geert Uytterhoeven
2025-03-10 10:53                 ` Andy Shevchenko
2025-03-10 15:15                 ` Andy Shevchenko
2025-02-24 17:27 ` [PATCH v1 2/7] auxdisplay: lcd2s: Allocate memory for custom data in charlcd_alloc() Andy Shevchenko
2025-03-07  9:03   ` Geert Uytterhoeven
2025-02-24 17:27 ` [PATCH v1 3/7] auxdisplay: hd44780: Introduce hd44780_common_free() Andy Shevchenko
2025-03-07  9:04   ` Geert Uytterhoeven
2025-02-24 17:27 ` [PATCH v1 4/7] auxdisplay: hd44780: Make use of hd44780_common_free() Andy Shevchenko
2025-03-07  9:05   ` Geert Uytterhoeven
2025-03-07 17:00     ` Andy Shevchenko
2025-02-24 17:27 ` [PATCH v1 5/7] auxdisplay: panel: " Andy Shevchenko
2025-03-07  9:05   ` Geert Uytterhoeven
2025-03-07 17:02     ` Andy Shevchenko
2025-03-07 18:14       ` Geert Uytterhoeven
2025-02-24 17:27 ` [PATCH v1 6/7] auxdisplay: hd44780: Call charlcd_alloc() from hd44780_common_alloc() Andy Shevchenko
2025-03-07  9:14   ` Geert Uytterhoeven
2025-03-07 17:08     ` Andy Shevchenko
2025-03-07 18:19       ` Geert Uytterhoeven
2025-03-07 19:01         ` Andy Shevchenko [this message]
2025-03-07 19:06           ` Geert Uytterhoeven
2025-03-10  8:14             ` Andy Shevchenko
2025-02-24 17:27 ` [PATCH v1 7/7] auxdisplay: hd44780: Rename hd to hdc in hd44780_common_alloc() Andy Shevchenko
2025-03-03 10:30 ` [PATCH v1 0/7] auxdisplay: charlcd: Refactor memory allocation Andy Shevchenko
2025-03-04 14:29   ` Andy Shevchenko

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=Z8tCbjJk24ryV0DJ@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=geert@linux-m68k.org \
    --cc=ksenija.stanojevic@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=willy@haproxy.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