All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: "linux-fbdev@vger.kernel.org" <linux-fbdev@vger.kernel.org>,
	Jean Delvare <jdelvare@suse.com>,
	"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Sathya Prakash <sathya.prakash@broadcom.com>,
	the arch/x86 maintainers <x86@kernel.org>,
	linux-block <linux-block@vger.kernel.org>,
	IDE-ML <linux-ide@vger.kernel.org>,
	Network Development <netdev@vger.kernel.org>,
	Tejun Heo <tj@kernel.org>,
	xen-devel <xen-devel@lists.xenproject.org>,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: Lots of new warnings with gcc-7.1.1
Date: Tue, 11 Jul 2017 20:41:09 -0700	[thread overview]
Message-ID: <CA+55aFx5mCk+nzDG+gGzDUqE4gzJVERL_oO+PN-PA6oKaUhCpg__24428.7612069913$1499830936$gmane$org@mail.gmail.com> (raw)
In-Reply-To: <CA+55aFyKpezj3oHwtBShyf9x-DJNAGQhrq55iVGM42eWKQtP3w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1132 bytes --]

On Tue, Jul 11, 2017 at 8:17 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> If that's the case, I'd prefer just turning off the format-truncation
> (but not overflow) warning with '-Wno-format-trunction".

Doing

 KBUILD_CFLAGS  += $(call cc-disable-warning, format-truncation)

in the main Makefile certainly cuts down on the warnings.

We still have some overflow warnings, including the crazy one where
gcc doesn't see that the number of max7315 boards is very limited.

But those could easily be converted to just snprintf() instead, and
then the truncation warning disabling takes care of it. Maybe that's
the right answer.

We also have about a bazillion

    warning: ‘*’ in boolean context, suggest ‘&&’ instead

warnings in drivers/ata/libata-core.c, all due to a single macro that
uses a pattern that gcc-7.1.1 doesn't like. The warning looks a bit
debatable, but I suspect the macro could easily be changed too.

Tejun, would you hate just moving the "multiply by 1000" part _into_
that EZ() macro? Something like the attached (UNTESTED!) patch?

              Linus

[-- Attachment #2: patch.diff --]
[-- Type: text/plain, Size: 1404 bytes --]

 drivers/ata/libata-core.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 8453f9a4682f..4c7d5a138495 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3231,19 +3231,19 @@ static const struct ata_timing ata_timing[] = {
 };
 
 #define ENOUGH(v, unit)		(((v)-1)/(unit)+1)
-#define EZ(v, unit)		((v)?ENOUGH(v, unit):0)
+#define EZ(v, unit)		((v)?ENOUGH((v)*1000, unit):0)
 
 static void ata_timing_quantize(const struct ata_timing *t, struct ata_timing *q, int T, int UT)
 {
-	q->setup	= EZ(t->setup      * 1000,  T);
-	q->act8b	= EZ(t->act8b      * 1000,  T);
-	q->rec8b	= EZ(t->rec8b      * 1000,  T);
-	q->cyc8b	= EZ(t->cyc8b      * 1000,  T);
-	q->active	= EZ(t->active     * 1000,  T);
-	q->recover	= EZ(t->recover    * 1000,  T);
-	q->dmack_hold	= EZ(t->dmack_hold * 1000,  T);
-	q->cycle	= EZ(t->cycle      * 1000,  T);
-	q->udma		= EZ(t->udma       * 1000, UT);
+	q->setup	= EZ(t->setup,      T);
+	q->act8b	= EZ(t->act8b,      T);
+	q->rec8b	= EZ(t->rec8b,      T);
+	q->cyc8b	= EZ(t->cyc8b,      T);
+	q->active	= EZ(t->active,     T);
+	q->recover	= EZ(t->recover,    T);
+	q->dmack_hold	= EZ(t->dmack_hold, T);
+	q->cycle	= EZ(t->cycle,      T);
+	q->udma		= EZ(t->udma,       UT);
 }
 
 void ata_timing_merge(const struct ata_timing *a, const struct ata_timing *b,

[-- Attachment #3: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-07-12  3:41 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-11 22:35 Lots of new warnings with gcc-7.1.1 Linus Torvalds
2017-07-11 22:35 ` Linus Torvalds
2017-07-11 22:35 ` Linus Torvalds
2017-07-11 23:54 ` Marcel Holtmann
2017-07-11 23:54 ` Marcel Holtmann
2017-07-11 23:54   ` Marcel Holtmann
2017-07-12  3:10 ` Guenter Roeck
2017-07-12  3:10   ` Guenter Roeck
2017-07-12  3:17   ` Linus Torvalds
2017-07-12  3:17     ` Linus Torvalds
2017-07-12  3:41     ` Linus Torvalds
2017-07-12  3:41       ` Linus Torvalds
2017-07-12 13:31       ` Arnd Bergmann
2017-07-12 13:31         ` Arnd Bergmann
2017-07-12 13:31         ` Arnd Bergmann
2017-07-15 11:03         ` Tejun Heo
2017-07-15 11:03         ` Tejun Heo
2017-07-15 11:03           ` Tejun Heo
2017-07-12 13:31       ` Arnd Bergmann
2017-07-12  3:41     ` Linus Torvalds [this message]
2017-07-12  3:17   ` Linus Torvalds
2017-07-12  3:10 ` Guenter Roeck
2017-07-12  4:19 ` Jakub Kicinski
2017-07-12  4:19 ` Jakub Kicinski
2017-07-12  4:19   ` Jakub Kicinski
2017-07-12 12:37 ` Mauro Carvalho Chehab
2017-07-12 12:37 ` Mauro Carvalho Chehab
2017-07-12 12:37   ` Mauro Carvalho Chehab
2017-07-12 13:10 ` Greg Kroah-Hartman
2017-07-12 13:10 ` Greg Kroah-Hartman
2017-07-12 13:10   ` Greg Kroah-Hartman
2017-07-12 13:51   ` Arnd Bergmann
2017-07-12 13:51     ` Arnd Bergmann
2017-07-12 13:51   ` Arnd Bergmann
2017-07-11 22:35 Linus Torvalds

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='CA+55aFx5mCk+nzDG+gGzDUqE4gzJVERL_oO+PN-PA6oKaUhCpg__24428.7612069913$1499830936$gmane$org@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jdelvare@suse.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=netdev@vger.kernel.org \
    --cc=sathya.prakash@broadcom.com \
    --cc=tj@kernel.org \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.