cleanup: grub_cpu_to_XXX_compile_time for constants
This tries to catch all cases where grub_cpu_to_XXX was used for constant expressions (including sizeof).
This commit is contained in:
parent
6d05b6383c
commit
954fe77163
26 changed files with 98 additions and 93 deletions
|
@ -81,11 +81,11 @@ grub_net_arp_send_request (struct grub_net_network_level_interface *inf,
|
|||
return err;
|
||||
|
||||
arp_header = (struct arphdr *) nb.data;
|
||||
arp_header->hrd = grub_cpu_to_be16 (GRUB_NET_ARPHRD_ETHERNET);
|
||||
arp_header->hrd = grub_cpu_to_be16_compile_time (GRUB_NET_ARPHRD_ETHERNET);
|
||||
arp_header->hln = 6;
|
||||
arp_header->pro = grub_cpu_to_be16 (etherpro);
|
||||
arp_header->pln = addrlen;
|
||||
arp_header->op = grub_cpu_to_be16 (ARP_REQUEST);
|
||||
arp_header->op = grub_cpu_to_be16_compile_time (ARP_REQUEST);
|
||||
aux = (grub_uint8_t *) arp_header + sizeof (*arp_header);
|
||||
/* Sender hardware address. */
|
||||
grub_memcpy (aux, &inf->hwaddress.mac, 6);
|
||||
|
|
|
@ -522,8 +522,8 @@ grub_cmd_bootp (struct grub_command *cmd __attribute__ ((unused)),
|
|||
grub_netbuff_push (nb, sizeof (*udph));
|
||||
|
||||
udph = (struct udphdr *) nb->data;
|
||||
udph->src = grub_cpu_to_be16 (68);
|
||||
udph->dst = grub_cpu_to_be16 (67);
|
||||
udph->src = grub_cpu_to_be16_compile_time (68);
|
||||
udph->dst = grub_cpu_to_be16_compile_time (67);
|
||||
udph->chksum = 0;
|
||||
udph->len = grub_cpu_to_be16 (nb->tail - nb->data);
|
||||
target.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4;
|
||||
|
|
|
@ -611,7 +611,7 @@ grub_net_send_ip6_packet (struct grub_net_network_level_interface *inf,
|
|||
grub_netbuff_push (nb, sizeof (*iph));
|
||||
iph = (struct ip6hdr *) nb->data;
|
||||
|
||||
iph->version_class_flow = grub_cpu_to_be32 ((6 << 28));
|
||||
iph->version_class_flow = grub_cpu_to_be32_compile_time ((6 << 28));
|
||||
iph->len = grub_cpu_to_be16 (nb->tail - nb->data - sizeof (*iph));
|
||||
iph->protocol = proto;
|
||||
iph->ttl = 0xff;
|
||||
|
|
|
@ -306,7 +306,7 @@ grub_net_ipv6_get_link_local (struct grub_net_card *card,
|
|||
return NULL;
|
||||
|
||||
addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6;
|
||||
addr.ipv6[0] = grub_cpu_to_be64 (0xfe80ULL << 48);
|
||||
addr.ipv6[0] = grub_cpu_to_be64_compile_time (0xfe80ULL << 48);
|
||||
addr.ipv6[1] = grub_net_ipv6_get_id (hwaddr);
|
||||
|
||||
FOR_NET_NETWORK_LEVEL_INTERFACES (inf)
|
||||
|
|
|
@ -149,7 +149,7 @@ ack (tftp_data_t data, grub_uint64_t block)
|
|||
return err;
|
||||
|
||||
tftph_ack = (struct tftphdr *) nb_ack.data;
|
||||
tftph_ack->opcode = grub_cpu_to_be16 (TFTP_ACK);
|
||||
tftph_ack->opcode = grub_cpu_to_be16_compile_time (TFTP_ACK);
|
||||
tftph_ack->u.ack.block = grub_cpu_to_be16 (block);
|
||||
|
||||
err = grub_net_send_udp_packet (data->sock, &nb_ack);
|
||||
|
@ -333,7 +333,7 @@ tftp_open (struct grub_file *file, const char *filename)
|
|||
rrq = (char *) tftph->u.rrq;
|
||||
rrqlen = 0;
|
||||
|
||||
tftph->opcode = grub_cpu_to_be16 (TFTP_RRQ);
|
||||
tftph->opcode = grub_cpu_to_be16_compile_time (TFTP_RRQ);
|
||||
grub_strcpy (rrq, filename);
|
||||
rrqlen += grub_strlen (filename) + 1;
|
||||
rrq += grub_strlen (filename) + 1;
|
||||
|
@ -443,8 +443,8 @@ tftp_close (struct grub_file *file)
|
|||
if (!err)
|
||||
{
|
||||
tftph = (struct tftphdr *) nb_err.data;
|
||||
tftph->opcode = grub_cpu_to_be16 (TFTP_ERROR);
|
||||
tftph->u.err.errcode = grub_cpu_to_be16 (TFTP_EUNDEF);
|
||||
tftph->opcode = grub_cpu_to_be16_compile_time (TFTP_ERROR);
|
||||
tftph->u.err.errcode = grub_cpu_to_be16_compile_time (TFTP_EUNDEF);
|
||||
grub_memcpy (tftph->u.err.errmsg, "closed", sizeof ("closed"));
|
||||
|
||||
err = grub_net_send_udp_packet (data->sock, &nb_err);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue