From nobody Sun Oct 20 11:21:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XWbcS4mHBz5YvK0; Sun, 20 Oct 2024 11:21:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XWbcS2RNRz4WvX; Sun, 20 Oct 2024 11:21:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729423304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xt5tFJ52uuOCK3KSbRkNQXjV6i9P36POMzrIamDFJXo=; b=OjPqWChd6B2x+BEojlBe+Fpuw/C0DNcBXVx7Kcgy583ArBbiAhBiwwGhju9Epb/sYgPHc6 b2mJ33jjc7NxcHmiQIwrL5c50xThK8adYMZO0fmzJ5Nc4qGnDd3N30XICMvQdribRjIZ8B UxX1OZV/l/v2MZdm0YuICu8sxRvow1+31WtbYce2TYPOvXSeLrExfs/Ky5n5NSZ0xvU8sq tq0sWC1aWPmtOrl/jsndM58kHuoYzZKNwEFaHthcjLwU0GUvmr70EETiwiQAs0ez1xcRvA zOOXqlq9C6juOU22JDHheQTw0frVoK9yPfuOysOyoHozfejKUkV4BH3VKn7ZVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729423304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xt5tFJ52uuOCK3KSbRkNQXjV6i9P36POMzrIamDFJXo=; b=UgGEZzkUqOBx+dVV5yhWzf8Gs9CZq9YCwhsojbEWkDsucmLpMvqFsEhHVSB8+QoQwZyUG/ UGhZMaHiwVlMLhUVTRDJUqFf9M3XEuRZzIL2OkqHaYpBGg4xRK+FIV+O+hpznafJCoMVNU AgZ3w+QuVelpjBceCsHJE94314voheDg8KH0TniYifTauuBb8AnHSRfIId7jc06TtCAm7X xBKFhFkES1kLdYP9E5CHeRx0srkDZkRzORfLJIAmq9HLRO4Lx/rWPFWdi/NNJAVZrg3ohs uvIyNGvzpt3szbLg3b/YkDZ9TARvkR1xGGueD1weF7DVuTb1Id+mLwUHMG1H0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729423304; a=rsa-sha256; cv=none; b=T5qLWeXAWhluawYgT/0Zd/Oe4ff19AWTMEBM1170OYlwEDCipDoTyU67ZEZhJDSOmy3qgs xdvKCYH2wliNETHi3i5T6VYngW65uCXbfEG2iTVtTCuLHENW344LQQsEFrAbF4XOJ+F+zD zM6wlfz/jO8lnVTrOMojgK7iMbDY+/xcRFU/8OcqT3caPlOMJt51c4hT36lSSvdMYTffn7 6xst907GN0XGX2zzcZIlmPh10m60vyO4rtuhRJlVfKY/EZp9rnPtLQdz5vzuxKu3r2Drn3 AbfKIOcI00qn4Zkx13LVv1kUNtzoYILjz2aJHRdJZggSf1UfucJ5VmLL6IyEKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XWbcS1z5mz10Vp; Sun, 20 Oct 2024 11:21:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49KBLiDX063136; Sun, 20 Oct 2024 11:21:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49KBLil1063133; Sun, 20 Oct 2024 11:21:44 GMT (envelope-from git) Date: Sun, 20 Oct 2024 11:21:44 GMT Message-Id: <202410201121.49KBLil1063133@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 84f361c9e367 - stable/14 - sound: Do not cast return value of malloc(9) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 84f361c9e367d86f785f7f0f3591c9db1b3e1c55 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=84f361c9e367d86f785f7f0f3591c9db1b3e1c55 commit 84f361c9e367d86f785f7f0f3591c9db1b3e1c55 Author: Christos Margiolis AuthorDate: 2024-10-18 08:40:57 +0000 Commit: Christos Margiolis CommitDate: 2024-10-20 11:21:05 +0000 sound: Do not cast return value of malloc(9) No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, zlei, markj, emaste Differential Revision: https://reviews.freebsd.org/D46844 (cherry picked from commit 3cc01caa26e4bf0798d219b2d40429a2cc1a642a) --- sys/dev/sound/fdt/audio_soc.c | 2 +- sys/dev/sound/pci/hda/hdaa.c | 20 +++++++------------- sys/dev/sound/pci/maestro3.c | 2 +- sys/dev/sound/pci/spicds.c | 2 +- sys/dev/sound/pcm/dsp.c | 6 +++--- sys/dev/sound/pcm/sndstat.c | 2 +- 6 files changed, 14 insertions(+), 20 deletions(-) diff --git a/sys/dev/sound/fdt/audio_soc.c b/sys/dev/sound/fdt/audio_soc.c index 3e937720bb5b..92813a3079d8 100644 --- a/sys/dev/sound/fdt/audio_soc.c +++ b/sys/dev/sound/fdt/audio_soc.c @@ -367,7 +367,7 @@ audio_soc_init(void *arg) auxdev = OF_device_from_xref(aux_devs[i]); if (auxdev == NULL) device_printf(sc->dev, "warning: no driver attached to aux node\n"); - aux_node = (struct audio_soc_aux_node *)malloc(sizeof(*aux_node), M_DEVBUF, M_NOWAIT); + aux_node = malloc(sizeof(*aux_node), M_DEVBUF, M_NOWAIT); if (aux_node == NULL) { device_printf(sc->dev, "failed to allocate aux node struct\n"); return; diff --git a/sys/dev/sound/pci/hda/hdaa.c b/sys/dev/sound/pci/hda/hdaa.c index e8d9ee12fffc..c0eb1864f145 100644 --- a/sys/dev/sound/pci/hda/hdaa.c +++ b/sys/dev/sound/pci/hda/hdaa.c @@ -3033,8 +3033,7 @@ hdaa_audio_ctl_parse(struct hdaa_devinfo *devinfo) if (max < 1) return; - ctls = (struct hdaa_audio_ctl *)malloc( - sizeof(*ctls) * max, M_HDAA, M_ZERO | M_NOWAIT); + ctls = malloc(sizeof(*ctls) * max, M_HDAA, M_ZERO | M_NOWAIT); if (ctls == NULL) { /* Blekh! */ @@ -3186,8 +3185,7 @@ hdaa_audio_as_parse(struct hdaa_devinfo *devinfo) if (max < 1) return; - as = (struct hdaa_audio_as *)malloc( - sizeof(*as) * max, M_HDAA, M_ZERO | M_NOWAIT); + as = malloc(sizeof(*as) * max, M_HDAA, M_ZERO | M_NOWAIT); if (as == NULL) { /* Blekh! */ @@ -4077,8 +4075,7 @@ hdaa_audio_bind_as(struct hdaa_devinfo *devinfo) cnt += as[j].num_chans; } if (devinfo->num_chans == 0) { - devinfo->chans = (struct hdaa_chan *)malloc( - sizeof(struct hdaa_chan) * cnt, + devinfo->chans = malloc(sizeof(struct hdaa_chan) * cnt, M_HDAA, M_ZERO | M_NOWAIT); if (devinfo->chans == NULL) { device_printf(devinfo->dev, @@ -5490,10 +5487,8 @@ hdaa_prepare_pcms(struct hdaa_devinfo *devinfo) } devinfo->num_devs = max(ardev, apdev) + max(drdev, dpdev); - devinfo->devs = - (struct hdaa_pcm_devinfo *)malloc( - devinfo->num_devs * sizeof(struct hdaa_pcm_devinfo), - M_HDAA, M_ZERO | M_NOWAIT); + devinfo->devs = malloc(devinfo->num_devs * + sizeof(struct hdaa_pcm_devinfo), M_HDAA, M_ZERO | M_NOWAIT); if (devinfo->devs == NULL) { device_printf(devinfo->dev, "Unable to allocate memory for devices\n"); @@ -6625,9 +6620,8 @@ hdaa_attach(device_t dev) ); if (devinfo->nodecnt > 0) - devinfo->widget = (struct hdaa_widget *)malloc( - sizeof(*(devinfo->widget)) * devinfo->nodecnt, M_HDAA, - M_WAITOK | M_ZERO); + devinfo->widget = malloc(sizeof(*(devinfo->widget)) * + devinfo->nodecnt, M_HDAA, M_WAITOK | M_ZERO); else devinfo->widget = NULL; diff --git a/sys/dev/sound/pci/maestro3.c b/sys/dev/sound/pci/maestro3.c index 4d6dca310eea..f922aa5cec3f 100644 --- a/sys/dev/sound/pci/maestro3.c +++ b/sys/dev/sound/pci/maestro3.c @@ -1453,7 +1453,7 @@ m3_pci_attach(device_t dev) /* Create the buffer for saving the card state during suspend */ len = sizeof(u_int16_t) * (REV_B_CODE_MEMORY_LENGTH + REV_B_DATA_MEMORY_LENGTH); - sc->savemem = (u_int16_t*)malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); + sc->savemem = malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); return 0; diff --git a/sys/dev/sound/pci/spicds.c b/sys/dev/sound/pci/spicds.c index 3b67101b8df0..da0e8d9da6d5 100644 --- a/sys/dev/sound/pci/spicds.c +++ b/sys/dev/sound/pci/spicds.c @@ -144,7 +144,7 @@ spicds_create(device_t dev, void *devinfo, int num, spicds_ctrl ctrl) #if(0) device_printf(dev, "spicds_create(dev, devinfo, %d, ctrl)\n", num); #endif - codec = (struct spicds_info *)malloc(sizeof *codec, M_SPICDS, M_NOWAIT); + codec = malloc(sizeof(*codec), M_SPICDS, M_NOWAIT); if (codec == NULL) return NULL; diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index bf68f64929c3..d4f7e3d6e63f 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -2493,7 +2493,7 @@ dsp_oss_syncgroup(struct pcm_channel *wrch, struct pcm_channel *rdch, oss_syncgr * syncgroup. */ if (group->id == 0) { - sg = (struct pcmchan_syncgroup *)malloc(sizeof(*sg), M_DEVBUF, M_NOWAIT); + sg = malloc(sizeof(*sg), M_DEVBUF, M_NOWAIT); if (sg != NULL) { SLIST_INIT(&sg->members); sg->id = alloc_unr(pcmsg_unrhdr); @@ -2520,7 +2520,7 @@ dsp_oss_syncgroup(struct pcm_channel *wrch, struct pcm_channel *rdch, oss_syncgr * insert into syncgroup. */ if (group->mode & PCM_ENABLE_INPUT) { - smrd = (struct pcmchan_syncmember *)malloc(sizeof(*smrd), M_DEVBUF, M_NOWAIT); + smrd = malloc(sizeof(*smrd), M_DEVBUF, M_NOWAIT); if (smrd == NULL) { ret = ENOMEM; goto out; @@ -2536,7 +2536,7 @@ dsp_oss_syncgroup(struct pcm_channel *wrch, struct pcm_channel *rdch, oss_syncgr } if (group->mode & PCM_ENABLE_OUTPUT) { - smwr = (struct pcmchan_syncmember *)malloc(sizeof(*smwr), M_DEVBUF, M_NOWAIT); + smwr = malloc(sizeof(*smwr), M_DEVBUF, M_NOWAIT); if (smwr == NULL) { ret = ENOMEM; goto out; diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index 4c5efb72cc0a..993ca926070f 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -1109,7 +1109,7 @@ sndstat_line2userdev(struct sndstat_file *pf, const char *line, int n) if (e == NULL) goto fail; ud->nameunit = strndup(line, e - line, M_DEVBUF); - ud->devnode = (char *)malloc(e - line + 1, M_DEVBUF, M_WAITOK | M_ZERO); + ud->devnode = malloc(e - line + 1, M_DEVBUF, M_WAITOK | M_ZERO); strlcat(ud->devnode, ud->nameunit, e - line + 1); line = e + 1;