From nobody Tue Dec 2 02:29:50 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD20533C1AB for ; Wed, 19 Nov 2025 09:19:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763543997; cv=none; b=U5UvxraHcyF6gNT0hLLgS287L5qKUuKVrBUZOuiNZ/kOFQppRyeAy+djNDCmL9xsJ+7O0JqvnyJ/yBGtgLpZW6UyyhIru5EjAzPDqiiqOXP5UjornnB63QSfTokS3OVgywG7n5DvZPs3MERRoLjmlcvzcXWiXakewR9KK9rO2qo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763543997; c=relaxed/simple; bh=cpODIUIWg1AgyCmRKkLcGbkD30nqerqSzEX7YlYnpAQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Qyp1zHIcDRuMTL2QiIFpiRpbHqnGkrfEJKvl8Jfl8yKS9+46q950KTE+W+URjJQkgXu0Yx2UJ86iYCllmJz5U031hM3dViBgFi+RFk/iIQVOwDFaKfRGkSGC+jepJwp3Gj/BvY51SegkAng652WJ55IkR+9YVTQi0MMMEbMIQgY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UO5aRuge; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UO5aRuge" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88198C19422; Wed, 19 Nov 2025 09:19:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763543996; bh=cpODIUIWg1AgyCmRKkLcGbkD30nqerqSzEX7YlYnpAQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UO5aRugefN4AzoBE4dMaxX+LMdaJyYGKh5IyTd7PO311obykDJE3sRc3riJv+QTOl G2U2Ff1k3N5kz6PuATGrY617POOIE0TXHv8EPS1P8tT6t+fUnOEIskH+7AETUPD7vj 05mjz9JLCJP+iRkIDkCWaYqIQ1vO66cad7hU/S5pn9eWS5uX2F9oVQilv+RauhrfF1 4EhaCMcqLeoo5riax59I2v8ou0uCd5ndbCkwALfTQIu4yieBaHbcgtqlbIfFcWJaV+ +zdL7l+QrFVNzE1LQQgG7OY1XfhsVoEoufHbI3kbAUFQbr+me1OSkcXVxu7DYSfbvS tvKXjWihwATAA== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: arnd@arndb.de, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" Subject: [PATCH 2/6] char/mwave: remove MWAVE_FUTZ_WITH_OTHER_DEVICES ifdeffery Date: Wed, 19 Nov 2025 10:19:45 +0100 Message-ID: <20251119091949.825958-3-jirislaby@kernel.org> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251119091949.825958-1-jirislaby@kernel.org> References: <20251119091949.825958-1-jirislaby@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In mwave, a lot of code depends on the MWAVE_FUTZ_WITH_OTHER_DEVICES macro. That can be defined in Makefile to compile this in. 1) The code is completely unreadable. 2) Recompiling the kernel to have this untested code compiled in is not a good idea. Drop all this. Signed-off-by: Jiri Slaby (SUSE) --- drivers/char/mwave/Makefile | 3 - drivers/char/mwave/smapi.c | 108 ------------------------------------ 2 files changed, 111 deletions(-) diff --git a/drivers/char/mwave/Makefile b/drivers/char/mwave/Makefile index a24fe96e3c96..836bfa25c541 100644 --- a/drivers/char/mwave/Makefile +++ b/drivers/char/mwave/Makefile @@ -9,8 +9,5 @@ obj-$(CONFIG_MWAVE) +=3D mwave.o =20 mwave-y :=3D mwavedd.o smapi.o tp3780i.o 3780i.o =20 -# To have the mwave driver disable other uarts if necessary -# ccflags-y :=3D -DMWAVE_FUTZ_WITH_OTHER_DEVICES - # To compile in lots (~20 KiB) of run-time enablable printk()s for debuggi= ng: ccflags-y +=3D -DMW_TRACE diff --git a/drivers/char/mwave/smapi.c b/drivers/char/mwave/smapi.c index f586752ec463..5e2fe3235714 100644 --- a/drivers/char/mwave/smapi.c +++ b/drivers/char/mwave/smapi.c @@ -279,46 +279,14 @@ int smapi_set_DSP_cfg(void) if (usBX & 0x0100) { /* serial port A is present */ if (usCX & 1) { /* serial port is enabled */ if ((usSI & 0xFF) =3D=3D mwave_uart_irq) { -#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES PRINTK_ERROR(KERN_ERR_MWAVE "smapi::smapi_set_DSP_cfg: Serial port A irq %x conflicts with mwave= _uart_irq %x\n", usSI & 0xFF, mwave_uart_irq); -#else - PRINTK_3(TRACE_SMAPI, - "smapi::smapi_set_DSP_cfg: Serial port A irq %x conflicts with mwave= _uart_irq %x\n", usSI & 0xFF, mwave_uart_irq); -#endif -#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES - PRINTK_1(TRACE_SMAPI, - "smapi::smapi_set_DSP_cfg Disabling conflicting serial port\n"); - bRC =3D smapi_request(0x1403, 0x0100, 0, usSI, - &usAX, &usBX, &usCX, &usDX, &usDI, &usSI); - if (bRC) goto exit_smapi_request_error; - bRC =3D smapi_request(0x1402, 0x0000, 0, 0, - &usAX, &usBX, &usCX, &usDX, &usDI, &usSI); - if (bRC) goto exit_smapi_request_error; -#else goto exit_conflict; -#endif } else { if ((usSI >> 8) =3D=3D uartio_index) { -#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES PRINTK_ERROR(KERN_ERR_MWAVE "smapi::smapi_set_DSP_cfg: Serial port A base I/O address %x confli= cts with mwave uart I/O %x\n", ausUartBases[usSI >> 8], ausUartBases[uartio= _index]); -#else - PRINTK_3(TRACE_SMAPI, - "smapi::smapi_set_DSP_cfg: Serial port A base I/O address %x confli= cts with mwave uart I/O %x\n", ausUartBases[usSI >> 8], ausUartBases[uartio= _index]); -#endif -#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES - PRINTK_1(TRACE_SMAPI, - "smapi::smapi_set_DSP_cfg Disabling conflicting serial port A\n"); - bRC =3D smapi_request (0x1403, 0x0100, 0, usSI, - &usAX, &usBX, &usCX, &usDX, &usDI, &usSI); - if (bRC) goto exit_smapi_request_error; - bRC =3D smapi_request (0x1402, 0x0000, 0, 0, - &usAX, &usBX, &usCX, &usDX, &usDI, &usSI); - if (bRC) goto exit_smapi_request_error; -#else goto exit_conflict; -#endif } } } @@ -332,46 +300,14 @@ int smapi_set_DSP_cfg(void) if (usBX & 0x0100) { /* serial port B is present */ if (usCX & 1) { /* serial port is enabled */ if ((usSI & 0xFF) =3D=3D mwave_uart_irq) { -#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES PRINTK_ERROR(KERN_ERR_MWAVE "smapi::smapi_set_DSP_cfg: Serial port B irq %x conflicts with mwave= _uart_irq %x\n", usSI & 0xFF, mwave_uart_irq); -#else - PRINTK_3(TRACE_SMAPI, - "smapi::smapi_set_DSP_cfg: Serial port B irq %x conflicts with mwave= _uart_irq %x\n", usSI & 0xFF, mwave_uart_irq); -#endif -#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES - PRINTK_1(TRACE_SMAPI, - "smapi::smapi_set_DSP_cfg Disabling conflicting serial port B\n"); - bRC =3D smapi_request(0x1405, 0x0100, 0, usSI, - &usAX, &usBX, &usCX, &usDX, &usDI, &usSI); - if (bRC) goto exit_smapi_request_error; - bRC =3D smapi_request(0x1404, 0x0000, 0, 0, - &usAX, &usBX, &usCX, &usDX, &usDI, &usSI); - if (bRC) goto exit_smapi_request_error; -#else goto exit_conflict; -#endif } else { if ((usSI >> 8) =3D=3D uartio_index) { -#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES PRINTK_ERROR(KERN_ERR_MWAVE "smapi::smapi_set_DSP_cfg: Serial port B base I/O address %x confli= cts with mwave uart I/O %x\n", ausUartBases[usSI >> 8], ausUartBases[uartio= _index]); -#else - PRINTK_3(TRACE_SMAPI, - "smapi::smapi_set_DSP_cfg: Serial port B base I/O address %x confli= cts with mwave uart I/O %x\n", ausUartBases[usSI >> 8], ausUartBases[uartio= _index]); -#endif -#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES - PRINTK_1 (TRACE_SMAPI, - "smapi::smapi_set_DSP_cfg Disabling conflicting serial port B\n"= ); - bRC =3D smapi_request (0x1405, 0x0100, 0, usSI, - &usAX, &usBX, &usCX, &usDX, &usDI, &usSI); - if (bRC) goto exit_smapi_request_error; - bRC =3D smapi_request (0x1404, 0x0000, 0, 0, - &usAX, &usBX, &usCX, &usDX, &usDI, &usSI); - if (bRC) goto exit_smapi_request_error; -#else goto exit_conflict; -#endif } } } @@ -387,58 +323,14 @@ int smapi_set_DSP_cfg(void) /* bRC =3D=3D 0 */ if ((usCX & 0xff) !=3D 0xff) { /* IR port not disabled */ if ((usCX & 0xff) =3D=3D mwave_uart_irq) { -#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES PRINTK_ERROR(KERN_ERR_MWAVE "smapi::smapi_set_DSP_cfg: IR port irq %x conflicts with mwave_uart_i= rq %x\n", usCX & 0xff, mwave_uart_irq); -#else - PRINTK_3(TRACE_SMAPI, - "smapi::smapi_set_DSP_cfg: IR port irq %x conflicts with mwave_uart_i= rq %x\n", usCX & 0xff, mwave_uart_irq); -#endif -#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES - PRINTK_1(TRACE_SMAPI, - "smapi::smapi_set_DSP_cfg Disabling conflicting IR port\n"); - bRC =3D smapi_request(0x1701, 0x0100, 0, 0, - &usAX, &usBX, &usCX, &usDX, &usDI, &usSI); - if (bRC) goto exit_smapi_request_error; - bRC =3D smapi_request(0x1700, 0, 0, 0, - &usAX, &usBX, &usCX, &usDX, &usDI, &usSI); - if (bRC) goto exit_smapi_request_error; - bRC =3D smapi_request(0x1705, 0x01ff, 0, usSI, - &usAX, &usBX, &usCX, &usDX, &usDI, &usSI); - if (bRC) goto exit_smapi_request_error; - bRC =3D smapi_request(0x1704, 0x0000, 0, 0, - &usAX, &usBX, &usCX, &usDX, &usDI, &usSI); - if (bRC) goto exit_smapi_request_error; -#else goto exit_conflict; -#endif } else { if ((usSI & 0xff) =3D=3D uartio_index) { -#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES PRINTK_ERROR(KERN_ERR_MWAVE "smapi::smapi_set_DSP_cfg: IR port base I/O address %x conflicts wit= h mwave uart I/O %x\n", ausUartBases[usSI & 0xff], ausUartBases[uartio_inde= x]); -#else - PRINTK_3(TRACE_SMAPI, - "smapi::smapi_set_DSP_cfg: IR port base I/O address %x conflicts wit= h mwave uart I/O %x\n", ausUartBases[usSI & 0xff], ausUartBases[uartio_inde= x]); -#endif -#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES - PRINTK_1(TRACE_SMAPI, - "smapi::smapi_set_DSP_cfg Disabling conflicting IR port\n"); - bRC =3D smapi_request(0x1701, 0x0100, 0, 0, - &usAX, &usBX, &usCX, &usDX, &usDI, &usSI); - if (bRC) goto exit_smapi_request_error; - bRC =3D smapi_request(0x1700, 0, 0, 0, - &usAX, &usBX, &usCX, &usDX, &usDI, &usSI); - if (bRC) goto exit_smapi_request_error; - bRC =3D smapi_request(0x1705, 0x01ff, 0, usSI, - &usAX, &usBX, &usCX, &usDX, &usDI, &usSI); - if (bRC) goto exit_smapi_request_error; - bRC =3D smapi_request(0x1704, 0x0000, 0, 0, - &usAX, &usBX, &usCX, &usDX, &usDI, &usSI); - if (bRC) goto exit_smapi_request_error; -#else goto exit_conflict; -#endif } } } --=20 2.51.1