Re: [PATCH] char: fix sparse shadowed variable warnings in cyclades.c

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andrew Morton
Date: Wednesday, February 27, 2008 - 4:34 pm

On Fri, 22 Feb 2008 10:14:15 -0800
Harvey Harrison <harvey.harrison@gmail.com> wrote:


Unrelated to your change, but...

We prefer min_t over casts like this (not sure why, but let's be consistent)

The reason for this cast is that all this code is using `int' for the
transfer count (arguably wrong - should use size_t, but that propagates all
the way to tty_operations.write) but cyclades has

#define SERIAL_XMIT_SIZE        (min(PAGE_SIZE, 4096))

which is unsigned on most architectures.

A possibly-sane fix for all of this is to use min_t in the above then nuke
the casts.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] char: fix sparse shadowed variable warnings in ..., Andrew Morton, (Wed Feb 27, 4:34 pm)