drivers/char/agp: Convert to generic boolean
Subsystems (2)
PATCH 1/1 drivers/char/agp: Convert to generic boolean
drivers/char/agp/
Convert to generic booleans
include/linux/agpgart.h
Removed defines of FALSE/TRUE
was only used under drivers/char/agp/
struct agp_front_data {
Removed used_by_controller
only assigned 'false' once and never used
Convert backend_acquired from 'u8' to 'bool'
only used in drivers/char/agp/ and only as a boolean value
---
Compile-tested with "allyes", "allmod" & "allno"
drivers/char/agp/amd-k7-agp.c | 4 ++-- drivers/char/agp/amd64-agp.c | 4 ++-- drivers/char/agp/ati-agp.c | 4 ++-- drivers/char/agp/compat_ioctl.c | 2 +- drivers/char/agp/efficeon-agp.c | 4 ++-- drivers/char/agp/frontend.c | 11 +++++------ drivers/char/agp/generic.c | 22 +++++++++++----------- drivers/char/agp/hp-agp.c | 4 ++-- drivers/char/agp/intel-agp.c | 8 ++++---- drivers/char/agp/nvidia-agp.c | 4 ++-- drivers/char/agp/parisc-agp.c | 4 ++-- drivers/char/agp/sgi-agp.c | 4 ++-- drivers/char/agp/sworks-agp.c | 4 ++-- include/linux/agpgart.h | 11 +---------- 14 files changed, 40 insertions(+), 50 deletions(-)
drivers/char/agp/amd-k7-agp.c +2 -2
@@ -308,9 +308,9 @@ static int amd_insert_memory(struct agp_memory *mem, off_t pg_start, int type) j++; } -if (mem->is_flushed == FALSE) { +if (!mem->is_flushed) {global_cache_flush (); - mem->is_flushed = TRUE; + mem->is_flushed = true; }for (i =0 , j = pg_start; i < mem->page_count; i++, j++) {
drivers/char/agp/amd64-agp.c +2 -2
@@ -89,9 +89,9 @@ static int amd64_insert_memory(struct agp_memory *mem, off_t pg_start, int type) j++; } -if (mem->is_flushed == FALSE) { +if (!mem->is_flushed) {global_cache_flush (); - mem->is_flushed = TRUE; + mem->is_flushed = true; }for (i =0 , j = pg_start; i < mem->page_count; i++, j++) {
drivers/char/agp/ati-agp.c +2 -2
@@ -299,10 +299,10 @@ static int ati_insert_memory(struct agp_memory * mem, j++; } -if (mem->is_flushed == FALSE) { +if (!mem->is_flushed) {/*CACHE_FLUSH(); */ global_cache_flush (); - mem->is_flushed = TRUE; + mem->is_flushed = true; }for (i =0 , j = pg_start; i < mem->page_count; i++, j++) {
drivers/char/agp/compat_ioctl.c +1 -1
@@ -213,7 +213,7 @@ long compat_agp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ret_val = -EINVAL ; goto ioctl_out; } -if ((agp_fe.backend_acquired != TRUE) && +if (!agp_fe.backend_acquired && (cmd !=AGPIOC_ACQUIRE32 )) { ret_val = -EBUSY ; goto ioctl_out;
drivers/char/agp/efficeon-agp.c +2 -2
@@ -249,9 +249,9 @@ static int efficeon_insert_memory(struct agp_memory * mem, off_t pg_start, int tif (type !=0 || mem->type !=0 )return -EINVAL ; -if (mem->is_flushed == FALSE) { +if (!mem->is_flushed) {global_cache_flush (); - mem->is_flushed = TRUE; + mem->is_flushed = true; } last_page =NULL ;
drivers/char/agp/frontend.c +5 -6
@@ -393,7 +393,7 @@ static int agp_remove_controller(struct agp_controller *controller)if (agp_fe.current_controller == controller) { agp_fe.current_controller =NULL ; - agp_fe.backend_acquired = FALSE; + agp_fe.backend_acquired = false;agp_backend_release (agp_bridge); }kfree (controller);
@@ -441,7 +441,6 @@ static void agp_controller_release_current(struct agp_controller *controller, } agp_fe.current_controller =NULL ; - agp_fe.used_by_controller = FALSE;agp_backend_release (agp_bridge); }
@@ -571,7 +570,7 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma)mutex_lock (&(agp_fe.agp_mutex)); -if (agp_fe.backend_acquired != TRUE) +if (!agp_fe.backend_acquired) goto out_eperm;if (!(test_bit (AGP_FF_IS_VALID , &priv->access_flags)))
@@ -766,7 +765,7 @@ int agpioc_acquire_wrap(struct agp_file_private *priv)atomic_inc (&agp_bridge->agp_in_use); - agp_fe.backend_acquired = TRUE; + agp_fe.backend_acquired = true; controller =agp_find_controller_by_pid (priv->my_pid);
@@ -776,7 +775,7 @@ int agpioc_acquire_wrap(struct agp_file_private *priv) controller =agp_create_controller (priv->my_pid);if (controller ==NULL ) { - agp_fe.backend_acquired = FALSE; + agp_fe.backend_acquired = false;agp_backend_release (agp_bridge);return -ENOMEM ; }
@@ -972,7 +971,7 @@ static int agp_ioctl(struct inode *inode, struct file *file, ret_val = -EINVAL ; goto ioctl_out; } -if ((agp_fe.backend_acquired != TRUE) && +if (!agp_fe.backend_acquired && (cmd !=AGPIOC_ACQUIRE )) { ret_val = -EBUSY ; goto ioctl_out;
drivers/char/agp/generic.c +11 -11
@@ -202,7 +202,7 @@ void agp_free_memory(struct agp_memory *curr)if (curr ==NULL )return ; -if (curr->is_bound == TRUE) +if (curr->is_bound)agp_unbind_memory (curr);if (curr->type >=AGP_USER_TYPES ) {
@@ -425,20 +425,20 @@ int agp_bind_memory(struct agp_memory *curr, off_t pg_start)if (curr ==NULL )return -EINVAL ; -if (curr->is_bound == TRUE) { +if (curr->is_bound) { printk(KERN_INFO PFX "memory %p is already bound!\n", curr);return -EINVAL ; } -if (curr->is_flushed == FALSE) { +if (!curr->is_flushed) { curr->bridge->driver->cache_flush (); - curr->is_flushed = TRUE; + curr->is_flushed = true; } ret_val = curr->bridge->driver->insert_memory (curr, pg_start, curr->type);if (ret_val !=0 )return ret_val; - curr->is_bound = TRUE; + curr->is_bound = true; curr->pg_start = pg_start;return 0 ; }
@@ -460,7 +460,7 @@ int agp_unbind_memory(struct agp_memory *curr)if (curr ==NULL )return -EINVAL ; -if (curr->is_bound != TRUE) { +if (!curr->is_bound) { printk(KERN_INFO PFX "memory %p was not bound!\n", curr);return -EINVAL ; }
@@ -470,7 +470,7 @@ int agp_unbind_memory(struct agp_memory *curr)if (ret_val !=0 )return ret_val; - curr->is_bound = FALSE; + curr->is_bound = false; curr->pg_start =0 ;return 0 ; }
@@ -832,7 +832,7 @@ void agp_generic_enable(struct agp_bridge_data *bridge, u32 requested_mode)/* If we have 3.5, we can do the isoch stuff. */ if (bridge->minor_version >=5 )agp_3_5_enable (bridge); -agp_device_command (bridge_agpstat, TRUE); +agp_device_command (bridge_agpstat, true);return ; }else {/* Disable calibration cycle in RX91<1> when not in AGP3.0 mode of operation.*/
@@ -849,7 +849,7 @@ void agp_generic_enable(struct agp_bridge_data *bridge, u32 requested_mode) }/* AGP v<3 */ -agp_device_command (bridge_agpstat, FALSE); +agp_device_command (bridge_agpstat, false); }EXPORT_SYMBOL (agp_generic_enable);
@@ -1088,9 +1088,9 @@ int agp_generic_insert_memory(struct agp_memory * mem, off_t pg_start, int type) j++; } -if (mem->is_flushed == FALSE) { +if (!mem->is_flushed) { bridge->driver->cache_flush (); - mem->is_flushed = TRUE; + mem->is_flushed = true; }for (i =0 , j = pg_start; i < mem->page_count; i++, j++) {
drivers/char/agp/hp-agp.c +2 -2
@@ -355,9 +355,9 @@ hp_zx1_insert_memory (struct agp_memory *mem, off_t pg_start, int type) j++; } -if (mem->is_flushed == FALSE) { +if (!mem->is_flushed) {global_cache_flush (); - mem->is_flushed = TRUE; + mem->is_flushed = true; }for (i =0 , j = io_pg_start; i < mem->page_count; i++) {
drivers/char/agp/intel-agp.c +4 -4
@@ -1435,7 +1435,7 @@ static const struct agp_bridge_driver intel_810_driver = { .aperture_sizes = intel_i810_sizes, .size_type = FIXED_APER_SIZE, .num_aperture_sizes = 2, - .needs_scratch_page = TRUE, + .needs_scratch_page = true, .configure = intel_i810_configure, .fetch_size = intel_i810_fetch_size, .cleanup = intel_i810_cleanup,
@@ -1484,7 +1484,7 @@ static const struct agp_bridge_driver intel_830_driver = { .aperture_sizes = intel_i830_sizes, .size_type = FIXED_APER_SIZE, .num_aperture_sizes = 4, - .needs_scratch_page = TRUE, + .needs_scratch_page = true, .configure = intel_i830_configure, .fetch_size = intel_i830_fetch_size, .cleanup = intel_i830_cleanup,
@@ -1653,7 +1653,7 @@ static const struct agp_bridge_driver intel_915_driver = { .aperture_sizes = intel_i830_sizes, .size_type = FIXED_APER_SIZE, .num_aperture_sizes = 4, - .needs_scratch_page = TRUE, + .needs_scratch_page = true, .configure = intel_i915_configure, .fetch_size = intel_i9xx_fetch_size, .cleanup = intel_i915_cleanup,
@@ -1678,7 +1678,7 @@ static const struct agp_bridge_driver intel_i965_driver = { .aperture_sizes = intel_i830_sizes, .size_type = FIXED_APER_SIZE, .num_aperture_sizes = 4, - .needs_scratch_page = TRUE, + .needs_scratch_page = true, .configure = intel_i915_configure, .fetch_size = intel_i9xx_fetch_size, .cleanup = intel_i915_cleanup,
drivers/char/agp/nvidia-agp.c +2 -2
@@ -211,9 +211,9 @@ static int nvidia_insert_memory(struct agp_memory *mem, off_t pg_start, int typereturn -EBUSY ; } -if (mem->is_flushed == FALSE) { +if (!mem->is_flushed) {global_cache_flush (); - mem->is_flushed = TRUE; + mem->is_flushed = true; }for (i =0 , j = pg_start; i < mem->page_count; i++, j++) { writel(agp_bridge->driver->mask_memory(agp_bridge,
drivers/char/agp/parisc-agp.c +2 -2
@@ -144,9 +144,9 @@ parisc_agp_insert_memory(struct agp_memory *mem, off_t pg_start, int type) j++; } -if (mem->is_flushed == FALSE) { +if (!mem->is_flushed) {global_cache_flush (); - mem->is_flushed = TRUE; + mem->is_flushed = true; }for (i =0 , j = io_pg_start; i < mem->page_count; i++) {
drivers/char/agp/sgi-agp.c +2 -2
@@ -184,9 +184,9 @@ static int sgi_tioca_insert_memory(struct agp_memory *mem, off_t pg_start, j++; } -if (mem->is_flushed == FALSE) { +if (!mem->is_flushed) { bridge->driver->cache_flush (); - mem->is_flushed = TRUE; + mem->is_flushed = true; }for (i =0 , j = pg_start; i < mem->page_count; i++, j++) {
drivers/char/agp/sworks-agp.c +2 -2
@@ -347,9 +347,9 @@ static int serverworks_insert_memory(struct agp_memory *mem, j++; } -if (mem->is_flushed == FALSE) { +if (!mem->is_flushed) {global_cache_flush (); - mem->is_flushed = TRUE; + mem->is_flushed = true; }for (i =0 , j = pg_start; i < mem->page_count; i++, j++) {
include/linux/agpgart.h +1 -10
@@ -41,14 +41,6 @@#define AGP_DEVICE "/dev/agpgart" -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif -#ifndef __KERNEL__#include <linux/types.h> #include <asm/types.h>
@@ -205,8 +197,7 @@ struct agp_front_data {struct agp_controller *current_controller;struct agp_controller *controllers;struct agp_file_private *file_priv_list; -u8 used_by_controller; - u8 backend_acquired; + bool backend_acquired; };#endif /* __KERNEL__ */
A message that is not in the archive (sent off-list or not yet received): 1174178837.15270.13.camel@localhost
Please use "Reply All"
Quoted 10 lines · Joe Perches
Quoted 8 lines · Richard Knutsson
drivers/char/agp/amd-k7-agp.c +0
-0@@ -308,9 +308,9 @@ static int amd_insert_memory(struct agp_memory *mem, off_t pg_start, int type) j++; }
Quoted 10 lines
drivers/char/agp/amd-k7-agp.c static int amd_insert_memory(struct agp_memory *mem, off_t pg_start, int type) · line 315
Quoted 7 lines
drivers/char/agp/amd-k7-agp.c +2
-2-if (mem->is_flushed == FALSE) { +if (!mem->is_flushed) {global_cache_flush (); - mem->is_flushed = TRUE; + mem->is_flushed = true; }perhaps a
generic.c/agp.hfunction?
Sound like a good idea (not in a boolean cleanup-patch thou) Would you mind making that patch?
Richard Knutsson