Message ID | 20240215171740.14550-5-fancer.lancer@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-67389-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp549027dyb; Thu, 15 Feb 2024 09:18:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUOOLqhye/mOya4+/VeEtdn+AEDPSWNMPZ/08s/hnysVkTRuIpp6lsKdG+LppOGMs/esTRoOT7pIb/uSxZYW0QoMNmt5A== X-Google-Smtp-Source: AGHT+IH9uHPrUmztpJ+ATwDq/XvKTBvcXQx33Orkw5b6L7uU2k7zszZa7gYLjyTxOtlA4wKZahOa X-Received: by 2002:a17:902:c946:b0:1db:28b4:4475 with SMTP id i6-20020a170902c94600b001db28b44475mr3181349pla.9.1708017538877; Thu, 15 Feb 2024 09:18:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708017538; cv=pass; d=google.com; s=arc-20160816; b=vA26Mz0KrmfKFmJIZjRa+bI+lDD+sLDeOtTyLChJn5bZjbjEelhbeTHcHKNZeMt0v/ 0MwaiIBy5lxBIztLpXY+57MFPGlHx7dDCwbh/Vk1Z+KoOpTc95cyUfs9aM3IJ2jcjlp7 I7vL9VVRBIMu6lLLPSbzFIPaaIJWLWiZdfp0XubipdXWfq1/vnxlu1BcP4TLQZZq5RZt Gn5yLttv0uc1xcy2DYrleMrT8cHMQN06HBaf8F53+59OTzTCXXY6KpJEUslHj2pzGRM1 OFXdpFBAEafNfDoiaxdwo1jB8iiVY4hjaG4casL4XLvLydcPjkUTxnwc4W+UPfFZI93r XMRg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=MBvrFBfn8f9ygHbETBGRtk4r0X8Ogb6B9wjwrJRvRzk=; fh=KeDEcR0uCKyMID/ceMPmCX3eqSUU5CAcV593AB5Enog=; b=gxhWO/PWMNtq5WEXAEMHQU8CJzlyXqgauZEiZXWpt8iXvycnjRCZ3KCxp3+QS8IjCm AcrCamOVkxnQAgkx0IohZnMQLxlC1kec8kAL3fxovj7W2PlYDAxwntOh9J2VK901VEcl UCOyXIvmKWUzfhtCQBDl0+PkezzHAlPY5r9LssDdLxtze35Ib9MK/dadZ9BdyBe+Vwsu g9eWIXprlW/rmkfXEytBunyLS0M5+bhPKIbdqVTfNl0E6a94mRMBvEeWDY83Gw4xYgEv +q/5NdFA4mOtZr5gLlxtG+/UK0C1ekJOsk8G5Z37/FYEJGUnGT1lEcXRXANq+Uk/gXpz BPfQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LZNZQkbr; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-67389-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67389-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u16-20020a170903125000b001db2d82e7f1si1457643plh.137.2024.02.15.09.18.58 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 09:18:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67389-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LZNZQkbr; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-67389-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67389-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B202128BA4E for <ouuuleilei@gmail.com>; Thu, 15 Feb 2024 17:18:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1E11E136982; Thu, 15 Feb 2024 17:18:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LZNZQkbr" Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8DC313848E; Thu, 15 Feb 2024 17:17:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708017481; cv=none; b=R4RDpq9oeIL5AS0fP1OWVU+XdGIBHVkwQYUdbcrpUBPnljjpdj3RTF1bDfO8LdwnBTS3f3ULi5VD7pV9giB/b3Jnwx9uibDiT322G99OGKkRYyzQyddet/pR5V/QBxZAc5UIFhuvz+anULRuhKWLYWu/IyOtg1zmQe/OnPcsz/s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708017481; c=relaxed/simple; bh=3niBVDG2P9zo7HyZa3mOAK6Iv/Wd2/y/+iNeqLtGf9g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ivDIErb8YQMIe+Er1oR/riwRQKgtyEvcXehuWHWUswGhMDtIb3HM1BztJSZayAEKafBLV1B54WirmZAna+jtyenImyqA3BIBaBVQY+bCfkdV/jC9QtCTL956wSnbUOuJohYREz2oPHTO9biYZTIYqO6Oh91Xan0PrXPz/nwwR60= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=LZNZQkbr; arc=none smtp.client-ip=209.85.167.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-5118290fcd8so1323199e87.3; Thu, 15 Feb 2024 09:17:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708017478; x=1708622278; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MBvrFBfn8f9ygHbETBGRtk4r0X8Ogb6B9wjwrJRvRzk=; b=LZNZQkbrB1i8LwT1am5RTu/Ps+KnQDPOLUACX3UkrPXPD9Qu/ttnYPZ0/dWG19yJ/w HjTDNZbFevgWplS9EtKsHQ37PjX1k7AtSuSDTSWOM094K8QLei4af3ka71OGkQYNZbkU VO7UKZcETrkQ/Ez6hxJBUN4pz/9Ev6q0rj86LuZ+C+x0xwavf3zvH+L2puyg5OvlaztM 8uVeMa8GcjGKLbDqK7rftJeXWmmFJybROpMMBTn1sswVkwYgrbRmFj4iq5TosjzRS4Wa pki7SeJru/II2iyjj5tmaRb3FtGiYariu/tkQ0HpWm1yqCGw9QwlYi8kudezHPaNAH17 yHNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708017478; x=1708622278; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MBvrFBfn8f9ygHbETBGRtk4r0X8Ogb6B9wjwrJRvRzk=; b=nx0EAIZ7Psjg6+HcES9uAD6wFVNPKPKd2m138crwXDjWMZd+OWQAiHGusitSNUcvRr qMenPrbbNhNEYD0CCJrQhgfKc4lcjvrMX5dRI74iwP/K2DxHTY+ig20TFalfOZvM/0NF RGh5PE9ypYbBeVQw0pFhWGMm46ZMpauM/FpyZGG4WKnZxrcUkEtTk5bFBZ/v9sJOGDFR L1l0McOwoP2S/frEcSI9Cej1HzAxukdM2IvkvcTOY68z7S/aHnKtqXBFo4fWnKxRJoG7 EQRPEqGcAhkbR+WR6NLn6aYBrf23+UcL3KFkumRwaY1mhbLGw5ipQ0sPn8t//f5tHd7G Hmdw== X-Forwarded-Encrypted: i=1; AJvYcCVEElUU9jbDAJhGRrell0mN9W+Y00F6vmOqXxy+9s3+8z3YAZB07Fn+xAFQyZ2graeoFDe/TZvEpq9ODDq83ixs/+EV9frZsuEMLrFViIIjs/mr0qk3+8v8RQzFW5wAPKTwtKo32R3GwKj3lwQihdxyp90HMBf1c9qoOqXsrhTEufSLHtXWzQ== X-Gm-Message-State: AOJu0YxnLZbLgZ37JTAbKYYgHW7opqiVfxZu/Cje3teO0drk5maugv4u dp9vn/q9jyBFhZTFjxMiJuHMSQjbmspFDvGkQ9GiMFMz3Z9huB9X X-Received: by 2002:a05:6512:1289:b0:512:55c9:6aad with SMTP id u9-20020a056512128900b0051255c96aadmr2145079lfs.10.1708017477781; Thu, 15 Feb 2024 09:17:57 -0800 (PST) Received: from localhost ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id f4-20020ac251a4000000b00511ad5c3487sm309263lfk.276.2024.02.15.09.17.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 09:17:57 -0800 (PST) From: Serge Semin <fancer.lancer@gmail.com> To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jiri Slaby <jirislaby@kernel.org>, Arnd Bergmann <arnd@arndb.de>, Jiaxun Yang <jiaxun.yang@flygoat.com> Cc: Serge Semin <fancer.lancer@gmail.com>, Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>, Stephen Rothwell <sfr@rothwell.id.au>, Andrew Morton <akpm@linux-foundation.org>, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] tty: mips_ejtag_fdc: Fix passing incompatible pointer type warning Date: Thu, 15 Feb 2024 20:17:29 +0300 Message-ID: <20240215171740.14550-5-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240215171740.14550-1-fancer.lancer@gmail.com> References: <20240215171740.14550-1-fancer.lancer@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790986198637816319 X-GMAIL-MSGID: 1790986198637816319 |
Series |
MIPS: Fix missing proto and passing arg warnings
|
|
Commit Message
Serge Semin
Feb. 15, 2024, 5:17 p.m. UTC
mips_ejtag_fdc_encode() method expects having a first argument passed of
the "u8 **" type, meanwhile the driver passes the "const char **" type.
That causes the next build-warning:
drivers/tty/mips_ejtag_fdc.c: In function ‘mips_ejtag_fdc_console_write’:
drivers/tty/mips_ejtag_fdc.c:343:32: error: passing argument 1 of ‘mips_ejtag_fdc_encode’ from incompatible pointer type [-Werror=incompatible-pointer-types]
word = mips_ejtag_fdc_encode(&buf_ptr, &buf_len, 1);
^
drivers/tty/mips_ejtag_fdc.c:216:24: note: expected ‘const u8 ** {aka const unsigned char **}’ but argument is of type ‘const char **’
static struct fdc_word mips_ejtag_fdc_encode(const u8 **ptrs,
^~~~~~~~~~~~~~~~~~~~~
Fix it by altering the type of the pointer which is passed to the
mips_ejtag_fdc_encode() method.
Fixes: ce7cbd9a6c81 ("tty: mips_ejtag_fdc: use u8 for character pointers")
Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
---
drivers/tty/mips_ejtag_fdc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 15. 02. 24, 18:17, Serge Semin wrote: > mips_ejtag_fdc_encode() method expects having a first argument passed of > the "u8 **" type, meanwhile the driver passes the "const char **" type. > That causes the next build-warning: > > drivers/tty/mips_ejtag_fdc.c: In function ‘mips_ejtag_fdc_console_write’: > drivers/tty/mips_ejtag_fdc.c:343:32: error: passing argument 1 of ‘mips_ejtag_fdc_encode’ from incompatible pointer type [-Werror=incompatible-pointer-types] > word = mips_ejtag_fdc_encode(&buf_ptr, &buf_len, 1); > ^ > drivers/tty/mips_ejtag_fdc.c:216:24: note: expected ‘const u8 ** {aka const unsigned char **}’ but argument is of type ‘const char **’ > static struct fdc_word mips_ejtag_fdc_encode(const u8 **ptrs, > ^~~~~~~~~~~~~~~~~~~~~ It's a correct change. But why the compiler complains, given KBUILD_CFLAGS += -funsigned-char ? > Fix it by altering the type of the pointer which is passed to the > mips_ejtag_fdc_encode() method. > > Fixes: ce7cbd9a6c81 ("tty: mips_ejtag_fdc: use u8 for character pointers") > Signed-off-by: Serge Semin <fancer.lancer@gmail.com> > --- > drivers/tty/mips_ejtag_fdc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/tty/mips_ejtag_fdc.c b/drivers/tty/mips_ejtag_fdc.c > index aac80b69a069..afbf7738c7c4 100644 > --- a/drivers/tty/mips_ejtag_fdc.c > +++ b/drivers/tty/mips_ejtag_fdc.c > @@ -309,7 +309,7 @@ static void mips_ejtag_fdc_console_write(struct console *c, const char *s, > unsigned int i, buf_len, cpu; > bool done_cr = false; > char buf[4]; > - const char *buf_ptr = buf; > + const u8 *buf_ptr = buf; > /* Number of bytes of input data encoded up to each byte in buf */ > u8 inc[4]; > thanks,
On Fri, Feb 16, 2024 at 06:51:01AM +0100, Jiri Slaby wrote: > On 15. 02. 24, 18:17, Serge Semin wrote: > > mips_ejtag_fdc_encode() method expects having a first argument passed of > > the "u8 **" type, meanwhile the driver passes the "const char **" type. > > That causes the next build-warning: > > > > drivers/tty/mips_ejtag_fdc.c: In function ‘mips_ejtag_fdc_console_write’: > > drivers/tty/mips_ejtag_fdc.c:343:32: error: passing argument 1 of ‘mips_ejtag_fdc_encode’ from incompatible pointer type [-Werror=incompatible-pointer-types] > > word = mips_ejtag_fdc_encode(&buf_ptr, &buf_len, 1); > > ^ > > drivers/tty/mips_ejtag_fdc.c:216:24: note: expected ‘const u8 ** {aka const unsigned char **}’ but argument is of type ‘const char **’ > > static struct fdc_word mips_ejtag_fdc_encode(const u8 **ptrs, > > ^~~~~~~~~~~~~~~~~~~~~ > > It's a correct change. But why the compiler complains, given > KBUILD_CFLAGS += -funsigned-char > ? What a tricky question you asked.) It cost me some new gray hairs, but I guess I figured the correct answer out. First of all it turns out that "char", "signed char" and "unsigned char" are three _distant_ types. The "-funsigned-char/-fsigned-char" flag changes the signedness of the plain "char", but it doesn't make it matching to any of "signed char" or "unsigned char". Thus the flag you mentioned couldn't suppress the warning I discovered (a bit later you'll see that it is unrelated to that flag, but to the fact that the types are different). Here is a simple test-code illustrating what I said above: 1: int main(int argc, char *argv[], char *env[]) 2: { 3: char c; 4: char *cp = &c; 5: signed char sc; 6: signed char *scp1 = &c; 7: signed char *scp2 = ≻ 8: unsigned char uc; 9: unsigned char *ucp1 = &c; 10: unsigned char *ucp2 = &uc; 11: return 0; 12: } $ gcc -Wall -Wno-unused-variable -funsigned-char tmp_char.c -o tmp_char tmp_char.c: In function ‘main’: tmp_char.c:6:29: warning: pointer targets in initialization of ‘signed char *’ from ‘char *’ differ in signedness [-Wpointer-sign] 6 | signed char *scp1 = &c; | ^ tmp_char.c:9:31: warning: pointer targets in initialization of ‘unsigned char *’ from ‘char *’ differ in signedness [-Wpointer-sign] 9 | unsigned char *ucp1 = &c; | ^ $ See, a new warning (not as the one in the patch log) is printed despite of having the "-funsigned-char" flag specified. A more detailed discussion around that you can find here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28912 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=23087 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71202 The next question would be: "Why don't we see such warning printed all over the kernel then?" That's because the "-Wno-pointer-sign" warning suppressor is enabled in the kernel. It shuts up the sign-mismatching pointers cast warnings. So no warning will be printed if the test-code above is compiled as: $ gcc -Wall -Wno-unused-variable -funsigned-char -Wno-pointer-sign tmp_char.c -o tmp_char $ But why do we still see a warning as mentioned in the patch log? It turns out that the "-Wno-pointer-sign" flag only works for the _simple_ pointer signedness mismatch, but not for the multi-level pointers. So as long as there is a pointer-to-pointer or pointer-to-pointer-to-pointer, etc involved, another warning will be printed. Here is the test-code modified to re-produce the compile warning cited in the patch log: 1: int main(int argc, char *argv[], char *env[]) 2: { 3: char c; 4: char *cp = &c; 5: signed char sc; 6: signed char *scp1 = &c; 7: signed char *scp2 = ≻ 8: signed char **scpp = &cp; 9: unsigned char uc; 10: unsigned char *ucp1 = &c; 11: unsigned char *ucp2 = &uc; 12: unsigned char **ucpp = &cp; 13: return 0; 14: } $ gcc -Wall -Wno-unused-variable -funsigned-char -Wno-pointer-sign tmp_char.c -o tmp_char tmp_char.c: In function ‘main’: tmp_char.c:8:30: warning: initialization of ‘signed char **’ from incompatible pointer type ‘char **’ [-Wincompatible-pointer-types] 8 | signed char **scpp = &cp; | ^ tmp_char.c:12:32: warning: initialization of ‘unsigned char **’ from incompatible pointer type ‘char **’ [-Wincompatible-pointer-types] 12 | unsigned char **ucpp = &cp; | ^ $ See, the lines 6 and 10 don't cause any warning printed (due to the "-Wno-pointer-sign" flag), but the new lines 8 and 12 do. This is the case that simulates what was discovered in the drivers/tty/mips_ejtag_fdc.c driver and what was fixed in this patch. I don't know for sure but I guess the compiler considers the high-level pointers a bit differently than the single-level ones. So the pointers to different pointer types are considered as incompatible, which is also relevant for the char-family types since these are three distant types. Thus that's what the warning about. > > > Fix it by altering the type of the pointer which is passed to the > > mips_ejtag_fdc_encode() method. > > > > Fixes: ce7cbd9a6c81 ("tty: mips_ejtag_fdc: use u8 for character pointers") > > Signed-off-by: Serge Semin <fancer.lancer@gmail.com> > > --- > > drivers/tty/mips_ejtag_fdc.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/tty/mips_ejtag_fdc.c b/drivers/tty/mips_ejtag_fdc.c > > index aac80b69a069..afbf7738c7c4 100644 > > --- a/drivers/tty/mips_ejtag_fdc.c > > +++ b/drivers/tty/mips_ejtag_fdc.c > > @@ -309,7 +309,7 @@ static void mips_ejtag_fdc_console_write(struct console *c, const char *s, > > unsigned int i, buf_len, cpu; > > bool done_cr = false; > > char buf[4]; > > - const char *buf_ptr = buf; > > + const u8 *buf_ptr = buf; > > /* Number of bytes of input data encoded up to each byte in buf */ > > u8 inc[4]; > > thanks, Please explicitly add your tag if you are ok with the fix. -Serge(y) > -- > js > suse labs >
On Thu, Feb 15, 2024 at 08:17:29PM +0300, Serge Semin wrote: > mips_ejtag_fdc_encode() method expects having a first argument passed of > the "u8 **" type, meanwhile the driver passes the "const char **" type. > That causes the next build-warning: > > drivers/tty/mips_ejtag_fdc.c: In function ‘mips_ejtag_fdc_console_write’: > drivers/tty/mips_ejtag_fdc.c:343:32: error: passing argument 1 of ‘mips_ejtag_fdc_encode’ from incompatible pointer type [-Werror=incompatible-pointer-types] > word = mips_ejtag_fdc_encode(&buf_ptr, &buf_len, 1); > ^ > drivers/tty/mips_ejtag_fdc.c:216:24: note: expected ‘const u8 ** {aka const unsigned char **}’ but argument is of type ‘const char **’ > static struct fdc_word mips_ejtag_fdc_encode(const u8 **ptrs, > ^~~~~~~~~~~~~~~~~~~~~ > > Fix it by altering the type of the pointer which is passed to the > mips_ejtag_fdc_encode() method. > > Fixes: ce7cbd9a6c81 ("tty: mips_ejtag_fdc: use u8 for character pointers") > Signed-off-by: Serge Semin <fancer.lancer@gmail.com> > --- > drivers/tty/mips_ejtag_fdc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/tty/mips_ejtag_fdc.c b/drivers/tty/mips_ejtag_fdc.c > index aac80b69a069..afbf7738c7c4 100644 > --- a/drivers/tty/mips_ejtag_fdc.c > +++ b/drivers/tty/mips_ejtag_fdc.c > @@ -309,7 +309,7 @@ static void mips_ejtag_fdc_console_write(struct console *c, const char *s, > unsigned int i, buf_len, cpu; > bool done_cr = false; > char buf[4]; > - const char *buf_ptr = buf; > + const u8 *buf_ptr = buf; > /* Number of bytes of input data encoded up to each byte in buf */ > u8 inc[4]; applied to mips-next. Thomas.
diff --git a/drivers/tty/mips_ejtag_fdc.c b/drivers/tty/mips_ejtag_fdc.c index aac80b69a069..afbf7738c7c4 100644 --- a/drivers/tty/mips_ejtag_fdc.c +++ b/drivers/tty/mips_ejtag_fdc.c @@ -309,7 +309,7 @@ static void mips_ejtag_fdc_console_write(struct console *c, const char *s, unsigned int i, buf_len, cpu; bool done_cr = false; char buf[4]; - const char *buf_ptr = buf; + const u8 *buf_ptr = buf; /* Number of bytes of input data encoded up to each byte in buf */ u8 inc[4];