Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: Simon Horman <horms@verge.net.au>
Cc: kexec@lists.infradead.org
Subject: Re: [PATCH 1/4] uImage: cleanup some warnings
Date: Wed, 25 Nov 2015 12:32:24 -0500	[thread overview]
Message-ID: <20151125173224.GA3581@hawk.localdomain> (raw)
In-Reply-To: <20151124070026.GC2632@verge.net.au>

On Tue, Nov 24, 2015 at 04:00:26PM +0900, Simon Horman wrote:
> I don't see any value in masking warnings with casts.

I assume you mean that you would prefer to either change the callers' type
or uImage's API in order to avoid the need for casts. Choosing to keep
warnings wouldn't make sense; they add noise making it difficult to spot
warnings that point out real problems, and you can't ever turn on -Werror.

In this case I think casts are the right solution. We shouldn't change the
uImage API, as unsigned char is the type generally used for an arbitrary
data stream. The callers could possibly be changed, but they're also free
to use whatever type they want, signed char may well be what they want.
Indeed, the fact that each caller (architecture) has its own wrapper
around the uImage API calls allows for this very thing. Furthermore, an
explicit cast acknowledges that the two types were both chosen by design.
If this patch is wrong, then the warning has done its job and we need to
change the callers.

Thanks,
drew

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2015-11-25 17:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20 17:31 [PATCH 0/4] [RFT] cleanup /chosen/linux,stdout-path warning Andrew Jones
2015-11-20 17:31 ` [PATCH 1/4] uImage: cleanup some warnings Andrew Jones
2015-11-24  7:00   ` Simon Horman
2015-11-25 17:32     ` Andrew Jones [this message]
2015-11-20 17:31 ` [PATCH 2/4] kexec/fs2dt: s/diabled/disabled/ Andrew Jones
2015-11-24  7:00   ` Simon Horman
2015-11-20 17:31 ` [PATCH 3/4] kexec/fs2dt: cleanup pathname Andrew Jones
2015-11-24  7:01   ` Simon Horman
2015-11-20 17:31 ` [PATCH 4/4] kexec/fs2dt: check for /chosen/stdout-path first Andrew Jones
2015-11-24  7:03   ` Simon Horman

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=20151125173224.GA3581@hawk.localdomain \
    --to=drjones@redhat.com \
    --cc=horms@verge.net.au \
    --cc=kexec@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox