All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Enrico Weigelt, metux IT consult" <info@metux.net>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 11/16] use XNFcallocarray() instead of xnfcalloc macro
Date: Sat, 22 Mar 2025 00:08:55 +0200	[thread overview]
Message-ID: <Z93jdzK4Y3yCxwiO@intel.com> (raw)
In-Reply-To: <20250304155809.30399-12-info@metux.net>

On Tue, Mar 04, 2025 at 04:58:04PM +0100, Enrico Weigelt, metux IT consult wrote:
> xnfcalloc is just an alias for XNFcallocarray() that doesn't seem to serve
> any practical purpose, so it can go away once all drivers stopped using it.
> 
> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
> ---
>  src/legacy/i810/i810_driver.c | 4 ++--
>  src/legacy/i810/i810_xaa.c    | 4 ++--
>  src/uxa/intel_driver.c        | 2 +-
>  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/src/legacy/i810/i810_driver.c b/src/legacy/i810/i810_driver.c
> index 778b1a41..e24d3f8b 100644
> --- a/src/legacy/i810/i810_driver.c
> +++ b/src/legacy/i810/i810_driver.c
> @@ -155,7 +155,7 @@ I810GetRec(ScrnInfoPtr scrn)
>     if (((uintptr_t)scrn->driverPrivate & 3) == 0)
>        return TRUE;
> 
> -   scrn->driverPrivate = xnfcalloc(sizeof(I810Rec), 1);
> +   scrn->driverPrivate = XNFcallocarray(sizeof(I810Rec), 1);

Hmm. These have transposed arguments as well. I just fixed the 
normal calloc()s because the compiler was unhappy:

commit fc07603ee033 ("Fix transposed calloc() arguments")

>     return TRUE;
>  }
> 
> @@ -503,7 +503,7 @@ I810PreInit(ScrnInfoPtr scrn, int flags)
>  	 pI810->MaxClock = 86000;
>        }
>     }
> -   clockRanges = xnfcalloc(sizeof(ClockRange), 1);
> +   clockRanges = XNFcallocarray(sizeof(ClockRange), 1);
>     clockRanges->next = NULL;
>     /* 9.4MHz appears to be the smallest that works. */
>     clockRanges->minClock = 9500;
> diff --git a/src/legacy/i810/i810_xaa.c b/src/legacy/i810/i810_xaa.c
> index ea03441b..1e0a8527 100644
> --- a/src/legacy/i810/i810_xaa.c
> +++ b/src/legacy/i810/i810_xaa.c
> @@ -284,7 +284,7 @@ I810AccelInit(ScreenPtr pScreen)
> 
>        pI810->NumScanlineColorExpandBuffers = nr_buffers;
>        pI810->ScanlineColorExpandBuffers = (unsigned char **)
> -	    xnfcalloc(nr_buffers, sizeof(unsigned char *));
> +	    XNFcallocarray(nr_buffers, sizeof(unsigned char *));
> 
>        for (i = 0; i < nr_buffers; i++, ptr += width)
>  	 pI810->ScanlineColorExpandBuffers[i] = ptr;
> @@ -295,7 +295,7 @@ I810AccelInit(ScreenPtr pScreen)
>  							  | 0);
> 
>        infoPtr->ScanlineColorExpandBuffers = (unsigned char **)
> -	    xnfcalloc(1, sizeof(unsigned char *));
> +	    XNFcallocarray(1, sizeof(unsigned char *));
>        infoPtr->NumScanlineColorExpandBuffers = 1;
> 
>        infoPtr->ScanlineColorExpandBuffers[0] =
> diff --git a/src/uxa/intel_driver.c b/src/uxa/intel_driver.c
> index 79105b89..24783492 100644
> --- a/src/uxa/intel_driver.c
> +++ b/src/uxa/intel_driver.c
> @@ -460,7 +460,7 @@ static Bool I830PreInit(ScrnInfoPtr scrn, int flags)
>  		return TRUE;
> 
>  	if (((uintptr_t)scrn->driverPrivate) & 3) {
> -		intel = xnfcalloc(sizeof(*intel), 1);
> +		intel = XNFcallocarray(sizeof(*intel), 1);
>  		if (intel == NULL)
>  			return FALSE;
> 
> --
> 2.39.5

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2025-03-21 22:08 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250304155809.30399-1-info@metux.net>
2025-03-04 15:57 ` [PATCH 01/16] meson.build: fix missing Xv dependencies Enrico Weigelt, metux IT consult
2025-03-21 21:56   ` Ville Syrjälä
2025-03-04 15:57 ` [PATCH 02/16] sna: stop using obsolete type aliases Enrico Weigelt, metux IT consult
2025-03-21 21:57   ` Ville Syrjälä
2025-04-09 14:44     ` Enrico Weigelt, metux IT consult
2025-03-04 15:57 ` [PATCH 03/16] tools: fix FTBS on FreeBSD Enrico Weigelt, metux IT consult
2025-03-04 15:57 ` [PATCH 04/16] backlight: use system() instead of System() Enrico Weigelt, metux IT consult
2025-03-21 22:49   ` Ville Syrjälä
2025-03-04 15:57 ` [PATCH 05/16] sna: use GCPtr instead of GC * Enrico Weigelt, metux IT consult
2025-03-21 22:05   ` Ville Syrjälä
2025-04-09 14:48     ` Enrico Weigelt, metux IT consult
2025-03-04 15:57 ` [PATCH 06/16] gitlab CI: common scripts for driver builds Enrico Weigelt, metux IT consult
2025-03-04 15:58 ` [PATCH 07/16] gitlab CI: add pipeline for building against various Xserver releases Enrico Weigelt, metux IT consult
2025-03-04 15:58 ` [PATCH 08/16] stop using obsolete xf86BlockSIGIO() and xf86UnblockSIGIO() Enrico Weigelt, metux IT consult
2025-03-21 22:07   ` Ville Syrjälä
2025-03-04 15:58 ` [PATCH 09/16] uxa: stop calling deprecated xf86_reload_cursors() Enrico Weigelt, metux IT consult
2025-03-21 22:49   ` Ville Syrjälä
2025-03-04 15:58 ` [PATCH 10/16] use XNFalloc() instead of xnfalloc Enrico Weigelt, metux IT consult
2025-03-04 15:58 ` [PATCH 11/16] use XNFcallocarray() instead of xnfcalloc macro Enrico Weigelt, metux IT consult
2025-03-21 22:08   ` Ville Syrjälä [this message]
2025-03-04 15:58 ` [PATCH 12/16] sna: use xserver's bswap_32() Enrico Weigelt, metux IT consult
2025-03-04 15:58 ` [PATCH 13/16] meson.build: increase required version Enrico Weigelt, metux IT consult
2025-03-21 22:13   ` Ville Syrjälä
2025-03-04 15:58 ` [PATCH 14/16] Define __container_of only if not defined yet Enrico Weigelt, metux IT consult
2025-03-21 22:19   ` Ville Syrjälä
2025-03-04 15:58 ` [PATCH 15/16] use dixDestroyPixmap() instead of direct driver call Enrico Weigelt, metux IT consult
2025-03-04 15:58 ` [PATCH 16/16] use xf86NameCmp() instead of xf86nameCompare() Enrico Weigelt, metux IT consult
2025-03-04 18:35 ` ✗ LGCI.VerificationFailed: failure for series starting with [01/16] meson.build: fix missing Xv dependencies Patchwork

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=Z93jdzK4Y3yCxwiO@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=info@metux.net \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.