linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] aoe: suppress compiler warnings
@ 2013-08-26  9:45 Andy Shevchenko
  2013-08-26 14:05 ` Ed Cashin
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2013-08-26  9:45 UTC (permalink / raw)
  To: linux-kernel, Ed L. Cashin, Andrew Morton; +Cc: Andy Shevchenko

This patch fixes following compiler warnings:

drivers/block/aoe/aoecmd.c: In function ‘aoecmd_ata_rw’:
drivers/block/aoe/aoecmd.c:383:17: warning: variable ‘t’ set but not used [-Wunused-but-set-variable]
  struct aoetgt *t;
                 ^
drivers/block/aoe/aoecmd.c: In function ‘resend’:
drivers/block/aoe/aoecmd.c:488:21: warning: variable ‘ah’ set but not used [-Wunused-but-set-variable]
  struct aoe_atahdr *ah;
                     ^
drivers/block/aoe/aoedev.c: In function 'user_req':
drivers/block/aoe/aoedev.c:252:174: warning: comparison of distinct pointer types lacks a cast [enabled by default]
  lim = min(sizeof(d->gd->disk_name) - (p - d->gd->disk_name), slen);
                                                               ^

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/block/aoe/aoecmd.c | 4 ----
 drivers/block/aoe/aoedev.c | 3 ++-
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index 4d45dba..d251543 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -380,7 +380,6 @@ aoecmd_ata_rw(struct aoedev *d)
 {
 	struct frame *f;
 	struct buf *buf;
-	struct aoetgt *t;
 	struct sk_buff *skb;
 	struct sk_buff_head queue;
 	ulong bcnt, fbcnt;
@@ -391,7 +390,6 @@ aoecmd_ata_rw(struct aoedev *d)
 	f = newframe(d);
 	if (f == NULL)
 		return 0;
-	t = *d->tgt;
 	bcnt = d->maxbcnt;
 	if (bcnt == 0)
 		bcnt = DEFAULTBCNT;
@@ -485,7 +483,6 @@ resend(struct aoedev *d, struct frame *f)
 	struct sk_buff *skb;
 	struct sk_buff_head queue;
 	struct aoe_hdr *h;
-	struct aoe_atahdr *ah;
 	struct aoetgt *t;
 	char buf[128];
 	u32 n;
@@ -500,7 +497,6 @@ resend(struct aoedev *d, struct frame *f)
 		return;
 	}
 	h = (struct aoe_hdr *) skb_mac_header(skb);
-	ah = (struct aoe_atahdr *) (h+1);
 
 	if (!(f->flags & FFL_PROBE)) {
 		snprintf(buf, sizeof(buf),
diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c
index 6f68095..29dcea3 100644
--- a/drivers/block/aoe/aoedev.c
+++ b/drivers/block/aoe/aoedev.c
@@ -249,7 +249,8 @@ user_req(char *s, size_t slen, struct aoedev *d)
 	if (!d->gd)
 		return 0;
 	p = kbasename(d->gd->disk_name);
-	lim = min(sizeof(d->gd->disk_name) - (p - d->gd->disk_name), slen);
+	lim = min_t(size_t, sizeof(d->gd->disk_name) - (p - d->gd->disk_name),
+		slen);
 
 	return !strncmp(s, p, lim);
 }
-- 
1.8.4.rc3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] aoe: suppress compiler warnings
  2013-08-26  9:45 [PATCH] aoe: suppress compiler warnings Andy Shevchenko
@ 2013-08-26 14:05 ` Ed Cashin
  0 siblings, 0 replies; 2+ messages in thread
From: Ed Cashin @ 2013-08-26 14:05 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-kernel, Andrew Morton

On Aug 26, 2013, at 5:45 AM, Andy Shevchenko wrote:

> This patch fixes following compiler warnings:
> 
> drivers/block/aoe/aoecmd.c: In function ‘aoecmd_ata_rw’:
> drivers/block/aoe/aoecmd.c:383:17: warning: variable ‘t’ set but not used [-Wunused-but-set-variable]
>  struct aoetgt *t;
>                 ^

Looks good, thanks.

-- 
  Ed Cashin
  ecashin@coraid.com



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-08-26 14:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-26  9:45 [PATCH] aoe: suppress compiler warnings Andy Shevchenko
2013-08-26 14:05 ` Ed Cashin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).