From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BD91C4363A for ; Mon, 26 Oct 2020 17:23:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CF71C22263 for ; Mon, 26 Oct 2020 17:23:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1787644AbgJZRXE (ORCPT ); Mon, 26 Oct 2020 13:23:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:33526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403954AbgJZRXE (ORCPT ); Mon, 26 Oct 2020 13:23:04 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B6FE321D7B; Mon, 26 Oct 2020 17:23:02 +0000 (UTC) Date: Mon, 26 Oct 2020 13:23:00 -0400 From: Steven Rostedt To: Arnd Bergmann Cc: Ingo Molnar , Jiri Kosina , Petr Mladek , Arnd Bergmann , Piotr Maziarz , Cezary Rojewski , linux-kernel@vger.kernel.org Subject: Re: [PATCH] seq_buf: avoid type mismatch for seq_buf_init Message-ID: <20201026132300.6b175028@gandalf.local.home> In-Reply-To: <20201026161108.3707783-1-arnd@kernel.org> References: <20201026161108.3707783-1-arnd@kernel.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 26 Oct 2020 17:10:58 +0100 Arnd Bergmann wrote: > From: Arnd Bergmann > > Building with W=2 prints a number of warnings for one function that > has a pointer type mismatch: > > linux/seq_buf.h: In function 'seq_buf_init': > linux/seq_buf.h:35:12: warning: pointer targets in assignment from 'unsigned char *' to 'char *' differ in signedness [-Wpointer-sign] I've always hated the warning about char * and unsigned char *, as they are mostly meaningless. Yes, bugs happen with int to unsigned int conversions, but this is dealing with strings, where unsigned char * and char * are basically equivalent, except when it comes to one thing, which is why I prefer unsigned char * over char *, and that is printing out the numerical values of a buffer, if they go above 177, the char * prints the negative value, but unsigned char * keeps printing what you would expect. As this is just an annoyance (extra warnings), and not really a "fix", I'll queue it up for the next merge window. -- Steve > > Change the type in the function prototype according to the type in > the structure. > > Fixes: 9a7777935c34 ("tracing: Convert seq_buf fields to be like seq_file fields") > Signed-off-by: Arnd Bergmann > ---