From: Sebastien GODARD Date: Sun, 20 Nov 2016 08:57:43 +0000 (+0100) Subject: sar: Remove set_bitmap() function X-Git-Tag: v11.5.3~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=81e5673848b0a7fc81466612ef62cdcb721d8776;p=sysstat sar: Remove set_bitmap() function No need for a specific function since we can use memset() statement. Signed-off-by: Sebastien GODARD --- diff --git a/sa_common.c b/sa_common.c index 3cbed1d..0570429 100644 --- a/sa_common.c +++ b/sa_common.c @@ -49,27 +49,6 @@ int default_file_used = FALSE; extern struct act_bitmap cpu_bitmap; -/* - *************************************************************************** - * Init a bitmap (CPU, IRQ, etc.). - * - * IN: - * @value Value used to init bitmap. - * @sz Size of the bitmap in bytes. - * - * OUT: - * @bitmap Bitmap initialized. - *************************************************************************** - */ -void set_bitmap(unsigned char bitmap[], unsigned char value, unsigned int sz) -{ - register int i; - - for (i = 0; i < sz; i++) { - bitmap[i] = value; - } -} - /* *************************************************************************** * Allocate structures. @@ -1591,12 +1570,11 @@ int parse_sar_opt(char *argv[], int *opt, struct activity *act[], AO_F_MEM_SWAP + AO_F_MEM_ALL; p = get_activity_position(act, A_IRQ, EXIT_IF_NOT_FOUND); - set_bitmap(act[p]->bitmap->b_array, ~0, - BITMAP_SIZE(act[p]->bitmap->b_size)); - + memset(act[p]->bitmap->b_array, ~0, + BITMAP_SIZE(act[p]->bitmap->b_size)); p = get_activity_position(act, A_CPU, EXIT_IF_NOT_FOUND); - set_bitmap(act[p]->bitmap->b_array, ~0, - BITMAP_SIZE(act[p]->bitmap->b_size)); + memset(act[p]->bitmap->b_array, ~0, + BITMAP_SIZE(act[p]->bitmap->b_size)); act[p]->opt_flags = AO_F_CPU_ALL; p = get_activity_position(act, A_FILESYSTEM, EXIT_IF_NOT_FOUND); @@ -1951,8 +1929,8 @@ int parse_sar_I_opt(char *argv[], int *opt, struct activity *act[]) else if (!strcmp(t, K_XALL)) { /* Set every bit except for total number of interrupts */ c = act[p]->bitmap->b_array[0]; - set_bitmap(act[p]->bitmap->b_array, ~0, - BITMAP_SIZE(act[p]->bitmap->b_size)); + memset(act[p]->bitmap->b_array, ~0, + BITMAP_SIZE(act[p]->bitmap->b_size)); act[p]->bitmap->b_array[0] = 0xfe | c; } else { @@ -2034,8 +2012,7 @@ int parse_sa_P_opt(char *argv[], int *opt, unsigned int *flags, struct activity * We still don't know if we are going to read stats * from a file or not... */ - set_bitmap(act[p]->bitmap->b_array, ~0, - BITMAP_SIZE(act[p]->bitmap->b_size)); + memset(act[p]->bitmap->b_array, ~0, BITMAP_SIZE(act[p]->bitmap->b_size)); } else if (!strcmp(t, K_LOWERALL)) { /* Select CPU "all" (ie. global average CPU) */